Download the file fibonacci.s and open it up in SPIM. Use SPIM to analyze the program and answer the following questions.
move
and li
when
the code is stored in memory? What happens to the load address instruction la
$a0,newline
, and why?
main
, it executes several instructions
that initialize the stack pointers and argument pointers. These are inserted
automatically by SPIM. The program then jumps to the beginning of main
with
the jal
instruction at location 0x00400014
. What
happens to R31
(ra
) after this instruction is executed? What is the significance
of this value?loop
?R8
(t0
)R19
(s3
)R16
(s0
)R17
(s1
)#CHANGED
to the right of each line of code that you change to do this.
Run your new code in SPIM to ensure that it produces the same results
as the original version.Turn in a printed copy of your modified program from question 5 along with written answers to the above questions at the beginning of class on the due date.