Complete 8086 instruction set

Here’s a comprehensive list of 8086 instructions categorized by type:


1. Data Transfer Instructions

InstructionExplanationExample
MOVCopy data from source to destinationMOV AX, BX — Copies contents of BX into AX
PUSHPush register/memory onto stackPUSH AX — Pushes AX onto the stack
PUSHAPush all general-purpose registersPUSHA — Pushes AX, CX, DX, BX, SP, BP, SI, DI
PUSHFPush flags register onto stackPUSHF — Pushes flags onto the stack
POPPop from stack into register/memoryPOP BX — Pops top of stack into BX
POPAPop all general-purpose registersPOPA — Pops registers in reverse order
POPFPop flags register from stackPOPF — Pops flags from stack
XCHGExchange data between two operandsXCHG AX, BX — Swaps AX and BX
INInput from port to accumulatorIN AL, 60H — Reads byte from port 60H into AL
OUTOutput from accumulator to portOUT 60H, AL — Sends AL content to port 60H
LEALoad effective addressLEA BX, [SI+10] — Loads effective address into BX
LDSLoad pointer using segment and offsetLDS SI, [2000H] — Loads DS:SI from memory
LESLoad ES:register from memoryLES DI, [2000H] — Loads ES:DI from memory
XLATBTranslate byte using lookup tableXLATB — Replaces AL with DS:[BX + AL]

2. Arithmetic Instructions

InstructionExplanationExample
ADDAdd source to destinationADD AX, BX — Adds BX to AX
ADCAdd with carryADC AX, BX — Adds BX + Carry to AX
SUBSubtract source from destinationSUB AX, BX — Subtracts BX from AX
SBBSubtract with borrowSBB AX, BX — Subtracts BX + Carry from AX
INCIncrement operandINC AX — Increments AX by 1
DECDecrement operandDEC BX — Decrements BX by 1
NEGTwo’s complement (negation)NEG AX — Converts AX to -AX
CMPCompare operandsCMP AX, BX — Compares AX with BX
MULUnsigned multiplyMUL BL — Multiplies AL * BL, result in AX
IMULSigned multiplyIMUL BL — Signed multiply AL * BL
DIVUnsigned divideDIV BL — Divides AX by BL, result in AL, remainder in AH
IDIVSigned divideIDIV BL — Signed divide AX by BL
DAADecimal adjust after additionDAA — Adjusts AL for BCD after addition
DASDecimal adjust after subtractionDAS — Adjusts AL for BCD after subtraction
AAAASCII adjust after additionAAA — Adjusts AL after adding ASCII digits
AASASCII adjust after subtractionAAS — Adjusts AL after subtracting ASCII digits
AADASCII adjust for divisionAAD — Converts two ASCII digits to binary
AAMASCII adjust after multiplicationAAM — Adjusts result of multiplying ASCII digits

3. Logical Instructions

InstructionExplanationExample
ANDBitwise ANDAND AX, BXAX = AX & BX
ORBitwise OROR AX, BX — AX = AX | BX
XORBitwise XORXOR AX, BXAX = AX ^ BX
NOTBitwise NOTNOT AXAX = ~AX
TESTBitwise AND (no result change)TEST AX, 0001H — Checks if LSB is set

4. Shift and Rotate Instructions

InstructionExplanationExample
SHL/SALShift Left (Arithmetic/Logical)SHL AX, 1AX = AX << 1
SHRShift Right (Logical)SHR AX, 1AX = AX >> 1
SARShift Right ArithmeticSAR AX, 1 — Shifts right keeping sign
ROLRotate LeftROL AL, 1 — Rotates AL bits to the left
RORRotate RightROR AL, 1 — Rotates AL bits to the right
RCLRotate through Carry LeftRCL AL, 1 — Rotates with carry flag left
RCRRotate through Carry RightRCR AL, 1 — Rotates with carry flag right

5. Branch/Jump Instructions

