A "leaf function" is one that doesn't call any other function. If you drew a tree illustrating function calls in the program, it would be a leaf node in the tree. If the leaf function does not change any saved registers, it does not need to save anything to the Stack.
First save the "unsaved" registers if we will still care
about them after procedure returns
($t0, ..., $t9, $a0, ..., $a3
).
Where do they get saved?   the Stack (we'll talk about this in a minute)
$a0, ..., $a3
)
jal ProcedureAddress
) does 2 things:
$ra
. (Happens automatically.)
$s0, ...,
$s7
.
$v0, $v1
).
$s0, ...,
$s7
.
$ra
(jr $ra
).jr
instruction jumps to an address stored in a register.
$v0, $v1
.
# CODE STRUCTURE caller: ... # put arguments in $a0 - $a3 jal leafFunc # after call, do stuff using value(s) in $v0, $v1 ... # return to "super-caller" or op. sys.
leafFunc: # body of subfunction (assume arguments are in $a0 - $a3) # put return value(s) in $v0, $v1 jr $ra