Please help with these questions: The following problem deal with translating fr
ID: 3542635 • Letter: P
Question
Please help with these questions:
The following problem deal with translating from C statement to MIPS: B[8]= A[i-j], Assume that the base address of the array B is in register $s7,and variables i, and j are stored in registers $s3 and $s4 respectively.. Write the following sequence of code into MIPS assembler. The following problem deal with translating from MIPS to C. add t0, s6, s0 add tl, s7, sl lw s0,0( t0) addi t2, t0,4 lw t0,0( t2) add t0, t0, SsO sw $t0,0($tl) Assume that the base address of the array A and B are in register, s6 and s7 respectively, and variables f, g, h, i, and j are stored in registers SsO and $s4 respectively. Write the above sequence of MIPS code into C. Suppose we have For the pattern above, what base 10 numbers does the binary number represent, assuming that it is a two's complement integer? For the pattern above, what base 10 numbers does the binary number represent, assuming that it is an unsigned integer? for the patterns above, what hexadecimal number does it represent? what type instruction do the binary entries above represent? If the binary entries above were data bits, what number would they represent in hexadecimal?Explanation / Answer
Store word sw $t,C($s) Memory[$s + C] = $t
Load word lw $t,C($s) $t = Memory[$s + C]
the answer of first part is
sub $s3,$s3,$s4 #(==i-j)
lw $t,A($s3) #(==$t = Memory[$s3 + A]
sw $t,7($s7) #(==Memory[$s7 + 7] = $t