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

Answer:

Sure. You can correct errors with the text editor, save the file to the disk, and then re-load it into SPIM.


Assembling the Program

Spim Options

Loading the source file into SPIM does two things: (1) The file is assembled into machine instructions, and (2) the instructions are loaded into SPIM's memory. The text display shows this.

The text display shows both the source file and the machine instructions it assembled into. The leftmost column are addresses in simulated memory.

The 32-bit machine instructions are in the column just right of the address column.

To the right of the machine instructions are lines of assembly code that formed by translating the machine code back into assembly. This is called disassembly. It is there for debugging purposes. (This is like translating an English sentence to French, then translating the French back into English. The second translation should match the original English.)

Of course, in an actual computer would have only main storage and machine code stored at each address.


QUESTION 8:

Inspect the text display (your own or the above picture).

  1. What machine instruction (bit pattern) did your first instruction (ori $8,$0,0x2) assemble into?
  2. At what address in memory was it loaded?

go to previous page   go to home page   go to next page