Complete 8086 instruction set

A complete reference of all Intel 8086 instructions, organised by category, with clock counts sourced from the Intel 8086 Family User’s Manual (1979). Each category links to the series post where that group is explained in depth with examples and flag effects. For memory operands, add EA clock costs: [BX]/[SI]/[DI]=5, [BP]=5, [BX/BP+disp]=9, [BX+SI]/[BP+DI]=7, [BX+DI]/[BP+SI]=8, [BX+SI/BP+DI+disp]=11, [BX+DI/BP+SI+disp]=12. Segment override adds 2.


1. Data Transfer Instructions

In-depth coverage: Register Reference · Stack Operations

InstructionClocksExplanationExample
MOV2–9+EACopy data from source to destinationMOV AX, BX — copies BX into AX (2 clocks)
PUSH15Decrement SP by 2, write register to SS:SPPUSH AX
POP12Read word from SS:SP into register, increment SP by 2POP BX
PUSHF14Push FLAGS register onto stackPUSHF
POPF12Pop word from stack into FLAGS registerPOPF
XCHG3–4Exchange two operands atomically (3 if one is AX)XCHG AX, BX
IN10–14Read byte/word from I/O port into AL/AXIN AL, 60h
OUT10–14Write AL/AX to I/O portOUT 60h, AL
LEA2+EALoad effective address (no bus cycle)LEA BX, [SI+10]
LDS16+EALoad DS:reg from far pointer in memoryLDS SI, [2000h]
LES16+EALoad ES:reg from far pointer in memoryLES DI, [2000h]
XLATB11AL = DS:[BX+AL] — table lookup via BX+ALXLATB
LAHF4Load SF/ZF/AF/PF/CF into AH bits 7/6/4/2/0LAHF
SAHF4Store AH into SF/ZF/AF/PF/CF (used after 8087 FSTSW)SAHF
CBW2Sign-extend AL into AXCBW
CWD5Sign-extend AX into DX:AX (for IDIV)CWD

2. Arithmetic Instructions

In-depth coverage: Flag Register · Instruction Timing

InstructionClocksExplanationExample
ADD3–9+EAAdd; sets CF OF SF ZF PF AFADD AX, BX
ADC3–9+EAAdd with carry (for 32-bit multi-word addition)ADC AX, BX
SUB3–9+EASubtract; sets CF OF SF ZF PF AFSUB AX, BX
SBB3–9+EASubtract with borrow (multi-word subtraction)SBB AX, BX
INC2–3Increment by 1; does NOT change CFINC AX (2), INC AL (3)
DEC2–3Decrement by 1; does NOT change CFDEC BX
NEG3–16+EATwo’s complement negationNEG AX
CMP3–9+EASubtract and set flags; result discardedCMP AX, BX
MUL70–133Unsigned multiply; result in AX (8-bit) or DX:AX (16-bit)MUL BL (70–77) / MUL BX (118–133)
IMUL80–154Signed multiply; same result placement as MULIMUL BL (80–98)
DIV80–162Unsigned divide AX (8-bit) or DX:AX (16-bit); AL=quotient AH=remDIV BL
IDIV101–184Signed divide; use CWD to set up DX:AX before dividingIDIV BL
DAA4Decimal adjust AL after packed BCD additionADD AL,BL / DAA
DAS4Decimal adjust AL after packed BCD subtractionSUB AL,BL / DAS
AAA8ASCII adjust AL after unpacked BCD additionADD AL,'3' / AAA
AAS8ASCII adjust AL after unpacked BCD subtractionSUB AL,BL / AAS
AAD60Convert AH:AL unpacked BCD to binary before DIVAAD / DIV BL
AAM83Convert AL binary to AH:AL unpacked BCD after MULMUL BL / AAM

3. Logical Instructions

In-depth coverage: Flag Register (CF and OF always cleared by logic ops)

InstructionClocksExplanationExample
AND3–9+EABitwise AND; clears CF and OFAND AX, BX
OR3–9+EABitwise OR; clears CF and OFOR AX, BX
XOR3–9+EABitwise XOR; XOR reg,reg zeroes a register in 3 clocksXOR AX, AX
NOT3–16+EABitwise complement; does NOT affect any flagsNOT AX
TEST3–9+EAAND without storing result; sets ZF if no bits match maskTEST AX, 0001h

