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, 22.06.2019 10:30
Aconstruction company is creating a powerpoint presentation describing how they calculate costs during each construction step. they plan to email this presentation to clients. the individual clients will be watching the presentation slide show on their own personal computers. what is the most important formatting step the company should take to make the text readable and pleasing to the eye?
Answers: 2
question
Computers and Technology, 22.06.2019 19:20
How might the success of your campaign be affected if you haven’t carefully completed all field data or if you accidentally insert the wrong merge field in the document?
Answers: 2
question
Computers and Technology, 22.06.2019 20:00
What side length would you specify if you were required to create a regular hexagonal plate that was composed of 33 cm(squared) of sheet metal? dimension the side length to 0.1 cm
Answers: 2
question
Computers and Technology, 23.06.2019 00:00
What season was better from fortnite?
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
Biology, 17.04.2021 14:00
question
Physics, 17.04.2021 14:00
question
Advanced Placement (AP), 17.04.2021 14:00
question
Mathematics, 17.04.2021 14:00
Questions on the website: 13722367