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
|
2024-10-01 22:22:10 +00:00
|
|
|
nop
|
2024-09-23 03:39:22 +00:00
|
|
|
|
|
|
|
# exit
|
2024-09-30 22:52:15 +00:00
|
|
|
move $a0, $v0
|
|
|
|
li $v0, 60
|
2024-09-23 03:39:22 +00:00
|
|
|
syscall
|