From ab276c733ce9dc80983e5c8ae5c530e1477cf990 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sun, 31 Mar 2024 23:10:44 +0300 Subject: implement more meta instructions + Also have a working draft of ABI names for registers, matches qbt currently but should probably codify somewhere --- tasm/os.tasm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tasm/os.tasm (limited to 'tasm/os.tasm') 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 -- cgit v1.3