For the MIPS assembly instructions in Exercise 2.4, rewrite the assembly code to minimize the number if

Question:

For the MIPS assembly instructions in Exercise 2.4, rewrite the assembly code to minimize the number if MIPS instructions (if possible) needed to carry out the same function.


Exercise 2.4

For the MIPS assembly instructions below, what is the corresponding C statement? 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.

$t0, $s0, 2 $t0, $s6, $t0 $t1, $s1, 2 $t1, $s7, $t1 $$0, 0($t0) addi $t2, $t0, 4 $t0, 0($t2) $t0, $t0, $s0 $t0, 0($t1) f

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: