
Volume 4: Base IA-32 Instruction Reference
4:87
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.
Operation
IF (((AL AND 0FH) > 9) or AF = 1)
THEN
AL
AL + 6;
CF
CF OR CarryFromLastAddition; (* CF OR carry from AL
AL + 6 *)
AF
1;
ELSE
AF
0;
FI;
IF ((AL AND F0H) > 90H) or CF = 1)
THEN
AL
AL + 60H;
CF
1;
ELSE
CF
0;
FI;
Example
ADD AL, BL
Before: AL=79H BL=35H EFLAGS(OSZAPC)=XXXXXX
After: AL=AEH BL=35H EFLAGS(0SZAPC)=110000
DAA
Before: AL=79H BL=35H EFLAGS(OSZAPC)=110000
After: AL=AEH BL=35H EFLAGS(0SZAPC)=X00111
Flags Affected
The CF and AF flags are set if the adjustment of the value results in a decimal carry in
either digit of the result (see “Operation” above). The SF, ZF, and PF flags are set
according to the result. The OF flag is undefined.
Additional Itanium System Environment Exceptions
Itanium Reg Faults NaT Register Consumption Abort.
Exceptions (All Operating Modes)
None.
Opcode
Instruction
Description
27
DAA
Decimal adjust AL after addition
Содержание ITANIUM ARCHITECTURE
Страница 1: ......
Страница 7: ...402 Intel Itanium Architecture Software Developer s Manual Rev 2 3 ...
Страница 199: ...4 192 Volume 4 Base IA 32 Instruction Reference FWAIT Wait See entry for WAIT ...
Страница 269: ...4 262 Volume 4 Base IA 32 Instruction Reference LES Load Full Pointer See entry for LDS LES LFS LGS LSS ...
Страница 270: ...Volume 4 Base IA 32 Instruction Reference 4 263 LFS Load Full Pointer See entry for LDS LES LFS LGS LSS ...
Страница 273: ...4 266 Volume 4 Base IA 32 Instruction Reference LGS Load Full Pointer See entry for LDS LES LFS LGS LSS ...
Страница 288: ...Volume 4 Base IA 32 Instruction Reference 4 281 LSS Load Full Pointer See entry for LDS LES LFS LGS LSS ...
Страница 352: ...Volume 4 Base IA 32 Instruction Reference 4 345 ROL ROR Rotate See entry for RCL RCR ROL ROR ...
Страница 368: ...Volume 4 Base IA 32 Instruction Reference 4 361 SHL SHR Shift Instructions See entry for SAL SAR SHL SHR ...
Страница 373: ...4 366 Volume 4 Base IA 32 Instruction Reference SIDT Store Interrupt Descriptor Table Register See entry for SGDT SIDT ...
Страница 589: ...4 582 Volume 4 IA 32 SSE Instruction Reference ...
Страница 590: ...Index Intel Itanium Architecture Software Developer s Manual Rev 2 3 Index ...
Страница 591: ...Index Intel Itanium Architecture Software Developer s Manual Rev 2 3 ...
Страница 603: ...INDEX Index 12 Index for Volumes 1 2 3 and 4 ...
Страница 604: ......