Presentation is loading. Please wait.

Presentation is loading. Please wait.

Reverse Assembly Typical problem:

Similar presentations


Presentation on theme: "Reverse Assembly Typical problem:"— Presentation transcript:

1 Reverse Assembly Typical problem:
Given a machine language instruction for the SRC, it may be required to find the equivalent SRC assembly language instruction

2 Example: Reverse assemble the following SRC machine language instructions:
68C2003A h E1C60004 h h 724E8000 h 1A4000D4 h 084000D0 h Solution: 1. Write the given hexadecimal instruction in binary form 68C2003A h  b 2. Examine the first five bits of the instruction, and pick the corresponding mnemonic from the SRC instruction set listing arranged according to ascending order of op-codes 01101 b  13 d  addi  add immediate

3 4. Therefore, the assembly language instruction is addi R3, R1, 58
3. Now we know that this instruction uses the type C format, the two 5-bit fields after the op-code field represent the destination and the source registers respectively, and that the remaining 17-bits in the instruction represent a constant b 4. Therefore, the assembly language instruction is addi R3, R1, 58 op-code ra field rb field 17-bit c1 field addi R3 R1 3A h = 58 d

4 Summary 68C2003A h addi R3, R1, 58 E1C60004 h 61885000 h 724E8000 h
Given machine language instruction Equivalent assembly language instruction 68C2003A h addi R3, R1, 58 E1C60004 h h 724E8000 h 1A4000D4 h 084000D0 h

5 We can do it a bit faster now ! Here is step 1 for all instructions
Given instruction in hexadeximal Equivalent instruction in binary E1C60004 h b h b 724E8000 h b 1A4000D4 h b 084000D0 h b

6 Step 2: Pick up the op code for each instruction
Given instruction in hexadeximal Op-code field mnemonic E1C60004 h b shl h b add 724E8000 h b sub 1A4000D4 h b st 084000D0 h b ld

7 Step 3: Determine the instruction type for each instruction
Given instruction in hexadeximal mnemonic Instruction type E1C60004 h shl h add 724E8000 h sub 1A4000D4 h st 084000D0 h ld

8 Step 3: Determine the instruction type for each instruction
The meaning of the remaining fields will depend on the instruction type (i.e., the instruction format) Given instruction in hexadeximal mnemonic Instruction type E1C60004 h shl h add 724E8000 h sub 1A4000D4 h st 084000D0 h ld

9 Step 3: Determine the instruction type for each instruction
Given instruction in hexadeximal mnemonic Instruction type E1C60004 h shl h add 724E8000 h sub 1A4000D4 h st 084000D0 h ld

10 Summary 68C2003A h addi R3, R1, 58 E1C60004 h 61885000 h 724E8000 h
Given machine language instruction Equivalent assembly language instruction 68C2003A h addi R3, R1, 58 E1C60004 h h 724E8000 h 1A4000D4 h 084000D0 h

11 Note for graphics designer
Please insert the attached images one per slide according to the numbering


Download ppt "Reverse Assembly Typical problem:"

Similar presentations


Ads by Google