das
Packed BCD adjust after subtraction
Adjusts al after a packed BCD subtraction so each nibble holds one decimal digit, setting CF and AF as needed.
8086 and laterNot available in 64-bit mode
CFPFAFZFSFDFOF ●●●●●–?
- ● set from the result
- ? undefined afterwards
- – not changed
- Reads CF AF
Forms
das
For the unpacked
equivalents, see AAA.
DAA should be used after a one-byte ADD instruction whose
destination was the AL register: by means of examining the value
in the AL and also the auxiliary carry flag AF, it
determines whether either digit of the addition has overflowed, and
adjusts it (and sets the carry and auxiliary-carry flags) if so. You
can add long BCD strings together by doing ADD/DAA on the
low two digits, then doing ADC/DAA on each subsequent pair
of digits.
DAS works similarly to DAA, but is for use after SUB
instructions rather than ADD.