MIPS instruction and machine code

Actually you have only found the instruction, so it’s not ending there from your spec.

Write out the machine code for the MIPS instruction.

lw $s1, 8($t0)

In order to write the machine code for this instruction you need to look at MIPS reference sheet MIPS Reference sheet

If you look at the sheet the lw has opcode 35 and for $1 is 17 , for $t0 is 8 and offset is 8. Arrange it as following

op  rs rt  immidiate
35  8  17  8

To binary

100011  01000  10001  0000000000001000

Group as 4 bits

1000 1101  0001 0001 0000 0000 0000 1000

To hexadecimal

0x8D110008

Answer as a hexadecimal value for the machine code.

0x8D110008

Leave a Comment