PCSpim Text Window - What Does the Output Mean?

130 Views Asked by At

In PCSpim, when a program is executed, it displays in the Text Window a line for each instruction.

e.g. [0x00400028] 0x34020004 ori $2, $0, 4 ;13: li $v0, 4

That example loads 4 into the register $v0.

What does the ori $2, $0, 4 mean?

And is 0x34020004 just the same command, but in hexidecimal?

Thanks.

1

There are 1 best solutions below

1
On
[0x00400028] 0x34020004 ori $2, $0, 4 ;13: li $v0, 4
  • 0x00400028 is the address where the instruction is located.
  • 0x34020004 is the instruction word, i.e. the four bytes encoding the instruction.
  • ori $2, $0, 4 is the human-readable form of the instruction, which in this case sets $2 (aka $v0) to 4.
  • li $v0, 4 is the instruction you typed in. Since li is a pseudo-instruction, it is translated by the assembler into one or more actual MIPS instructions (in this case ori $2, $0, 4).