summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-09-22 23:39:22 -0400
committerFreya Murphy <freya@freyacat.org>2024-09-22 23:39:22 -0400
commit49af3bfc627331f33efed10804db63687a1ddd7a (patch)
tree56267cbc61285bb60b03f0a6cab99902507283dc /lib
parentmake mld file executable (diff)
downloadmips-49af3bfc627331f33efed10804db63687a1ddd7a.tar.gz
mips-49af3bfc627331f33efed10804db63687a1ddd7a.tar.bz2
mips-49af3bfc627331f33efed10804db63687a1ddd7a.zip
multitude of mld fixes, add entrypoint
Diffstat (limited to 'lib')
-rw-r--r--lib/runtime.asm29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/runtime.asm b/lib/runtime.asm
new file mode 100644
index 0000000..5cb4458
--- /dev/null
+++ b/lib/runtime.asm
@@ -0,0 +1,29 @@
+#
+# MIPS32r6 ASSEMBLY RUNTIME
+# - sets up the stack
+# - calls main
+# - exits
+#
+
+.extern main
+
+.stack
+.align 2
+
+.space 4096
+__mips_stack:
+
+.text
+.align 2
+
+_start:
+ # setup stack
+ la $sp, __mips_stack
+
+ # call main
+ jal main
+
+ # exit
+ move $a0, $v0
+ li $v0, 1
+ syscall