A good answer might be:

lw $t5,12( $fp )

Frame Pointer

Register $30 is reserved, by software convention, for use as a frame pointer. In the extended assembler it has the mnemonic name $fp. When a subroutine starts running, the frame pointer and the stack pointer contain the same address.

But the stack (and the stack pointer) may be involved in arithmetic expression evaluation. This often involves pushing and popping values onto the stack. If $sp keeps changing, it is hard to write code that accesses a fixed location on the stack like a variable.

To make things easy for compilers (and for human assembly language programmers) it is convenient to have a frame pointer that does not change its value while a subroutine is active.

When a routine calls a subroutine, the routine's frame pointer is pushed onto the stack along with the other caller-saved registers. Now the subroutine sets the frame pointer to the address of its stack frame.


QUESTION 4:

When a subroutine first starts executing, is the address in the frame pointer equal to the address of the top of the stack?