go to previous page   go to home page   go to next page hear noise

Answer:

0000 1111 1010 0101           0FA5 
0011 0110 1000 1111           368F 
-------------------           ----
0011 1111 1010 1111           3FAF

Running the Program

register display in SPIM

Doing the problem by hand yields the result, 0x3faf. Of course, when the program runs the result will be 32 bits long: 0x00003faf. To run the program:

  1. Create a source file.
  2. Start SPIM.
  3. Load the source file.
  4. Set simulator switches (only the following matter at this time):
    • ON — general registers in hexadecimal.
    • ON — bare machine.
    • OFF — allow pseudo instructions.
    • OFF — load trap file.
  5. Push F10 once per instruction.

The picture shows the result of running the program. The result in $10 is what was expected.


QUESTION 7:

Here is the complete line for the first instruction from the source window:

[0x00400000]    0x34080fa5    ori  $8, $0, 4005       ori  $8,$0,0x0FA5

Look at the 32-bit machine instruction at address 0x00400000. Do you see the immediate operand in it?