4. Shift and Rotate Instructions

In-depth coverage: Register Reference (CL is mandatory for variable count)

InstructionClocksExplanationExample
SHL/SAL2 / 8+4×CLShift left; multiply by 2 per bit; MSB goes to CFSHL AX, 1 / SHL AX, CL
SHR2 / 8+4×CLLogical shift right; zero fills MSB; LSB to CFSHR AX, 1
SAR2 / 8+4×CLArithmetic shift right; sign bit replicated; signed divide by 2SAR AX, 1
ROL2 / 8+4×CLRotate left; MSB wraps to LSB and to CFROL AL, 1
ROR2 / 8+4×CLRotate right; LSB wraps to MSB and to CFROR AL, 1
RCL2 / 8+4×CLRotate left through carry; CF participates in rotationRCL AL, 1
RCR2 / 8+4×CLRotate right through carryRCR AL, 1

5. Branch / Jump Instructions

In-depth coverage: Flag Register (flag conditions for each jump)

InstructionClocksExplanationExample
JMP15Unconditional jump (near/short); flushes prefetch queueJMP label
JE/JZ16/4Jump if equal/zero (ZF=1); 16 taken, 4 not takenJE LABEL
JNE/JNZ16/4Jump if not equal/zero (ZF=0)JNE LABEL
JC/JB/JNAE16/4Jump if carry/below (CF=1) — unsigned less thanJC LABEL
JNC/JNB/JAE16/4Jump if no carry (CF=0)JNC LABEL
JA/JNBE16/4Jump if above (CF=0 AND ZF=0) — unsigned greater thanJA LABEL
JL/JNGE16/4Jump if less (SF≠OF) — signed less thanJL LABEL
JGE/JNL16/4Jump if greater or equal (SF=OF)JGE LABEL
JG/JNLE16/4Jump if greater (ZF=0 AND SF=OF) — signedJG LABEL
JLE/JNG16/4Jump if less or equal (ZF=1 OR SF≠OF)JLE LABEL
JO/JNO16/4Jump if overflow / no overflow (OF=1/0)JO LABEL
JS/JNS16/4Jump if sign / no sign (SF=1/0)JS LABEL
JP/JPE16/4Jump if parity even (PF=1)JP LABEL
JNP/JPO16/4Jump if parity odd (PF=0)JNP LABEL
JCXZ18/6Jump if CX=0 (does not affect flags); use before LOOPJCXZ done
LOOP17/5Decrement CX, jump if CX≠0; DEC CX+JNZ is faster (15)LOOP START
LOOPE/LOOPZ18/6Loop while CX≠0 AND ZF=1LOOPE LABEL
LOOPNE/LOOPNZ19/5Loop while CX≠0 AND ZF=0LOOPNE LABEL

6. String Instructions

In-depth coverage: Addressing Modes & String Instructions

InstructionClocksExplanationExample
MOVSB/W18/17×CXMove byte/word DS:SI→ES:DI, adjust SI+DI per DFREP MOVSB
CMPSB/W22/22×CXCompare DS:SI with ES:DI; set flags; adjust SI+DIREPE CMPSB
SCASB/W15/15×CXCompare AL/AX with ES:DI; set flags; adjust DIREPNE SCASB
LODSB/W12Load DS:SI into AL/AX, adjust SILODSB
STOSB/W11/11×CXStore AL/AX to ES:DI, adjust DI; REP STOSW fastest fillREP STOSB
REPRepeat while CX≠0; decrement CX each iterationREP MOVSB
REPE/REPZRepeat while CX≠0 AND ZF=1REPE CMPSB
REPNE/REPNZRepeat while CX≠0 AND ZF=0REPNE SCASB

7. Flag Manipulation Instructions

In-depth coverage: Flag Register

