summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/instructions.s43
1 files changed, 35 insertions, 8 deletions
diff --git a/examples/instructions.s b/examples/instructions.s
index f16e6c1..5379657 100644
--- a/examples/instructions.s
+++ b/examples/instructions.s
@@ -1,8 +1,35 @@
-movl $4, %eax
-movl $1, %ebx
-movl $1, %eax
-movl $0, %ebx
-int $0x80
-
-movl $str, %ecx
-movl $str_len, %edx
+# R-Type
+add x5, x6, x7
+sub x10, x11, x12
+and x1, x2, x3
+sll x8, x9, x10o
+
+# 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