7.6 LAB: Array of Fibonacci sequence - loop
Write a program to populate an array with Fibonacci numbers. The Fibonacci sequence begins with 0 and then 1, each following number is the sum of the previous two numbers. Ex: 0, 1, 1, 2, 3, 5, 8, 13. Assume the size of the array is always at least 1. Use the '+' button under the Registers display to store the size of an integer array in $t0 and the address of the first element of the array in the memory in $t1.
Ex: If $t0 and $t1 are initialized in the simulator as 5 and 5000, the data memory starting at address 5000 will contain:
Addresses Data
5000 0
5004 1
5008 1
5012 2
5016 3
Note: Use the '+' button under the Registers display to initialize $t0 and $t1.
7.6.1: LAB: Array of Fibonacci sequence - loop
Assembly
Line 1: Type your code here.
Line 2: # Do not initialize $t0 and $t1 here.
Line 3: # Use the + button under the Register display.
Line 4:
Registers: Each has value 0
Memory: Each has value 0