Say I want to write the following C program in MIPS:
int main () { return 5; }
When I try the following MIPS code in MARS:
Use syscall 17:
exit2 (terminate with value) ---------------------------- $v0 = 17 $a0 = termination result
Note that "If the MIPS program is run under control of the MARS graphical interface (GUI), the exit code in $a0 is ignored."