Professional Documents
Culture Documents
Machine Language
It is the native binary code that the microprocessor understand.
Assembler
It is use to translate assembly instruction to a machine code.
Encoding
It is a processes representing entire assembly instruction as a binary value or
hexadecimal format (human perspective)
Decoding
It is the process of converting hexadecimal format to assembly language
(machine perspective)
8086 – 80486 Instruction Format
Intel µP Instruction Encoding and Decoding
Override Prefixes
It is the first 2 bytes of a 32-bit instruction
format
These bytes are not always used
Divided in Two Parts:
○ Address Size – modifies the size of the address
used the instruction and this byte is equal to 67h if
in used.
If the 80386/80486 is operating as 16-bit instruction
mode machine (real or protected mode) and 32-bit
instruction, byte is equal to 67h
If the 80386/80486 is operating as 32-bit instruction
mode machine (real or protected mode) and 32-bit
instruction, byte is removed.
Instruction Encoding
Intel µP Instruction Encoding and Decoding
Mode field
○ This field specifies the addressing modes for selected
instruction.
○ This selects the type of addressing and whether a
displacement is present or with the selected
instruction.
MOD = 11, selects data addressing modes
MOD = 00, 01, or 10, selects memory addressing modes
REG field
○ Field for register assignment
Register Addressing
It uses the R/M field to specify a register instead of memory location
1. MOV DX, AX
2. MOV DX, [BX + DI + 1234h]
3. ADD AX, 1023
4. SUB DX, 1234h
5. AND [BX + 12h], AX
6. MOV EAX, [EBX + 4*ECX]
7. MOV [5267h], DH
8. MOV CS, AX
9. MOV DS, AX
10. MOV AX, [BX]
Examples (Decoding)
Intel µP Instruction Encoding and Decoding
1. 8B923412h
2. 81C17856h
3. 2C26h
4. 8B163412h
5. 20D8h