Decimal Adjust after Subtraction
86/88 |
Y |
186 |
Y |
286 |
Y |
386 |
Y |
486 |
Y |
DAS |
Ovfl |
? |
Dir |
N |
Int |
N |
Trap |
N |
Sign |
Y |
Zero |
Y |
Aux |
Y |
Prty |
Y |
Carry |
Y |
DAS corrects the result of a previous subtraction of two valid packed
decimal operands (note that this result must be in AL). This
instruction changes the content of AL so that it will contain a pair
of valid packed decimal digits.
Note: Packed BCD stores one digit per nibble (4 bits); the
least significant digit is in the lower nibble.
It is not possible to apply an adjustment after
division or multiplication of packed BCD numbers.
If you need to use multiplication and division, it
is better to use unpacked BCD numbers. See, for
example, the description of AAM (ASCII Adjust after
Multiply).
------------------------------------ Timing ----------------------------------
OpCode Instruction 386 286 86
2F DAS 4 3 4
------------------------------------ Logic -----------------------------------
If (AL & 0Fh) > 9 or (AF = 1) then
AL = AL - 6
AF = 1
else
AF = 0
If (AL > 9Fh) or (CF = 1) then
AL = AL - 60h
CF = 1
else
CF = 0
See Also AAS DAA SUB SBB DEC NEG Flags |