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

The following problem deals with translating from C to MIPS. Assumethat the vari

ID: 3608639 • Letter: T

Question

The following problem deals with translating from C to MIPS. Assumethat the variables g,h,i and j are given and could be considered32-bit integers as declared in a C-program. a. f = f+g+h+i+j+2 b. f = g - (f + 5) 1) For the C statements above, what is the corresponding MIPSassembly code? Use a mimimal number of MIPS assemblyinstructions. 2) If the variables f,g,h,i and j have the values 1,2,3,4 and5, respectively, what is the end value of f? 1) For the C statements above, what is the corresponding MIPSassembly code? Use a mimimal number of MIPS assemblyinstructions. 2) If the variables f,g,h,i and j have the values 1,2,3,4 and5, respectively, what is the end value of f? a. f = f+g+h+i+j+2 b. f = g - (f + 5)

Explanation / Answer

Dear.... 1) a)If the data values of f,g,h,i,j are stored in registers$s0,$s1,$s2,$s3,$s4 then the Mips statements for thestatement       f = f+g+h+i+j+2 is        add $s0,$s1,$s2;        add$s0,$s3,$s4        add$s0,2
b)     add $s0,5        sub $s0,$s1,$s0 2)     finally the value of f is -20 Hope this will help you... Hope this will help you...