Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Does anyone know how to translate this MIPS assembly code to its equivalent C st

ID: 3544508 • Letter: D

Question

Does anyone know how to translate this MIPS assembly code to its equivalent C statements, assuming that the registers #s1, $s2, $t1 and $t2 are integers a, b, i and j, respectively?


                       addi $t1, $0, 0

LOOP:            slti $at, $t1, 15

                       beq $at, $0, EXITLOOP

                       addi $t2, $0, 20

LOOP2:         beq $t2, $0, EXITLOOP2

                       addi $s2, $s2, 5

                       addi $t2, $t2, -1

                              j LOOP2

EXITLOOP2: addi $t1, $t1, 1

                              j LOOP

EXITLOOP:  

Explanation / Answer

i=0;

while(i<15){

j=20;
while(j!=0){
b=b+5;
j=j-1;
}
i=i+1;

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote