开发者

strange instruction call in MIPS

开发者 https://www.devze.com 2022-12-21 14:00 出处:网络
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 a syscall code in my MIPS instruction, however i开发者_C百科n the simulator I can see the following:

strange instruction call in MIPS

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号