ASCII Adjust after Subtraction. Corrects result in AH and AL after subtraction when working with BCD values. Algorithm: If low nibble of AL > 9 or AF = 1 then: AL=AL-6, AH=AH-1, AF=1, CF=1 else : AF=0, CF=0 In both the cases Clear the Higher Nibble of AL.
AAS
MOV AX, 02FFh ; AH = 02, AL = 0FFh AAS ; AH = 01, AL = 09 RET