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

hey guys the question is above and the solution to the question is below. can yo

ID: 3862335 • Letter: H

Question

hey guys the question is above and the solution to the question is below. can you please explain step by step how they got the solution. please.

2. The left-side C codes can be translated to the right-side MIPS ASM codes with some missing instructions. data A: .word 3,-2, 1 int proc 1; .text int A[3] {1, 2,3 main: li $s1, 1 For i 2 i i [Missing 1] proc proc Ali] li $s3, 3 loop: proc proc 2 [Missing 2] lw $s4, 0($s2) mul $s1, $s1, $s4 [Missing addi $s3, $s3, -1 j loop After For: sll $s1, $s1, 2 jr Sra

Explanation / Answer

The C code for the following code:

#include <stdio.h>

int main() {
int proc=1;
int i;
int A[3]={1,-2,3};
for(i=2;i>=0;i--)
{
proc=proc*A[i];
}
proc=proc<<2;
printf("%d",proc);
   //code
   return 0;
}

The MIPS assembly code for the following C code with all the missing codes in the above provided MIPS assembly code: