The following tables summarize the arithmetic instructions used with
the 8086 microprocessor. A brief example is given for each instruction,
and the flags affected by the instruction.
The “*” in the table means that the corresponding flag may change as a
result of executing the instruction. The “-“ means that the corresponding
flag is not affected by the instruction, whereas the “?” means that the
flag is undefined after executing the instruction.
Instruction | Example | Meaning | OF | SF | ZF | AF | PF | CF
|
ADD | ADD AX, 7BH | AX = AX + 7B | * | * | * | * | * | *
|
ADC | ADC AX, 7BH | AX = AX + 7B + CF | * | * | * | * | * | *
|
INC | INC [BX] | [BX] = [BX] + 1 | * | * | * | * | * | -
|
DAA | DAA | Decimal Adjust after Add | * | * | * | * | * | *
|
Table: Addition Instructions
Instruction | Example | Meaning | OF | SF | ZF | AF | PF | CF
|
SUB | SUB CL, AH | CL = CL – AH | * | * | * | * | * | *
|
SBB | SBB CL, AH | CL = CL – AH – CF | * | * | * | * | * | *
|
DEC | DEC DAT | [DAT] = [DAT] – 1 | * | * | * | * | * | -
|
DAS | DAS | Decimal Adjust after Sub | * | * | * | * | * | *
|
NEG | NEG CX | CX = 0 – CX | * | * | * | * | * | *
|
Table: Subtraction Instructions
Instruction | Example | Meaning | OF | SF | ZF | AF | PF | CF
|
MUL | MUL CL | AX = AL * CL | * | ? | ? | ? | ? | *
|
MUL | MUL CX | (DX,AX) = AX* CX | * | ? | ? | ? | ? | *
|
IMUL | IMUL BYTE PTR X | AX = AL * [X] | * | ? | ? | ? | ? | *
|
IMUL | IMUL WORD PTR X | (DX,AX) = AX*[X] | * | ? | ? | ? | ? | *
|
Table: Multiplication Instructions
Instruction | Example | Meaning | OF | SF | ZF | AF | PF | CF
|
DIV | DIV WORD PTR X | AX = Q(([DX,AX])/[X]) | ? | ? | ? | ? | ? | ?
|
| | DX = R(([DX,AX])/[X]) | ? | ? | ? | ? | ? | ?
|
IDIV | IDIV BH | AL = Q(AX/BH) | ? | ? | ? | ? | ? | ?
|
| | AH = R(AX/BH) | ? | ? | ? | ? | ? | ?
|
Table: Division Instructions
Instruction | Example | Meaning | OF | SF | ZF | AF | PF | CF
|
CBW | CBW | AH = MSB(AL) | - | - | - | - | - | -
|
CWD | CWD | DX = MSB(AX) | - | - | - | - | - | -
|
Table: Sign Extension Instructions