Undocumented OpCodes: AAD 

----------------------------------------------------------------------------

AAD - D5 IMM8 - ASCII Adjust before Division 


Undocumented:  Available to all Intel x86 processors
               Useful in production source code.
                                                              AAD
Flags:                               ASCII Adjust before Division
+-+-+-+-+-+-+-+-+-+                       +----------+----------+
|O|D|I|T|S|Z|A|P|C|                       | 11010101 |   DATA   |
+-+-+-+-+-+-+-+-+-+                       +----------+----------+
|+| | | |+|+|+|+|+|                       |    D5    |     IMM8 |
+-+-+-+-+-+-+-+-+-+                       +----------+----------+


This instruction is the multiplication counterpart to AAM. As is the 
case with AAM, AAD uses the second byte as an operand. This operand is 
the multiplicand for AAD. Like AAM, AAD provides a way to execute a MUL 
IMM8 that is unavailable through any other means in the CPU. Unlike MUL, 
or IMUL, AAD sets all of the CPU status flags according to the result. 
Intel states that the Overflow Flag (OF), Auxiliary carry Flag (AF), and 
Carry Flag (CF) are undefined. This assertion is incorrect. These flags 
are fully defined, and are set consistently with respect to any other 
integer operations. And again, like AMM, beginning with the Pentium, 
Intel has finally acknowledged the existence of the second byte of this 
instruction as its operand. Intel says:

"Note: imm8 has the value of the instruction's second byte. The second 
byte under normally assembly [sic] of this instruction will be 0A, 
however, explicit modification of this byte will result in the operation 
described above and may alter results."

This instruction exists in this form on all Intel x86 processors. See 
the file AAD.ASM for diagnostics source code for this instruction. 

----------------------------------------------------------------------------

Get description of other opcodes:
AAM:      ftp://ftp.x86.org/pub/x86/secrets/opcodes/AAM.txt
AAD:      ftp://ftp.x86.org/pub/x86/secrets/opcodes/AAD.txt
CMOV:     ftp://ftp.x86.org/pub/x86/p6/opcodes/CMOV.txt
FCMOV:    ftp://ftp.x86.org/pub/x86/p6/opcodes/FCMOV.txt
FCOMI:    ftp://ftp.x86.org/pub/x86/p6/opcodes/FCOMI.txt
ICEBP:    ftp://ftp.x86.org/pub/x86/secrets/opcodes/ICEBP.txt
INT01:    ftp://ftp.x86.org/pub/x86/secrets/opcodes/ICEBP.txt
LOADALL:  ftp://ftp.x86.org/pub/x86/secrets/opcodes/LOADALL.txt
RDPMC:    ftp://ftp.x86.org/pub/x86/p6/opcodes/RDPMC.txt
SALC:     ftp://ftp.x86.org/pub/x86/secrets/opcodes/SALC.txt
UMOV:     ftp://ftp.x86.org/pub/x86/secrets/opcodes/UMOV.txt

----------------------------------------------------------------------------

Download this file -- OpCodes.ZIP 
ftp://ftp.x86.org/pub/x86/dloads/OPCODES.ZIP 

Download file AAD.ASM
ftp://ftp.x86.org/pub/x86/source/aad/aad.asm

----------------------------------------------------------------------------

(c) 1991, 1995, 1996 Intel Secrets(TM) home page. PGP key available. 

Make no mistake! 
The Intel Secrets web site is proud to provide superior information and 
service without any affilation to Intel. 

"Intel Secrets" and "What Intel doesn't want you to know" are trademarks 
of Robert Collins. 

Pentium and Intel are trademarks of Intel Corporation. 386, 486, 586, 
P6, and all other numbers.are not!

All other trademarks are those of their respective companies. See 
Trademarks and Disclaimers for more info. 

Robert Collins is a Senior Design Engineer and Manager of some sort of 
Research in Dallas, TX. Robert may be reached via email at 
rcollins@x86.org or via phone at (214) 491-7718. 
