Question: Assume that the registers hold the value same as their location in the MIPS register file, compute the output values for each of the following

Assume that the registers hold the value same as their location in the MIPS register file, compute the output values for each of the following instruction in decimal system given that they are executed sequentially from a-e?

  1. add $t4, $t2, St3
  2. sub $t2, $4, $3
  3. addi $s2, St1, -1
  4. mult $t1, St2
  5. mflo Sto

Question#2

Write the most efficient (minimum possible instruction execution) MIPS assembly code for the following procedure calls.

a) C code for leaf procedure call:

int leaf_example (int g, h, i, j) {int f; f= (g + h) - (i + j); return f; } Arguments g, .., j in $a0, .., $a3 fin $sO (hence, need to save $sO on stack) Result in Sv0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!