Beruflich Dokumente
Kultur Dokumente
ADD
SUB
Mul
Div
ADD-addition
SUB-Subtraction
MUL
Div
ADC-addition with
cary
INC-increment
SBB-Subtraction
with Borrow
DEC decrement
IMUL-Integer
multiplication
Accii ajust after
multiplication
AAA-ascii adjust
after addition
DAA-Decimal
addition after
addition
NEG-negative
IDIV-Integer
Division
AAD-ascii adjust
after
Division
CBW
CMP-Compare
CWD
AAS-Acii adjust
After Subtraction
DAS-Decimal
adjust after
SUBtraction
Org 100h
MOV AL, 5 ; AL = 5
ADD AL, -3 ; AL = 2
RET
org 100h
MOV AL, 05h
MOV [100],05h ;
ADD AL, [100] ;
Ret
Example:
STC
; set CF = 1
MOV AL, 5 ; AL = 5
ADC AL, 1 ; AL = 7
RET
Increment.
Algorithm:
operand = operand + 1
Example:
MOV AL, 4
INC AL
; AL = 5
RET
in both cases:
clear the high nibble of AL.
Example:
Subtract.
Algorithm:
operand1 = operand1 - operand2
Example:
MOV AL, 5
SUB AL, 1
RET
; AL = 4