diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-03-31 23:10:44 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-03-31 23:10:44 +0300 |
| commit | ab276c733ce9dc80983e5c8ae5c530e1477cf990 (patch) | |
| tree | ef5da32c91d27da7a53a26e8d501f0ea616558c8 /tasm/os.tasm | |
| parent | a152fbd956cc9cb9c05a233abe004ba3d12767a0 (diff) | |
| download | tri-ab276c733ce9dc80983e5c8ae5c530e1477cf990.tar.gz tri-ab276c733ce9dc80983e5c8ae5c530e1477cf990.zip | |
implement more meta instructions
+ Also have a working draft of ABI names for registers, matches qbt
currently but should probably codify somewhere
Diffstat (limited to 'tasm/os.tasm')
| -rw-r--r-- | tasm/os.tasm | 17 |
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 |
