aboutsummaryrefslogtreecommitdiffstats
path: root/ex.pack
diff options
context:
space:
mode:
authors-ol <s+removethis@s-ol.nu>2021-05-27 09:54:05 +0000
committers-ol <s+removethis@s-ol.nu>2021-06-08 14:01:39 +0000
commit848e84b0948e3cf60cd118e3d2f507f20920e06c (patch)
tree4bd869f57284425a94b7b711a27c4c230d77d424 /ex.pack
parentapply "black" formatting (diff)
downloadsubv-848e84b0948e3cf60cd118e3d2f507f20920e06c.tar.gz
subv-848e84b0948e3cf60cd118e3d2f507f20920e06c.zip
fix jalr immediate slice, update example stage results
Diffstat (limited to 'ex.pack')
-rw-r--r--ex.pack16
1 files changed, 15 insertions, 1 deletions
diff --git a/ex.pack b/ex.pack
index 2bef2a1..5a6cdf4 100644
--- a/ex.pack
+++ b/ex.pack
@@ -1,9 +1,23 @@
== code 0x80000000
+# repeatedly print "Hi\n"
+# main:
+# load 0x10010000 (UART0) into t0
b7 02 01 10
+# store 0x48 (H) in UART0+0
13 03 80 04
23 a0 62 00
+# store 0x69 (i) in UART0+0
13 03 90 06
23 a0 62 00
+# store 0x0a (\n) in UART0+0
13 03 a0 00
23 a0 62 00
-6f f0 5f fe
+# jump back up to the top (three versions):
+# a) jal 21bit relative (with 0th bit forced to 0)
+# 6f/jal 0/rd/x0 main/off21
+# b) auipc+jalr 32bit relative (note label offset)
+97 f3 ff ff
+67 80 43 fe
+# c) lui+jalr 32bit absolute
+# 37/lui 7/rd/t2 main/imm32
+# 67/jalr 0/subop 0/rd/x0 7/rs/t2 main/imm32