The following problem deals with translating from C to MIPS.Assume that the vari
ID: 3608640 • Letter: T
Question
The following problem deals with translating from C to MIPS.Assume that the variables f,g,h,i and j are assigned to registers$s0, $s1, $s2, $s3 and $s4 respectively. Assume that the baseaddress of the arrays A and B are in registers $s6 and$s7,respectively. a. f = g + h + B[4]; b. f = g - A[B[4]]; For the C statements above, what is the corresponding MIPS assemblycode? The following problem deals with translating from C to MIPS.Assume that the variables f,g,h,i and j are assigned to registers$s0, $s1, $s2, $s3 and $s4 respectively. Assume that the baseaddress of the arrays A and B are in registers $s6 and$s7,respectively. a. f = g + h + B[4]; b. f = g - A[B[4]]; a. f = g + h + B[4]; b. f = g - A[B[4]];Explanation / Answer
The variables are f,g,h,i and j are assigned toregisters $s0,$s1,$s2,$s3 and $s4 The base address of the arrays A and B are in rgisters $s6 and$s7 a. f=g + h + B[4] corresponding MIPS assembly code $s0 =$s1+ $s2 + $s7[4] add $s0, $s216($s7) add $s0, $s0,$s1 b. f= g-A[B[4]] corresponding MIPSassembly code $s0 = $s1 - $s6[$s7[4]] mov $t0, 16($s7) mul $t0 , 4 sub$s1, $to($s6) mov $s0, $s1 I hope this will helpu...Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.