AAD ASCII Adjust before Division Flags: O D I T S Z A P C
? * * ? * ?
AAD
Logic: AL AH * 10 + AL
AH 0
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.
--------------------------------------------------------------------------
Operands Clocks Transfers Bytes Example
no operands 60 - 2 AAD
--------------------------------------------------------------------------
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.
Seealso:
This page last updated on Fri Nov 30 10:49:50 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster