Question: 3 Converting C program into MIPS [10pts] Suppose we have three variables a, b, c that are already stored at the register $t0, $t1, $t2.
![3 Converting C program into MIPS [10pts] Suppose we have three](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f300f69fa1c_52666f300f63d221.jpg)
3 Converting C program into MIPS [10pts] Suppose we have three variables a, b, c that are already stored at the register $t0, $t1, \$t2. We also have two arrays U and V, where each element in the array is a 32-bit unsigned integer. Assume the base address of the array U and V are stored in registers $t5 and $t6, respectively. Note: the base address of an array U is the address of its first element U[0]. (1) For this C statement a=b+c+v[3], write MIPS instructions to implement it. Requirement: use three instructions in this required order "addu, 1w, addu" to implement it. Store the result in $ to. Write comment for each instruction of your code. Ignore any overflow. [ 4pts] (2) For this C statement a=b+U[V[3]], write MIPS instructions to implement it. Requirement: use five instructions in this required order " 1w,s11, addu, 1w, addu" to implement it. Store the result in $ t0. Write comment for each instruction of your code. Ignore any overflow. [6 pts]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
