aboutsummaryrefslogtreecommitdiff
path: root/tasm/os.tasm
diff options
context:
space:
mode:
Diffstat (limited to 'tasm/os.tasm')
-rw-r--r--tasm/os.tasm17
1 files changed, 17 insertions, 0 deletions
diff --git a/tasm/os.tasm b/tasm/os.tasm
new file mode 100644
index 0000000..164f9fe
--- /dev/null
+++ b/tasm/os.tasm
@@ -0,0 +1,17 @@
+// trivial stuff to make sure simulator exits once test program is run and
+// making sure our _start is the first thing in the object file
+_start:
+ // random starting stack location
+ li sp, 13122
+ mv fp, sp
+ call ra, main
+ li t0, 3
+ csrrw mpower, x0, t0
+
+// simple I/O
+_putchar:
+ li t0, 19683
+ st t a0, 0(t0)
+ ret ra
+
+// include the rest of the test program here, doesn't really matter how