See: [https://yassinebridi.github.io/asm-docs/8086_instruction_set.html Complete 8086 instruction set] [https://www.righto.com/2023/08/datapoint-to-8086.html Tracing the roots of the 8086 instruction set to the Datapoint 2200 minicomputer]
{| class="wikitable" style="text-align: center;"
|+ 8086 Instruction Set Summary
! rowspan=2 | Mnemonic !! rowspan=2 | Description !! rowspan=2 | Operation !! colspan=6 | Flags Affected
|-
! OF !! SF !! ZF !! AF !! PF !! CF
|-
| AAA || ASCII Adjust After Addition || Adjust AL after BCD addition || U || U || U || * || U || *
|-
| AAD || ASCII Adjust Before Division || Adjust AX before BCD division || U || * || * || U || * || U
|-
| AAM || ASCII Adjust After Multiply || Adjust AX after BCD multiplication || U || * || * || U || * || U
|-
| AAS || ASCII Adjust After Subtraction || Adjust AL after BCD subtraction || U || U || U || * || U || *
|-
| ADC || Add with Carry || Destination + Source + CF → Destination || * || * || * || * || * || *
|-
| ADD || Add || Destination + Source → Destination || * || * || * || * || * || *
|-
| AND || Logical AND || Destination ∧ Source → Destination || 0 || * || * || U || * || 0
|-
| CALL || Call Procedure || Push IP (and CS); Target → IP (and CS) || – || – || – || – || – || –
|-
| CBW || Convert Byte to Word || Sign extend AL into AH || – || – || – || – || – || –
|-
| CLC || Clear Carry Flag || 0 → CF || – || – || – || – || – || 0
|-
| CLD || Clear Direction Flag || 0 → DF || – || – || – || – || – || –
|-
| CLI || Clear Interrupt Flag || 0 → IF || – || – || – || – || – || –
|-
| CMC || Complement Carry Flag || ¬CF → CF || – || – || – || – || – || *
|-
| CMP || Compare || Destination - Source (Flags set, result discarded) || * || * || * || * || * || *
|-
| CMPSB || Compare String Byte || Compare byte [DS:SI] with [ES:DI]; Update SI, DI || * || * || * || * || * || *
|-
| CMPSW || Compare String Word || Compare word [DS:SI] with [ES:DI]; Update SI, DI || * || * || * || * || * || *
|-
| CWD || Convert Word to Double Word || Sign extend AX into DX:AX || – || – || – || – || – || –
|-
| DAA || Decimal Adjust After Addition || Adjust AL after packed BCD addition || U || * || * || * || * || *
|-
| DAS || Decimal Adjust After Subtraction || Adjust AL after packed BCD subtraction || U || * || * || * || * || *
|-
| DEC || Decrement by 1 || Destination - 1 → Destination || * || * || * || * || * || –
|-
| DIV || Unsigned Divide || AX / Src(Byte) → AL (Q), AH (R) <br> DX:AX / Src(Word) → AX (Q), DX (R) || U || U || U || U || U || U
|-
| ESC || Escape (to coprocessor) || Used for floating-point/coprocessor instructions || – || – || – || – || – || –
|-
| HLT || Halt || Halt processor until interrupt or reset || – || – || – || – || – || –
|-
| IDIV || Signed Divide || AX / Src(Byte) → AL (Q), AH (R) <br> DX:AX / Src(Word) → AX (Q), DX (R) || U || U || U || U || U || U
|-
| IMUL || Signed Multiply || AL * Src(Byte) → AX <br> AX * Src(Word) → DX:AX || * || U || U || U || U || *
|-
| IN || Input from Port || Port → AL or AX || – || – || – || – || – || –
|-
| INC || Increment by 1 || Destination + 1 → Destination || * || * || * || * || * || –
|-
| INT || Interrupt || Push Flags, CS, IP; Vector → CS:IP || Clears TF, IF || – || – || – || – || –
|-
| INTO || Interrupt on Overflow || If OF=1 then INT 4 || Clears TF, IF if trap || – || – || – || – || –
|-
| IRET || Interrupt Return || Pop IP, CS, Flags || * || * || * || * || * || *
|-
| Jcc || Conditional Jump (e.g., JE, JNE, JG...) || If condition is met then IP + disp → IP || – || – || – || – || – || –
|-
| JMP || Unconditional Jump || Target → IP (and possibly CS) || – || – || – || – || – || –
|-
| LAHF || Load AH from Flags || Low byte of Flags → AH || – || – || – || – || – || –
|-
| LDS || Load Pointer using DS || mem → reg; mem+2 → DS || – || – || – || – || – || –
|-
| LEA || Load Effective Address || Effective Address of Source → Destination Register || – || – || – || – || – || –
|-
| LES || Load Pointer using ES || mem → reg; mem+2 → ES || – || – || – || – || – || –
|-
| LOCK || Lock Bus Prefix || Assert LOCK# signal during next instruction || – || – || – || – || – || –
|-
| LODSB || Load String Byte || [DS:SI] → AL; Update SI || – || – || – || – || – || –
|-
| LODSW || Load String Word || [DS:SI] → AX; Update SI || – || – || – || – || – || –
|-
| LOOP || Loop || CX - 1 → CX; If CX ≠ 0 then Jump || – || – || – || – || – || –
|-
| LOOPE / LOOPZ || Loop while Equal / Zero || CX - 1 → CX; If CX ≠ 0 and ZF=1 then Jump || – || – || – || – || – || –
|-
| LOOPNE / LOOPNZ || Loop while Not Equal / Not Zero || CX - 1 → CX; If CX ≠ 0 and ZF=0 then Jump || – || – || – || – || – || –
|-
| MOV || Move || Source → Destination || – || – || – || – || – || –
|-
| MOVSB || Move String Byte || Move byte [DS:SI] to [ES:DI]; Update SI, DI || – || – || – || – || – || –
|-
| MOVSW || Move String Word || Move word [DS:SI] to [ES:DI]; Update SI, DI || – || – || – || – || – || –
|-
| MUL || Unsigned Multiply || AL * Src(Byte) → AX <br> AX * Src(Word) → DX:AX || * || U || U || U || U || *
|-
| NEG || Negate (Two's Complement) || 0 - Destination → Destination || * || * || * || * || * || *
|-
| NOP || No Operation || No operation || – || – || – || – || – || –
|-
| NOT || Logical NOT (One's Complement) || ¬Destination → Destination || – || – || – || – || – || –
|-
| OR || Logical OR || Destination ∨ Source → Destination || 0 || * || * || U || * || 0
|-
| OUT || Output to Port || AL or AX → Port || – || – || – || – || – || –
|-
| POP || Pop Word from Stack || [SS:SP] → Destination; SP + 2 → SP || – || – || – || – || – || –
|-
| POPF || Pop Flags from Stack || [SS:SP] → Flags; SP + 2 → SP || * || * || * || * || * || *
|-
| PUSH || Push Word onto Stack || SP - 2 → SP; Source → [SS:SP] || – || – || – || – || – || –
|-
| PUSHF || Push Flags onto Stack || SP - 2 → SP; Flags → [SS:SP] || – || – || – || – || – || –
|-
| RCL || Rotate Left through Carry || Rotate Destination left, CF fills LSB, MSB fills CF || * || – || – || – || – || *
|-
| RCR || Rotate Right through Carry || Rotate Destination right, CF fills MSB, LSB fills CF || * || – || – || – || – || *
|-
| REP || String Repeat Prefix || Repeat following string op while CX ≠ 0 || – || – || – || – || – || –
|-
| REPE / REPZ || Repeat While Equal / Zero Prefix || Repeat following string op while CX ≠ 0 and ZF=1 || – || – || – || – || – || –
|-
| REPNE / REPNZ || Repeat While Not Equal / Not Zero Prefix || Repeat following string op while CX ≠ 0 and ZF=0 || – || – || – || – || – || –
|-
| RET || Return from Procedure || Pop IP (and CS) from stack || – || – || – || – || – || –
|-
| ROL || Rotate Left || Rotate Destination left, MSB fills LSB and CF || * || – || – || – || – || *
|-
| ROR || Rotate Right || Rotate Destination right, LSB fills MSB and CF || * || – || – || – || – || *
|-
| SAHF || Store AH into Flags || AH → Low byte of Flags || * || * || * || * || * || *
|-
| SAL / SHL || Shift Arithmetic/Logical Left || Shift Destination left, 0 fills LSB, MSB fills CF || * || * || * || U || * || *
|-
| SAR || Shift Arithmetic Right || Shift Destination right, MSB preserved, LSB fills CF || * || * || * || U || * || *
|-
| SBB || Subtract with Borrow || Destination - Source - CF → Destination || * || * || * || * || * || *
|-
| SCASB || Scan String Byte || Compare AL with byte [ES:DI]; Update DI || * || * || * || * || * || *
|-
| SCASW || Scan String Word || Compare AX with word [ES:DI]; Update DI || * || * || * || * || * || *
|-
| SHR || Shift Logical Right || Shift Destination right, 0 fills MSB, LSB fills CF || * || 0 || * || U || * || *
|-
| STC || Set Carry Flag || 1 → CF || – || – || – || – || – || 1
|-
| STD || Set Direction Flag || 1 → DF || – || – || – || – || – || –
|-
| STI || Set Interrupt Flag || 1 → IF || – || – || – || – || – || –
|-
| STOSB || Store String Byte || AL → [ES:DI]; Update DI || – || – || – || – || – || –
|-
| STOSW || Store String Word || AX → [ES:DI]; Update DI || – || – || – || – || – || –
|-
| SUB || Subtract || Destination - Source → Destination || * || * || * || * || * || *
|-
| TEST || Logical Compare (AND) || Destination ∧ Source (Flags set, result discarded) || 0 || * || * || U || * || 0
|-
| WAIT || Wait || Wait for TEST# pin active (for coprocessor sync) || – || – || – || – || – || –
|-
| XCHG || Exchange || Source ↔ Destination || – || – || – || – || – || –
|-
| XLAT / XLATB || Translate Byte || AL → [DS:BX + AL] || – || – || – || – || – || –
|-
| XOR || Logical Exclusive OR || Destination ⊕ Source → Destination || 0 || * || * || U || * || 0
|}
== Secret Instruction ==