next up previous
Next: Problem 2: Hands OFF Up: Part 1: MIPS ISA Previous: Part 1: MIPS ISA

Problem 1: Hands-on MIPS Code

Please express the following register expressions as MIPS code fragments, using as few instructions as possible. The registers in each expression below have been loaded with the correct data, and no other integer registers are in use.

  1. R1 $\leftarrow$ 164000

  2. R2 $\leftarrow$ 2(-15 $+$ R3 $-$ R2 $+$ R5)

  3. R3 $\leftarrow$ $R3' + 1$

  4. R4 $\leftarrow$ (R5 $\oplus$ R2)$'$

  5. if (R2$==$ 0) then R4 $\leftarrow$ R4 $-$ 24 $+$ R2
    else R4 $\leftarrow$ 24 $-$ R4 $-$ R2
















MM Hugue 2002-09-22

Web Accessibility