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

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

Execute AAS following a SUB or SBB operation on two unpacked BCD
digits that leaves a byte result in the AL register. AAS converts
the number in the lower 4 bits (nibble) of AL to an unpacked BCD
number (high-order nibble of AL is zeroed). If the subtraction
produced a decimal carry, the AH register is decremented, and the
carry and auxiliary carry flags are set to 1. If the subtraction
produced no decimal carry, the carry and auxiliary carry flags are
set to 0 and AH is unchanged.


Opcode Format
3F AAS


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