Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- TASM 2.x / MASM 6.x Assembly Language - <b>aad ascii adjust before division flags: o d i t s z a p c</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
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.

See Also: AAA AAS AAM DIV IDIV Flags

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson