![Intel ITANIUM ARCHITECTURE Manual Download Page 95](http://html.mh-extra.com/html/intel/itanium-architecture/itanium-architecture_manual_2073403095.webp)
4:88
Volume 4: Base IA-32 Instruction Reference
DAS—Decimal Adjust AL after Subtraction
Description
Adjusts the result of the subtraction of two packed BCD values to create a packed BCD
result. The AL register is the implied source and destination operand. The DAS
instruction is only useful when it follows a SUB instruction that subtracts (binary
subtraction) one 2-digit, packed BCD value from another and stores a byte result in the
AL register. The DAS instruction then adjusts the contents of the AL register to contain
the correct 2-digit, packed BCD result. If a decimal borrow 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 BorrowFromLastSubtraction; (* CF OR borrow from AL
AL
6 *)
AF
1;
ELSE AF
0;
FI;
IF ((AL > 9FH) or CF = 1)
THEN
AL
AL
60H;
CF
1;
ELSE CF
0;
FI;
Example
SUB AL, BL
Before: AL=35H BL=47H EFLAGS(OSZAPC)=XXXXXX
After: AL=EEH BL=47H EFLAGS(0SZAPC)=010111
DAA
Before: AL=EEH BL=47H EFLAGS(OSZAPC)=010111
After: AL=88H BL=47H EFLAGS(0SZAPC)=X10111
Flags Affected
The CF and AF flags are set if the adjustment of the value results in a decimal borrow 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
2F
DAS
Decimal adjust AL after subtraction
Summary of Contents for ITANIUM ARCHITECTURE
Page 1: ......
Page 7: ...402 Intel Itanium Architecture Software Developer s Manual Rev 2 3 ...
Page 199: ...4 192 Volume 4 Base IA 32 Instruction Reference FWAIT Wait See entry for WAIT ...
Page 352: ...Volume 4 Base IA 32 Instruction Reference 4 345 ROL ROR Rotate See entry for RCL RCR ROL ROR ...
Page 589: ...4 582 Volume 4 IA 32 SSE Instruction Reference ...
Page 590: ...Index Intel Itanium Architecture Software Developer s Manual Rev 2 3 Index ...
Page 591: ...Index Intel Itanium Architecture Software Developer s Manual Rev 2 3 ...
Page 603: ...INDEX Index 12 Index for Volumes 1 2 3 and 4 ...
Page 604: ......