mips/lib/runtime.asm

32 lines
287 B
NASM
Raw Normal View History

2024-09-23 03:39:22 +00:00
#
# MIPS32r6 ASSEMBLY RUNTIME
# - sets up the stack
# - calls main
# - exits
#
.extern main
2024-09-23 14:13:46 +00:00
.globl _start
2024-09-23 03:39:22 +00:00
.stack
.align 2
.space 4096
__mips_stack:
.text
.align 2
_start:
# setup stack
la $sp, __mips_stack
# call main
jal main
nop
2024-09-23 03:39:22 +00:00
# exit
move $a0, $v0
li $v0, 60
2024-09-23 03:39:22 +00:00
syscall