Question: 4. Translate the following C code to MIPS. Assume that the variables f, g, h, i, and j are assigned to registers Ss0, Ssl, Ss2,

4. Translate the following C code to MIPS. Assume that the variables f, g, h, i, and j are assigned to registers Ss0, Ssl, Ss2, Ss3, and Ss4, respectively. Assume that the base address of the arrays A and B are in registers Ss6 and Ss7, respectively. Assume that the elements of the arrays A and B are 4-byte words: B[8] = A[i] + A[j]; 5. Assume that registers Ss0 and Ss1 hold the values 0x80000000 and 0xD0000000, respectively. a) For the contents of registers Ss0 and Ss1 as specified above, what is the value of StO for the following assembly code? add St0, Ss0, Ss1 add St0, St0, $s0 b) Is the result in St0 the desired result, or has there been overflow? 6. For the following C statement, write a minimal sequence of MIPS assembly instructions that does the identical operation. Assume $t1 = A, $t2 = B, and $s1 is base address of C A = C[0]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
