I\'m currently working with assembly language under the MIPS processor. I\'m currently using MARS simulator and for reasons unknown I get the following error message after every
You probably finish your program with a jr $ra
(return to caller). However, the code executed by MARS doesn't have a caller - it's executed at startup and has no function to return to, so the contents of $ra
are zero.
The correct way to end a program on MARS is using the "exit" syscall:
li $v0, 10
syscall