aboutsummaryrefslogtreecommitdiffstats
path: root/examples/ex.valid
diff options
context:
space:
mode:
Diffstat (limited to 'examples/ex.valid')
-rw-r--r--examples/ex.valid16
1 files changed, 16 insertions, 0 deletions
diff --git a/examples/ex.valid b/examples/ex.valid
new file mode 100644
index 0000000..1652954
--- /dev/null
+++ b/examples/ex.valid
@@ -0,0 +1,16 @@
+== code 0x80000000
+# repeatedly print "Hi\n"
+main:
+# load 0x10010000 (UART0) into t0
+37/u 5/rd 10010/imm20
+# store 0x48 (H) in UART0+0
+13/i 6/rd 0/funct3 0/rs 48/imm12
+23/s 5/rs1 0/imm12 2/funct3 6/rs2
+# store 0x69 (i) in UART0+0
+13/i 6/rd 0/funct3 0/rs 69/imm12
+23/s 5/rs1 0/imm12 2/funct3 6/rs2
+# store 0x0a (\n) in UART0+0
+13/i 6/rd 0/funct3 0/rs a/imm12
+23/s 5/rs1 0/imm12 2/funct3 6/rs2
+# jump back up to the top
+6f/j 0/rd main/off21