InstructionClocksExplanationExample
CLC2Clear carry flag (CF=0)CLC
STC2Set carry flag (CF=1)STC
CMC2Complement carry flag (CF = NOT CF)CMC
CLD2Clear direction flag; string ops auto-increment SI/DICLD
STD2Set direction flag; string ops auto-decrement SI/DISTD
CLI2Clear interrupt enable flag; blocks maskable INTR interruptsCLI
STI2Set interrupt enable flag; allows hardware interruptsSTI
LAHF4Load SF/ZF/AF/PF/CF into AHLAHF
SAHF4Store AH into SF/ZF/AF/PF/CFSAHF

8. Control Transfer Instructions

In-depth coverage: Stack Operations · Interrupt System

InstructionClocksExplanationExample
CALL19/28Push return address, jump to target (near 19, far 28)CALL 3000h
RET20Near return: pop IP from stackRET / RET 4
RETF32Far return: pop IP then CS from stackRETF
INT n51Push FLAGS+CS+IP, jump via IVT[n×4]INT 21h
INTO53/4Interrupt if OF=1 (triggers INT 4); 4 clocks if OF=0INTO
IRET44Pop IP, CS, FLAGS from stack; only correct ISR exitIRET

9. Miscellaneous Instructions

InstructionClocksExplanationExample
NOP3No operation (XCHG AX,AX); used for timing padsNOP
HLT2Halt CPU until interrupt or resetHLT
WAIT/FWAIT3+Stall until 8087 BUSY pin deasserts; required after FSTPFWAIT
ESC8+EAEscape opcode (D8h–DFh): 8086 passes to 8087 coprocessorESC 0, [BX]
LOCK+0Prefix: assert LOCK signal during next instruction (bus lock)LOCK INC [BX]
CBW2Sign-extend AL into AXCBW
CWD5Sign-extend AX into DX:AX (prepare for IDIV)CWD

10. 8087 Coprocessor Instructions

Full treatment including register stack, data formats, and worked examples: Data Directives & 8087 FPU · Hardware interface (ESC/BUSY/WAIT): BIU/EU Architecture

InstructionExplanationExample
FLD srcPush mem32/64/80 or ST(i) onto FPU stack; ST(0) = srcFLD my_dq_var
FST / FSTPStore ST(0) to memory; FSTP also pops stackFSTP result
FXCH ST(i)Exchange ST(0) with ST(i); makes any register top-of-stackFXCH ST(2)
FILD / FISTLoad/store integer (16/32/64-bit) converting to/from floatFILD my_word
FLD1 / FLDZ / FLDPIPush constant 1.0 / 0.0 / π onto stackFLDPI
FADD / FSUB / FMUL / FDIVFloating-point arithmetic; operates on ST(0) with srcFADD ST(1)
FABS / FCHS / FSQRTAbsolute value / negate / square root of ST(0)FSQRT
FCOM / FTSTCompare ST(0) with src or 0.0; sets C0/C2/C3 in Status WordFTST / FSTSW / SAHF
FINIT / FWAITInitialize 8087 / stall 8086 until 8087 BUSY=LOWFINIT
FPTAN / FPATAN / FYL2XTranscendentals: tan, arctan, Y×log₂(X)FPTAN

11. 80286+ Protected Mode Instructions

Full treatment of protected mode segmentation, GDT/LDT, and privilege rings: Memory Segmentation

InstructionAvailableExplanationExample
ENTER n, 080186+Automates PUSH BP / MOV BP,SP / SUB SP,n stack frame setupENTER 4, 0
LEAVE80186+Automates MOV SP,BP / POP BP (epilogue); slower than explicit pairLEAVE
BOUND80186+Check array index in reg against bounds in memory; INT 5 if out of rangeBOUND AX, [limits]
LGDT / LIDT80286+Load 6-byte descriptor (base+limit) into GDTR / IDTR registerLGDT [gdt_desc]
LLDT80286+Load selector into LDTR (ring 0 only)LLDT AX
LMSW / SMSW80286+Load/store Machine Status Word; LMSW with PE=1 enters protected modeLMSW AX
ARPL80286+Adjust RPL field of selector so it ≥ caller’s privilege levelARPL AX, BX
VERR / VERW80286+Verify selector is readable/writable at current privilege; sets ZFVERR AX
LAR80286+Load access rights byte of a descriptor into registerLAR AX, BX
LSL80286+Load segment limit from descriptor into registerLSL AX, BX