Ascii Adjust for Addition                          

86/88

Y

186

Y

286

Y

386

Y

486

Y

AAA

Ovfl

N

Dir

N

Int

N

Trap

N

Sign

?

Zero

?

Aux

?

Prty

?

Carry

Y

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

    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.

------------------------------------ Timing ----------------------------------

OpCode          Instruction             386     286     86
37              AAA                     4       3       6

------------------------------------ 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 and 0Fh
 
See Also AAD AAS AAM ADC DAA ADD INC Flags


Copyright © 1985 to 2022 Beta Systems                            Last modified: Wednesday, January 05, 2022 .