8.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: 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 Sto and the address of the first element of the array in the memory in St1. For example, St0 and St1 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 Sto and St1 to zero.
ACTIVITY 8.6.1: Array of Fibonacci sequence-loop
Loop counter implementation
Assembly
Type your code here:
Line 2: Do not initialize St0 and St1 here.
Line 3: Use the "+" button under the Registers display to initialize Sto and St1 to zero.
Line 4:
Registers
Each has value 0
Each has value 0
Memory
ENTER-SIMULATION
STEP
RUN