here is the question and the answer to this question is c. can you please explai
ID: 3863837 • Letter: H
Question
here is the question and the answer to this question is c. can you please explain why answer is C.
(4) Which pair of instructions can be filled into the right-side MIPS ASM codes to form the correct translation of the left-side C codes. Assume $to, 1, $t2 correspond to A, b, c, respectively. bne $t0, $0, LabelA switch (A) move $t1, $t2 case 0: b c; break; j Label after break [Missing 1] case 1: b c-1; rea default: b-c+1; [Missing 2] sub $t1, $t2, $t3 i Label after break Label B: add $t1, $t2, $t3 A. addi $t3, $0, 1; LabelA: beq $t0, $t2, LabelB Label after break B. li $t3, 1; Label A: beq $to, $t1, Label after break C. addi $t3, $0, 1; LabeIA: bne St0, $t3, LabelB D. li $t3, 1; LabelA: bne $t0, $t2, Label after breakExplanation / Answer
addi t3 , 0 , 1 will make t3 = 1 +0, Now t3 =1
Label A: bne t0, t3, Label B //Means if A (t0) is not equal to 1 (t3) i.e case 1 (Switch ) then go to default case [Label B]
(Given In the Code ) LABEL B : add t1, t2, t3
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.