Here’s a comprehensive list of 8086 instructions categorized by type:
1. Data Transfer Instructions
Instruction | Explanation | Example |
---|
MOV | Copy data from source to destination | MOV AX, BX — Copies contents of BX into AX |
PUSH | Push register/memory onto stack | PUSH AX — Pushes AX onto the stack |
PUSHA | Push all general-purpose registers | PUSHA — Pushes AX, CX, DX, BX, SP, BP, SI, DI |
PUSHF | Push flags register onto stack | PUSHF — Pushes flags onto the stack |
POP | Pop from stack into register/memory | POP BX — Pops top of stack into BX |
POPA | Pop all general-purpose registers | POPA — Pops registers in reverse order |
POPF | Pop flags register from stack | POPF — Pops flags from stack |
XCHG | Exchange data between two operands | XCHG AX, BX — Swaps AX and BX |
IN | Input from port to accumulator | IN AL, 60H — Reads byte from port 60H into AL |
OUT | Output from accumulator to port | OUT 60H, AL — Sends AL content to port 60H |
LEA | Load effective address | LEA BX, [SI+10] — Loads effective address into BX |
LDS | Load pointer using segment and offset | LDS SI, [2000H] — Loads DS:SI from memory |
LES | Load ES:register from memory | LES DI, [2000H] — Loads ES:DI from memory |
XLATB | Translate byte using lookup table | XLATB — Replaces AL with DS:[BX + AL] |
2. Arithmetic Instructions
Instruction | Explanation | Example |
ADD | Add source to destination | ADD AX, BX — Adds BX to AX |
ADC | Add with carry | ADC AX, BX — Adds BX + Carry to AX |
SUB | Subtract source from destination | SUB AX, BX — Subtracts BX from AX |
SBB | Subtract with borrow | SBB AX, BX — Subtracts BX + Carry from AX |
INC | Increment operand | INC AX — Increments AX by 1 |
DEC | Decrement operand | DEC BX — Decrements BX by 1 |
NEG | Two’s complement (negation) | NEG AX — Converts AX to -AX |
CMP | Compare operands | CMP AX, BX — Compares AX with BX |
MUL | Unsigned multiply | MUL BL — Multiplies AL * BL , result in AX |
IMUL | Signed multiply | IMUL BL — Signed multiply AL * BL |
DIV | Unsigned divide | DIV BL — Divides AX by BL , result in AL , remainder in AH |
IDIV | Signed divide | IDIV BL — Signed divide AX by BL |
DAA | Decimal adjust after addition | DAA — Adjusts AL for BCD after addition |
DAS | Decimal adjust after subtraction | DAS — Adjusts AL for BCD after subtraction |
AAA | ASCII adjust after addition | AAA — Adjusts AL after adding ASCII digits |
AAS | ASCII adjust after subtraction | AAS — Adjusts AL after subtracting ASCII digits |
AAD | ASCII adjust for division | AAD — Converts two ASCII digits to binary |
AAM | ASCII adjust after multiplication | AAM — Adjusts result of multiplying ASCII digits |
3. Logical Instructions
Instruction | Explanation | Example |
AND | Bitwise AND | AND AX, BX — AX = AX & BX |
OR | Bitwise OR | OR AX, BX — AX = AX | BX |
XOR | Bitwise XOR | XOR AX, BX — AX = AX ^ BX |
NOT | Bitwise NOT | NOT AX — AX = ~AX |
TEST | Bitwise AND (no result change) | TEST AX, 0001H — Checks if LSB is set |
4. Shift and Rotate Instructions
Instruction | Explanation | Example |
SHL /SAL | Shift Left (Arithmetic/Logical) | SHL AX, 1 — AX = AX << 1 |
SHR | Shift Right (Logical) | SHR AX, 1 — AX = AX >> 1 |
SAR | Shift Right Arithmetic | SAR AX, 1 — Shifts right keeping sign |
ROL | Rotate Left | ROL AL, 1 — Rotates AL bits to the left |
ROR | Rotate Right | ROR AL, 1 — Rotates AL bits to the right |
RCL | Rotate through Carry Left | RCL AL, 1 — Rotates with carry flag left |
RCR | Rotate through Carry Right | RCR AL, 1 — Rotates with carry flag right |
5. Branch/Jump Instructions
Instruction | Explanation | Example |
JMP | Unconditional jump | JMP 2000H — Jump to address 2000H |
JE/JZ | Jump if equal/zero | JE LABEL — Jump if zero flag is set |
JNE/JNZ | Jump if not equal/not zero | JNE LABEL — Jump if zero flag is not set |
JC | Jump if carry | JC LABEL — Jump if carry flag is set |
JNC | Jump if no carry | JNC LABEL — Jump if carry flag is clear |
JA | Jump if above | JA LABEL — Jump if CF=0 and ZF=0 |
JAE/JNB | Jump if above or equal | JAE LABEL — Jump if CF=0 |
JB | Jump if below | JB LABEL — Jump if CF=1 |
JBE | Jump if below or equal | JBE LABEL — Jump if CF=1 or ZF=1 |
JGE | Jump if greater or equal | JGE LABEL — Jump if SF=OF |
JL | Jump if less | JL LABEL — Jump if SF≠OF |
JG | Jump if greater | JG LABEL — Jump if ZF=0 and SF=OF |
JLE | Jump if less or equal | JLE LABEL — Jump if ZF=1 or SF≠OF |
JNA | Jump if not above | JNA LABEL — Jump if CF=1 or ZF=1 |
JNAE | Jump if not above or equal | JNAE LABEL — Same as JB |
JNBE | Jump if not below or equal | JNBE LABEL — Same as JA |
JNG | Jump if not greater | JNG LABEL — Jump if ZF=1 or SF≠OF |
JNGE | Jump if not greater or equal | JNGE LABEL — Jump if SF≠OF |
JNL | Jump if not less | JNL LABEL — Jump if SF=OF |
JNLE | Jump if not less or equal | JNLE LABEL — Jump if ZF=0 and SF=OF |
JNO | Jump if no overflow | JNO LABEL — Jump if OF=0 |
JNP/JPO | Jump if not parity/parity odd | JNP LABEL — Jump if PF=0 |
JNS | Jump if not sign | JNS LABEL — Jump if SF=0 |
JO | Jump if overflow | JO LABEL — Jump if OF=1 |
JP/JPE | Jump if parity/parity even | JP LABEL — Jump if PF=1 |
JS | Jump if sign | JS LABEL — Jump if SF=1 |
JCXZ | Jump if CX is zero | JCXZ LABEL — Jump if CX=0 |
LOOP | Loop with CX | LOOP START — Decrements CX , jumps if CX ≠ 0 |
LOOPE/LOOPZ | Loop while equal/zero | LOOPE LABEL — Loop if CX≠0 and ZF=1 |
LOOPNE/LOOPNZ | Loop while not equal/not zero | LOOPNE LABEL — Loop if CX≠0 and ZF=0 |
6. String Instructions
Instruction | Explanation | Example |
MOVSB | Move byte from string | MOVSB — Moves byte from DS:SI to ES:DI |
MOVSW | Move word from string | MOVSW — Moves word from DS:SI to ES:DI |
CMPSB | Compare byte strings | CMPSB — Compares byte at DS:SI with ES:DI |
CMPSW | Compare word strings | CMPSW — Compares word at DS:SI with ES:DI |
SCASB | Scan byte string | SCASB — Scans for byte in AL in string at ES:DI |
SCASW | Scan word string | SCASW — Same for words |
LODSB | Load byte from string to AL | LODSB — Loads from DS:SI to AL |
LODSW | Load word to AX | LODSW — Loads from DS:SI to AX |
STOSB | Store byte from AL | STOSB — Stores AL into ES:DI |
STOSW | Store word from AX | STOSW — Stores AX into ES:DI |
REP | Repeat prefix | REP MOVSB — Repeat MOVSB while CX ≠ 0 |
REPE/REPZ | Repeat while equal/zero | REPE CMPSB — Repeat if ZF=1 and CX≠0 |
REPNE/REPNZ | Repeat while not equal | REPNE SCASB — Repeat if ZF=0 and CX≠0 |
7. Flag Manipulation Instructions
Instruction | Explanation | Example |
CLC | Clear carry flag | CLC — Clears CF |
STC | Set carry flag | STC — Sets CF |
CMC | Complement carry flag | CMC — Inverts CF |
CLD | Clear direction flag | CLD — Makes string ops increment |
STD | Set direction flag | STD — Makes string ops decrement |
CLI | Clear interrupt flag | CLI — Disables interrupts |
STI | Set interrupt flag | STI — Enables interrupts |
LAHF | Load flags into AH | LAHF — AH ← lower byte of flags |
SAHF | Store AH into flags | SAHF — flags ← AH |
8. Control Transfer Instructions
Instruction | Explanation | Example |
CALL | Call subroutine | CALL 3000H — Calls subroutine at 3000H |
RET | Return from subroutine | RET — Returns from procedure |
RETF | Return far | RETF — Returns far from procedure |
INT | Call interrupt | INT 21H — Calls DOS interrupt |
INTO | Interrupt on overflow | INTO — Calls interrupt if OF=1 |
IRET | Return from interrupt | IRET — Used in interrupt handlers |
9. Miscellaneous Instructions
Instruction | Explanation | Example |
NOP | No operation | NOP — Does nothing |
HLT | Halt CPU until interrupt | HLT — Halts CPU |
WAIT | Wait for TEST pin to clear | WAIT — Waits until TEST=0 |
ESC | Escape to external processor | ESC 0, [BX] — For coprocessor |
LOCK | Lock memory bus for next instruction | LOCK INC [BX] — Atomic increment |
CBW | Convert byte to word | CBW — Extends AL to AX with sign |
CWD | Convert word to double word | CWD — Extends AX to DX:AX with sign |
{developer} > Java > PHP > WordPress > HTML-CSS-JS