Question: 1. (15 pts) For the following C statement, what is the corresponding MIPS assembly code? Assume f, g, h correspond to $so, $sl, and $s2,

1. (15 pts) For the following C statement, what is the corresponding MIPS assembly code? Assume f, g, h correspond to $so, $sl, and $s2, respectively. f=g+(h-5) 2. (15 pts) For the following pseudo-MIPS assembly instructions, what is the corresponding C code? add f, g, h I add f,i, f 3. (15 pts) For the following C statement, what is the corresponding MIPS code? Assume i andj correspond to $so, and $sl, and the base address of A and B corresponds to $s2 and $s3, respectively. B[8] = A[i-j] 4. (15 pts) Provide the instruction type, assembly language instruction, and binary representation of the instruction described by the following MIPS fields: op = 0, rs = 3, rt=2, rd = 3, shamt = 0, funct = 34 5. (15 pts) What is the decimal value of the following signed 16-bit number: 1. 8000 (hex) 2. 8020 (hex) 6. (25 pts each) Consider the following MUPS loop: LOOP: slt $t2, Szero, $ti beg $t2, $zero, DONE addi $t1,$t1, -1 addi $81, $si, 2 j LOOP DONE: 1. Write comments for each line, at the right side of above table. 2. Assume that the register $t1 is initialized to the value 2. What is the value in register $sl assuming $sl is initially zero? 3. Write the equivalent C code routine (there is no difference from Java). Assume that the registers $sland St1 are integers A and i, respectively
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
