196k views
1 vote
int iterFib(int n) {int a = 0, b = 1, c, i;for(i=2; i<=n; i++) {c = a + b;a = b;b = c;}return b;}What are the missing MIPS instructions? Please record only the letter in lower case.iterFib: addi $sp, $sp, -12

User EFeit
by
5.0k points

1 Answer

2 votes

Answer:

Instruction 1 , It should store the content of s2 intot the stack.

Hence instruction will be sw $s2,0($sp)

Instruction 2 , It will check if the value of t2 is one or not. If it is zero it should exit.

Hence instruction will be beq $t2,$zero,exitFib

Step-by-step explanation:

User Spawnia
by
5.4k points