aboutsummaryrefslogtreecommitdiff
path: root/prog/src/prog.s
blob: 27595549e0c13863ecb4c6945ec23af7b3de8255 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
.section .text
.globl _start

_start:
  
  # testing alu
/*
  addi  t0, zero, 5
  addi  t1, zero, 3
  
  #add   t2, t0,   t1
  #sub   t2, t0,   t1
  
  xor   t2, t0,   t1
  or    t2, t0,   t1
  and   t2, t0,   t1

  slt   t2, t0,   t1
  slt   t2, t1,   t0

  addi  t0, zero, -1

  slt   t2, t0,   t1
  slt   t2, t1,   t0

  sltu  t2, t0,   t1
  sltu  t2, t1,   t0

  addi  t0, zero, 1

  sll   t2, t0,   31 
  sra   t2, t2,   31
  sll   t2, t0,   31 
  srl   t2, t2,   31
*/

 
  jal target
  addi  t0, zero, 2

  

halt_loop:
  j halt_loop

target:
  addi  t0, zero, 1
  jalr  zero, ra, 0
 
.section .data


.section .bss

.section .stack
  .space 0x1000  # Allocate stack space
stack_top: