Question: 1. For the following C statement, what is the corresponding MIPS assembly code? Assume that the variables f, g, h, i, and j are assigned
1. For the following C statement, what is the corresponding MIPS assembly code? Assume that the variables f, g, h, i, and j are assigned to registers $s0, $s1, $s2, $s3, and $s4, respectively. Assume that the base address of the arrays A and B are in registers $s6 and $s7, respectively.
B[8] = A[ij];
2. The following instruction is not included in the MIPS instruction set: rpt $t2, loop # if(R[rs]>0) R[rs]=R[rs]1, PC=PC+4+BranchAddr (note, BranchAddr is the encoded value that is used to calculate target loop address)
a.) [10 points] If this instruction were to be implemented in the MIPS instruction set, what is the most appropriate instruction format?
b.) [10 points] What is the shortest sequence of MIPS instructions in ISA that performs the same operation?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
