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,2b) 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...
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.