| |
Ascii Adjust for Division
86/88 |
Y |
186 |
Y |
286 |
Y |
386 |
Y |
486 |
Y |
AAD |
Ovfl |
? |
Dir |
N |
Int |
N |
Trap |
N |
Sign |
Y |
Zero |
Y |
Aux |
? |
Prty |
Y |
Carry |
? |
AAD converts the unpacked two-digit BCD number in AX into binary in
preparation for a division using DIV or IDIV, which require binary
rather than BCD numbers.
AAD modifies the numerator in AL so that the result produced by a
division will be a valid unpacked BCD number. For the subsequent DIV
to produce the correct result, AH must be 0. After the division, the
quotient is returned in AL, and the remainder in AH. Both high-order
nibbles are zeroed.
Note: Unpacked BCD stores one digit per byte; AH contains
the most-significant digit and AL the least-
significant digit.
------------------------------------ Timing ----------------------------------
OpCode Instruction 386 286 86
D5 0A AAD 19 14 60
------------------------------------ Logic -----------------------------------
AL = AH * 10 + AL
AH = 0
See Also AAA AAS AAM DAA DIV IDIV Flags |