x86 Instruction Encoding
x86 Instruction Encoding
Encoding (12.3)
XCHG BX, DX
•Encode :
1. MOV AX, [SI] ;
2. MOV [SI], AL
Single-Byte Instructions
•The simplest type of instruction is one with either no operand or an
implied operand. Such instructions require only the opcode field, the
value of which is predetermined by the processor’s instruction set.
• register increments are optimized for code size and execution speed
Single Immediate Data
•When the only operand of an instruction is an immediate data the
machine language code is the opcode followed by that immediate data.
B8 + 03 <- 01 00
=66 BB 0100
ADD reg16, imm16 81
2.
3.
4.
1.
2.
3.
4.
Summary (Formats)
✓CBW
✓RET 8 ✓POP mem16
✓PUSH BX ✓INC mem8
✓SUB CX, 15 ✓DEC WORD PTR [100Fh]
✓ADD CL, CH ✓DEC WORD PTR [BX+02h]
✓SUB VAR, BX ✓DEC WORD PTR [DI+767Fh]
✓SUB BX, [101Fh] ✓SUB VAR, 15
✓XOR [DI+07h], DX ✓SUB [SI+1fh], 15
✓OR [SI+347Ch], Bh ✓SUB [SI+1f1fh],15