subject

For the following C code, variables a, b, c, and n correspond to the registers $s0, $s1, $s2 and $a0 respectively and i corresponds to $t0. The callee doesn’t have to preserve registers $t1-$t9, if used. 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 sw $s0, 8($sp) sw $s1, 4($sp) ---Instruction 1--- add $s0, $zero, $zero addi $s1, $zero, 1 add $t0, $zero, $zero addi $t1, $a0, 1 forFib: slt $t2, $t0, $t1 ---Instruction 2--- add $s2, $s1, $s2 add $s0, $zero, $s1 add $s1, $zero, $s2 addi $t0, $t0, 1 j forFib exitFib: add $v0, $zero, $s1 jr $ra Instruction 1 is a. No instruction b. addi $sp, $sp, 4 c. add $sp, $sp, -4 d. lw $s2, 0($sp) e. sw $s2, 0($sp) f. bne $t2, $zero, exitFib g. beq $t2, $zero, exitFib h. None of the above Instruction 2 is a. j iterFib b. addi $sp, $sp, 4 c. add $sp, $sp, -4 d. lw $s0, 0($sp) e. addi $sp, $sp, -4 f. bne $t2, $zero, exitFib g. beq $t2, $zero, exitFib h. None of the above

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:20
Write a javascript program that reads three integers named start, end, and divisor from three text fields. your program must output to a div all the integers between start and end, inclusive, that are evenly divisible by divisor. the output integers must be separated by spaces. for example, if a user entered 17, 30, and 5, your program would output "20 25 30" (without the quotes) because those are the only integers between 17 and 30 (including 17 and 30) that are evenly divisible by 5.
Answers: 2
question
Computers and Technology, 22.06.2019 23:30
The next button in the review section shows the next available comment. next slide with no comment. previous comment. edited comment.
Answers: 1
question
Computers and Technology, 23.06.2019 15:30
The song about casey jones a railroad engineer who gives his life on the job would most likely gall under the folk song category of? a-work song b-nonsense song c-religious song d-ballad
Answers: 1
question
Computers and Technology, 24.06.2019 05:30
If you combine two cells into one, what action are you performing? a.  adding a new row or column      b.  splitting the cells      c.  removing a new row or column      d.  merging the cells
Answers: 2
You know the right answer?
For the following C code, variables a, b, c, and n correspond to the registers $s0, $s1, $s2 and $a0...
Questions
question
Mathematics, 23.02.2021 20:50
question
English, 23.02.2021 20:50
question
Mathematics, 23.02.2021 20:50
question
Mathematics, 23.02.2021 20:50