Yes. However, the stack may grow as the subroutine executes.
But the frame pointer for the subroutine does not change.
The stack pointer ($sp
) is always equal to the
top of stack.
Imagine that the following statement is part of the subroutine whose stack frame is at right:
a = b + i + j;
This is how a compiler might implement that statement:
lw $t0,8($fp) # get b lw $t1,4($fp) # get i lw $t2,0($fp) # get j addu $t3,$t0,$t1 # b + i addu $t3,$t3,$t2 # b + i + j sw $t3,12($fp) # a =