Write the following C-language recursive implementation of Fibonacci in MIPS assembly. Your solution should use the stack,
Fantastic news! We've Found the answer you've been seeking!
Question:
Write the following C-language recursive implementation of Fibonacci in MIPS assembly. Your solution should use the stack, and should be recursive, not iterative. Include code that calls your function with the value 5.
int fib(int n) {
if (n == 0) {
return 0;
}
else if (n == 1) {
return 1;
}
else {
return fib(n-1) + fib(n-2);
}
}
Related Book For
Discovering Advanced Algebra An Investigative Approach
ISBN: 978-1559539845
1st edition
Authors: Jerald Murdock, Ellen Kamischke, Eric Kamischke
Posted Date: