13.07.2015 Views

Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

24594 Rev. 3.10 February 2005 AMD64 TechnologyAAMASCII Adjust After MultiplyConverts the value in the AL register from binary to two unpacked BCD digits in theAH (most significant) <strong>and</strong> AL (least significant) registers using the following formula:AH = (AL/10d)AL = (AL mod 10d).In most modern assemblers, the AAM instruction adjusts to base-10 values. However,by coding the instruction directly in binary, it can adjust to any base specified by theimmediate byte value (ib) suffixed onto the D4h opcode. For example, code D408h foroctal, D40Ah for decimal, <strong>and</strong> D40Ch for duodecimal (base 12).Using this instruction in 64-bit mode generates an invalid-opcode exception.Mnemonic Opcode DescriptionAAM(None)Related <strong>Instructions</strong>AAA, AAD, AASrFLAGS AffectedD4 0AD4 ibCreate a pair of unpacked BCD values in AH <strong>and</strong> AL.(Invalid in 64-bit mode.)Create a pair of unpacked values to the immediate byte base.(Invalid in 64-bit mode.)ID VIP VIF AC VM RF NT IOPL OF DF IF TF SF ZF AF PF CFExceptionsU M M U M U21 20 19 18 17 16 14 13–12 11 10 9 8 7 6 4 2 0Note: Bits 31–22, 15, 5, 3, <strong>and</strong> 1 are reserved. A flag set to 1 or cleared to 0 is M. Unaffected flags are blank. Undefined flags are U.Exception RealVirtual8086 Protected Cause of ExceptionDivide by zero, #DE X X X 8-bit immediate value was 0.Invalid opcode, #UD X This instruction was executed in 64-bit mode.AAM 63

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!