Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2. (30pts) Translation between C statement and MIPS assembly instructions a. [5pts) Assuming variables f, g, h, and i are given as 32-bit integers, what
2. (30pts) Translation between C statement and MIPS assembly instructions a. [5pts) Assuming variables f, g, h, and i are given as 32-bit integers, what are corresponding MIPS assembly instruction for the following program? Use a minimal number of instructions. f = a + (h - 2); b. [Spts] What is a corresponding C statement for the following MIPS assembly instructions? add f, g, h add f1, f c. [10pts) What is the corresponding MIPS assembly code for the C statement below? Assume that the variables f, g, h, i, and j are assigned to registers $50, $81, ...) $34, respectively. Assume also that the base address of the array A and B are stored in registers $6 and $87, respectively. B[6) - Ai-ili d. (10pts) What is the corresponding C statement for the following MIPS assembly instructions? Assume that the variables and base address of the arrays are the same as 2.c 31l $t0, S80, 2 add $t0,$56, $t0 311 $t1, Ssl. 2 add $t1,$57, Sti lw $50, 0 (Sto) addi $t2, Sto, 4 lw $t0, 0($t2) add $t0,$t0,$80 sw $t0, 0($t1) # St0 = f*4 # St0 - GA[E] # Stl = 4 # Stl = GB[g] # ATE)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started