AngoLinux |
80386 Programmer's Reference Manual -- Opcode AAA |
AAA -- ASCII Adjust after Addition
OperationIF ((AL AND 0FH) > 9) OR (AF = 1) THEN AL := (AL + 6) AND 0FH; AH := AH + 1; AF := 1; CF := 1; ELSE CF := 0; AF := 0; FI; DescriptionExecute AAA only following an ADD instruction that leaves a byte result in the AL register. The lower nibbles of the operands of the ADD instruction should be in the range 0 through 9 (BCD digits). In this case, AAA adjusts AL to contain the correct decimal digit result. If the addition produced a decimal carry, the AH register is incremented, and the carry and auxiliary carry flags are set to 1. If there was no decimal carry, the carry and auxiliary flags are set to 0 and AH is unchanged. In either case, AL is left with its top nibble set to 0. To convert AL to an ASCII result, follow the AAA instruction with OR AL, 30H.Flags AffectedAF and CF as described above; OF, SF, ZF, and PF are undefinedProtected Mode ExceptionsNoneReal Address Mode ExceptionsNone
[Home Page dell'ITIS "Fermi"] [80386 Programmer's Reference Manual Index] [Previous] [Next] |