Quick navigation: [ Jump to body ]

Quick navigation: [ Jump to menu ]

Intel Pentium CPU Instruction Set Reference

DAA instruction - Decimal Adjust AL after Addition

Code Mnemonic Description
27 DAA Decimal adjust AL after addition

Description

Adjusts the sum of two packed BCD values to create a packed BCD result. The AL register is the implied source and destination operand. The DAA instruction is only useful when it follows an ADD instruction that adds (binary addition) two 2-digit, packed BCD values and stores a byte result in the AL register. The DAA instruction then adjusts the contents of the AL register to contain the correct 2-digit, packed BCD result. If a decimal carry is detected, the CF and AF flags are set accordingly.

Operands Bytes Clocks
1 3 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 sets if the adjustment of the value results in a decimal carry in either digit of the result
NT unaffected PF sets according to the result
IOPL unaffected CF sets if the adjustment of the value results in a decimal carry in either digit of the result
OF undefined

Advertisement