6. Which of the following can be used to place 0 in $8? a. add $8, $0, $0 b. add
ID: 3897546 • Letter: 6
Question
6. Which of the following can be used to place 0 in $8?
a. add $8, $0, $0
b. addi $8, $0, 0
c. ori $8, $0, 0
d. all of the above
7. Which of the following can be used to place -5 in $8?
a. add $8, $0, -$5
b. addi $8, $0, -5
c. ori $8, $0, -5
d. sw $8, -5($0)
8. MIPS assembly include instructions addi and subi. But, there is no native MIPS machine code for subi. Which of the following MIPS ISA code is equivalent to the pseudo code subi $8, $8, 5?
a. sub $8, $8, $5
b. addi $8, $8, -5
c. add $8, $8, -5
d. ori $8, $8, -5
9. MIPS assembly include a pseudo code to copy the contents of a register to another register; for example, move rd, rs will copy the contents of rs to rd ( i.e. R[rd] ß R[rs] ). Which of the following MIPS ISA code can be used in place of the pseudo code move $8, $9 ?
a. addu $8, $0, $9
b. add $8, $0, $9
c. addi $8, $9, 0
d. all of the above
int x= 5, y =2 * x;
10. Consider the following JAVA code.
Which of the following MIPS ISA code sequence will be equivalent to the above JAVA code?
a. ori $t0, $0, 5 add $t1, $t0, $t0
b. add $t0, $5, 0 addi $t0, $t1, $t1
c. int x, 5, 0 mul y, 2 , x
d. add $t0, $t0, 5 add $t1, $t1, 0
int x= 5, y =2 * x;
Explanation / Answer
Q6) Which of the following can be used to place 0 in $8?
b) addi $8, $0, 0
Q7) Which of the following can be used to place -5 in $8?
d) sw $8, -5($0)
Q8) MIPS assembly include instructions addi and subi. But, there is no native MIPS machine code for subi. Which of the following MIPS ISA code is equivalent to the pseudo code subi $8, $8, 5?
b) addi $8, $8, -5
Q9) MIPS assembly include a pseudo code to copy the contents of a register to another register; for example, move rd, rs will copy the contents of rs to rd ( i.e. R[rd] ß R[rs] ). Which of the following MIPS ISA code can be used in place of the pseudo code move $8, $9 ?
c. addi $8, $9, 0
Q10) c. int x, 5, 0 mul y, 2 , x
PLease let me know in case of any clarifications required. Thanks!
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.