The caller must restore any T
registers it saved.
main()
In
this example, main()
did not save any T
registers.
It does not need to restore them.
The value the subroutine returned is in
$v0
.
This value is assigned to variable a
.
Look down to the section where main
regains control.
Fill in the blanks that follow so that the
value returned by the subroutine
(contained in $v0
) is copied
to the variable a
on the stack.
The next few statements
load $a0
with the value
of a
from the stack,
and then print that value by using
a SPIM service.
This could have been done
without the stack.
The return value could have been copied directly into $a0
.
But this example shows the type of
code that a non-optimizing compiler
might produce.
Fill in the blanks.