80386 Programmer's Reference Manual -- Opcode AAM

AAM -- ASCII Adjust AX after Multiply

OpcodeInstructionClocks DescriptionExample
D4 0Aaam 17 ASCII adjust AX after multiplyaam


AH := AL / 10;
AL := AL MOD 10;


Execute AAM only after executing a MUL instruction between two unpacked BCD digits that leaves the result in the AX register. Because the result is less than 100, it is contained entirely in the AL register. AAM unpacks the AL result by dividing AL by 10, leaving the quotient (most-significant digit) in AH and the remainder (least-significant digit) in AL.

Flags Affected

SF, ZF, and PF as described in Appendix C; OF, AF, and CF are undefined

Protected Mode Exceptions


Real Address Mode Exceptions


Virtual 8086 Mode Exceptions


[Home Page dell'ITIS "Fermi"] [80386 Programmer's Reference Manual Index] [Previous] [Next]