Inactive Tutor answered 08/14/26
2. j jtarget
j is a J-type instruction:
opcode | target
The opcode for j is 000010 (decimal 2).
The target address is:
0x045678F0
For a MIPS jump, the 26-bit target field is obtained from:
address >> 2
So:
0x045678F0 >> 2 = 0x01159E3C
Then combine with the opcode:
0x08159E3C
So:
j jtarget = 0x08159E3C
3. sw $t3, 0x24($s2)
sw is an I-type instruction:
opcode | rs | rt | immediate
-
swopcode =101011=0x2B -
$s2= register 18 →10010 -
$t3= register 11 →01011 -
0x24= 36 →0x0024
Therefore:
0xAE4B0024
4. addi $t4, $0, -10
addi is also I-type:
opcode | rs | rt | immediate
-
addiopcode =001000=0x08 -
$0= register 0 -
$t4= register 12 -
-10represented as a 16-bit two's-complement value =0xFFF6
Therefore:
0x200CFFF6
Final answers
| MIPS instructionMachine code (hex) | |
sll $t0, $s1, 10 |
0x00284140 |
j jtarget |
0x08159E3C |
sw $t3, 0x24($s2) |
0xAE4B0024 |
addi $t4, $0, -10 |
0x200CFFF6 |