143k views
1 vote
For the following machine code expressed in hexadecimal, write the corresponding MIPS assembly instruction. Note: in case of branch or jump instructions, you should write the target address in hexadecimal notation in the MIPS assembly instruction. e.g., j 0x00000016.

Machine code:0x08100008
Assembly instruction:??

2 Answers

6 votes

.......................................................................................................................................................................

User Nathanesau
by
3.7k points
6 votes

Answer:

Assembly instruction is j 0x00400020

Step-by-step explanation:

j 0x00400020

EXPLAINATION-

GIVEN Machine Code = 0x 0 8 1 0 0 0 0 8

Step 1:

Now convert 0 8 1 0 0 0 0 8 Each digit to Binary

= 0000 1000 0001 0000 0000 0000 0000 1000

= 000010 00000100000000000000001000

000010 is opcode of j instruction

we are left with

0000 0100000000000000001000

Step 2:

Add two zeroes to right

0000 0100 0000 0000 0000 0010 0000

Step 3:

Remove 4 highest bit

0100 0000 0000 0000 0010 0000

Decimal of it is 4194336

Step 4:

Now convert it into Hexadecimal

we get 400020

So Assembly instruction is j 0x00400020

j 0x00400020

User Hosang Jeon
by
3.9k points