Intel Pentium CPU Instruction Set Reference
DAS instruction - Decimal Adjust AL after Subtraction
| Code |
Mnemonic |
Description |
| 2F |
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.
| 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 borrow 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 borrow in either digit of the result |
| OF |
undefined |