I don't have a syscall code in my MIPS instruction, however i开发者_C百科n the simulator I can see the following:
I don't have any of the following code line in my .s
li $v0 10
syscall
Why is that? It's bothering me as it gives me a bad address in the syscall
It's a syscall used by the simulator to exit from the program (it gives control back to operating system), you can get a summary of available syscall of Spim here: link.
The simulator adds a bootstrap at the beginning and an end section at the end of your program. Since you specify which syscall
to execute by loading the corresponding value in register $v0
that's what it actually does: set the syscall to be the exit
one and the call it with syscall
.
精彩评论