Description
In this assignment, you will execute and manipulate a simple program written in MIPS assembly language. The code of this program that recursively calculates the Fibonacci number of a given non-negative integer can be found in the following .asm file: Fib.asm
To execute this file, you need to use QtSpim application. Please read the following tutorial on QtSpim: Tutorial on Using QtSpim.pdf
Tasks
Here are the tasks that you need to do:
- (20 points) Execute the given program, input number 15 through console, and find the program output printed on console. Take a snapshot of the value of all the 32 MIPS registers before and after executing the program. The values are visible on the main window of your QtSpim program.
- (20 points) Manipulate the program assembly code so that it calculates items of the following sequence:
3. (20 points) Execute the program that you wrote in step 2 for input 15. Take a snapshot of the value of all the 32 MIPS registers before and after executing the program.
4. (20 points) Manipulate the program assembly code so that it calculates items of the following sequence:
5. (20 points) Execute the program that you wrote in step 4 for input 10. Take a snapshot of the value of all the 32 MIPS registers before and after executing the program.