image/svg+xmlAAA—ASCII Adjust After AdditionInstruction Operand EncodingDescriptionAdjusts the sum of two unpacked BCD values to create an unpacked BCD result. The AL register is the implied source and destination operand for this instruction. The AAA instruction is only useful when it follows an ADD instruction that adds (binary addition) two unpacked BCD values and stores a byte result in the AL register. The AAA instruction then adjusts the contents of the AL register to contain the correct 1-digit unpacked BCD result. If the addition produces a decimal carry, the AH register increments by 1, and the CF and AF flags are set. If there was no decimal carry, the CF and AF flags are cleared and the AH register is unchanged. In either case, bits 4 through 7 of the AL register are set to 0.This instruction executes as described in compatibility mode and legacy mode. It is not valid in 64-bit mode.OperationIF 64-Bit ModeTHEN#UD;ELSEIF ((AL AND 0FH) > 9) or (AF = 1)THENAX := AX + 106H;AF := 1;CF := 1;ELSEAF := 0;CF := 0;FI;AL := AL AND 0FH;FI;Flags AffectedThe AF and CF flags are set to 1 if the adjustment results in a decimal carry; otherwise they are set to 0. The OF, SF, ZF, and PF flags are undefined.Protected Mode Exceptions#UDIf the LOCK prefix is used.Real-Address Mode ExceptionsSame exceptions as protected mode.Virtual-8086 Mode ExceptionsSame exceptions as protected mode.OpcodeInstructionOp/ En64-bit ModeCompat/Leg ModeDescription37AAAZOInvalidValidASCII adjust AL after addition.Op/EnOperand 1Operand 2Operand 3Operand 4ZONANANANA

image/svg+xmlCompatibility Mode ExceptionsSame exceptions as protected mode.64-Bit Mode Exceptions#UDIf in 64-bit mode.

This UNOFFICIAL reference was generated from the official Intel® 64 and IA-32 Architectures Software Developer’s Manual by a dumb script. There is no guarantee that some parts aren't mangled or broken and is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.