[SOLVED] MIPS Assignment
Im working on a Computer Science question and need guidance to help me study.
Using the MIPS Simulator
Your program will take arguments m and n from memory locations 4000 and 4004, like so…
… and when finished running, will store back into memory at location 4008:
Your program returns correct answers for all summation test cases (we will always use
m < n, and m will be taken from memory location 4000; n from memory location 4004)
Fibonacci number
Write a program in assembly code to generate the nth number of the Fibonacci sequence and store the result to memory.
Fibonacci Sequence (add the previous two numbers to get current):
F: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144 ... n: 0 1 2 3 4 5 6 7 8 9 10 11 12
5 Points: Your program should load the initial arguments from memory into the registers
1. Nth number of sequence (ie: 10) — memory location 4000
2. 0th number in sequence (ie: 0) — memory location 4004
3. 1st number in sequence (ie: 1) ) — memory location 4008
… and proceed to generate the sequence. It should store the final result (ie: 55) back to memory location 4012 and halt.
You will receive all 5 points only if the program performs correctly on all test cases. Below is an example of a correct memory stack: