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>aaa ascii adjust after addition 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]
AAA              ASCII Adjust after Addition         Flags: O D I T S Z A P C
                                                            ?       ? ? * ? *
AAA

          Logic:    If (AL & 0Fh) > 9 or (AF = 1) then
                        AL . AL + 6
                        AH . AH + 1
                        AF . 1;  CF . 1
                    else
                        AF . 0;  CF . 0
                    AL . AL & 0Fh

    Converts the number in the lower 4 bits (nibble) of AL to an unpacked
    BCD number (high-order nibble of AL is zeroed).

  --------------------------------------------------------------------------
   Operands                  Clocks   Transfers  Bytes   Example
   no operands                 4          -        1     AAA
  --------------------------------------------------------------------------

    If the lower 4 bits of the number in AL is greater than 9, or the
    auxiliary carry flag is set, this instruction converts AL to its
    unpacked BCD form by adding 6 (subtracting 10) to AL; adding 1 to AH;
    and setting the auxiliary flag and carry flags. This instruction will
    always leave 0 in the upper nibble of AL.

       Note:          Unpacked BCD stores one digit per byte; AH contains
                      the most-significant digit and AL the least-
                      significant digit.

See Also: AAD AAS AAM ADC DAA Flags

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