summaryrefslogtreecommitdiff
path: root/examples/instructions.s
blob: d3a7fab886e514d48e7af37f689e65aa41c063d6 (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
# R-Type
add x5, x6, x7
sub x10, x11, x12
and x1, x2, x3
sll x8, x9, x10

# I-Type
addi x5, x6, 10
andi x1, x2, 3

# I-Type
lw x5, 0(x6)
lh x3, 4(x8)

# I-Type
jalr x1, 0(x5)

# S-Type
sw x5, 0(x6)
sb x3, 8(x4)
sh x10, 12(x2)

# B-Type
beq x5, x6, loop
bne x1, x2, done
blt x3, x4, less
bge x7, x8, end

# U-Type
lui x5, 0x12345
auipc x10, 0x20000

# J-Type
jal x1, function
jal x0, loop