DAS             Decimal Adjust after Subtraction     Flags: O D I T S Z A P C
? - - - * * * * *
DAS

Logic if ((AL AND 0Fh) > 9) OR (AF = 1)
AL ← AL - 6
AF ← 1
else AF ← 0
endif
if (AL > 9Fh) OR (CF = 1)
AL ← AL - 60h
CF ← 1
else CF ← 0
endif

Execute DAS after executing a SUB or SBB instruction on two packed
BCD operands. The subtraction leaves a two-digit byte result in
the AL register. The DAS instruction adjusts AL to contain the
correct two-digit packed decimal result.


Opcode Format
2F DAS


Length and timing
Operands Bytes 8088 186 286 386 486 Pentium
- 1 4 4 3 4 2 3 NP