You are here : assembly8086AAS

AAS - 8086

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.


Syntax

AAS


Example

MOV AX, 02FFh	; AH = 02, AL = 0FFh
AAS		; AH = 01, AL = 09
RET


Output / Return Value


Limitations


Alternatives / See Also


Reference