InstructionExplanationExample
JMPUnconditional jumpJMP 2000H — Jump to address 2000H
JE/JZJump if equal/zeroJE LABEL — Jump if zero flag is set
JNE/JNZJump if not equal/not zeroJNE LABEL — Jump if zero flag is not set
JCJump if carryJC LABEL — Jump if carry flag is set
JNCJump if no carryJNC LABEL — Jump if carry flag is clear
JAJump if aboveJA LABEL — Jump if CF=0 and ZF=0
JAE/JNBJump if above or equalJAE LABEL — Jump if CF=0
JBJump if belowJB LABEL — Jump if CF=1
JBEJump if below or equalJBE LABEL — Jump if CF=1 or ZF=1
JGEJump if greater or equalJGE LABEL — Jump if SF=OF
JLJump if lessJL LABEL — Jump if SF≠OF
JGJump if greaterJG LABEL — Jump if ZF=0 and SF=OF
JLEJump if less or equalJLE LABEL — Jump if ZF=1 or SF≠OF
JNAJump if not aboveJNA LABEL — Jump if CF=1 or ZF=1
JNAEJump if not above or equalJNAE LABEL — Same as JB
JNBEJump if not below or equalJNBE LABEL — Same as JA
JNGJump if not greaterJNG LABEL — Jump if ZF=1 or SF≠OF
JNGEJump if not greater or equalJNGE LABEL — Jump if SF≠OF
JNLJump if not lessJNL LABEL — Jump if SF=OF
JNLEJump if not less or equalJNLE LABEL — Jump if ZF=0 and SF=OF
JNOJump if no overflowJNO LABEL — Jump if OF=0
JNP/JPOJump if not parity/parity oddJNP LABEL — Jump if PF=0
JNSJump if not signJNS LABEL — Jump if SF=0
JOJump if overflowJO LABEL — Jump if OF=1
JP/JPEJump if parity/parity evenJP LABEL — Jump if PF=1
JSJump if signJS LABEL — Jump if SF=1
JCXZJump if CX is zeroJCXZ LABEL — Jump if CX=0
LOOPLoop with CXLOOP START — Decrements CX, jumps if CX ≠ 0
LOOPE/LOOPZLoop while equal/zeroLOOPE LABEL — Loop if CX≠0 and ZF=1
LOOPNE/LOOPNZLoop while not equal/not zeroLOOPNE LABEL — Loop if CX≠0 and ZF=0

6. String Instructions

InstructionExplanationExample
MOVSBMove byte from stringMOVSB — Moves byte from DS:SI to ES:DI
MOVSWMove word from stringMOVSW — Moves word from DS:SI to ES:DI
CMPSBCompare byte stringsCMPSB — Compares byte at DS:SI with ES:DI
CMPSWCompare word stringsCMPSW — Compares word at DS:SI with ES:DI
SCASBScan byte stringSCASB — Scans for byte in AL in string at ES:DI
SCASWScan word stringSCASW — Same for words
LODSBLoad byte from string to ALLODSB — Loads from DS:SI to AL
LODSWLoad word to AXLODSW — Loads from DS:SI to AX
STOSBStore byte from ALSTOSB — Stores AL into ES:DI
STOSWStore word from AXSTOSW — Stores AX into ES:DI
REPRepeat prefixREP MOVSB — Repeat MOVSB while CX ≠ 0
REPE/REPZRepeat while equal/zeroREPE CMPSB — Repeat if ZF=1 and CX≠0
REPNE/REPNZRepeat while not equalREPNE SCASB — Repeat if ZF=0 and CX≠0

7. Flag Manipulation Instructions

InstructionExplanationExample
CLCClear carry flagCLC — Clears CF
STCSet carry flagSTC — Sets CF
CMCComplement carry flagCMC — Inverts CF
CLDClear direction flagCLD — Makes string ops increment
STDSet direction flagSTD — Makes string ops decrement
CLIClear interrupt flagCLI — Disables interrupts
STISet interrupt flagSTI — Enables interrupts
LAHFLoad flags into AHLAHF — AH ← lower byte of flags
SAHFStore AH into flagsSAHF — flags ← AH

8. Control Transfer Instructions

InstructionExplanationExample
CALLCall subroutineCALL 3000H — Calls subroutine at 3000H
RETReturn from subroutineRET — Returns from procedure
RETFReturn farRETF — Returns far from procedure
INTCall interruptINT 21H — Calls DOS interrupt
INTOInterrupt on overflowINTO — Calls interrupt if OF=1
IRETReturn from interruptIRET — Used in interrupt handlers

9. Miscellaneous Instructions

InstructionExplanationExample
NOPNo operationNOP — Does nothing
HLTHalt CPU until interruptHLT — Halts CPU
WAITWait for TEST pin to clearWAIT — Waits until TEST=0
ESCEscape to external processorESC 0, [BX] — For coprocessor
LOCKLock memory bus for next instructionLOCK INC [BX] — Atomic increment
CBWConvert byte to wordCBW — Extends AL to AX with sign
CWDConvert word to double wordCWD — Extends AX to DX:AX with sign