Quick navigation: [ Jump to body ]

Quick navigation: [ Jump to menu ]

Intel Pentium Instruction Set Reference

AAM - ASCII Adjust AX After Multiply

Code Mnemonic Description
D4 0A AAM ASCII adjust AX after multiply
D4 ib (no mnemonic) Adjust AX after multiply to number base imm8

Description

Adjusts the result of the multiplication of two unpacked BCD values to create a pair of unpacked (base 10) BCD values. The AX register is the implied source and destination operand for this instruction. The AAM instruction is only useful when it follows an MUL instruction that multiplies (binary multiplication) two unpacked BCD values and stores a word result in the AX register. The AAM instruction then adjusts the contents of the AX register to contain the correct 2-digit unpacked (base 10) BCD result.

The generalized version of this instruction allows adjustment of the contents of the AX to create two unpacked digits of any number base (see the "Operation" section below). Here, the imm8 byte is set to the selected number base (for example, 08H for octal, 0AH for decimal, or 0CH for base 12 numbers). The AAM mnemonic is interpreted by all assemblers to mean adjust to ASCII (base 10) values. To adjust to values in another number base, the instruction must be hand coded in machine code (D4 imm8).

Operands Bytes Clocks
  2 18 NP

Flags

ID unaffected DF unaffected
VIP unaffected IF unaffected
VIF unaffected TF unaffected
AC unaffected SF sets according to the result
VM unaffected ZF sets according to the result
RF unaffected AF undefined
NT unaffected PF sets according to the result
IOPL unaffected CF undefined
OF undefined