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, 23.06.2019 23:00
Computer programming is one type of what career
Answers: 1
question
Computers and Technology, 23.06.2019 23:40
4. what is the reason for including the following code snippet in the header file animal.h? #ifndef animal_h #define animal_h class animal { public: animal(); animal(double new_area_hunt); void birth(); void hunt(double new_area_hunt); void death(); double get_area_hunt() const; private: double area_hunt; }; #endif
Answers: 3
question
Computers and Technology, 24.06.2019 04:30
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe and
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
1. web and mobile applications allow users to be actively engaged in an online activity. a true b false 2. some examples of business applications purposes are to collaborate, share files, meet virtually in real-time, and accept payments. a true b false 3. an education application would most likely do which of the following? a allow users to watch popular movies and tv shows b connect users with social and business contacts c confirm users' travel plans d teach users a new language 4. a uniform resource locator (url) is how the internet knows where to take users when an address is typed into a browser. a true b false 5. deon is required to provide the citation information for his sources. what type of information should he collect from his sources? a author name, title, date of publication, date of access, url b connections to background information c interesting facts and statistics d notes on important information
Answers: 1
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
Questions on the website: 13722363