You are here : assembly8086AAA

AAA - 8086

ASCII Adjust after Addition.

Corrects result in AH and AL after addition 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


Syntax

AAA


Example

MOV AX, 15   ; AH = 00, AL = 0Fh 
AAA          ; AH = 01, AL = 05 
RET 


Output / Return Value


Limitations


Alternatives / See Also


Reference

http://www.gabrielececchetti.it/Teaching/CalcolatoriElettronici/Docs/i8086_instruction_set.pdf