MIPS/GCC Procedure Calling Conventions (cont.)
Step-1: Put returned values in registers $v0, [$v1]. (if values are returned)
Step-2: Restore callee-saved registers.
- Restore $fp and other saved registers. [$ra, $s0 - $s7]
Step-3: Pop the stack
- Add the frame size to $sp. addiu $sp, $sp, <frame-size>
Step-4: Return
- Jump to the address in $ra. jr $ra