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.
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. Sinceli
is a pseudo-instruction, it is translated by the assembler into one or more actual MIPS instructions (in this caseori $2, $0, 4
).