AAA, czyli ASCII
adjust after addition, oraz
DAA decimal adjust for addition - są instrukcjami wsparcia dla BCD. Zazwyczaj instrukcje AAA stosuje się po add, adc, xadd.
AAA ASCII Adjust after Addition; Intel 80x86; changes the contents of register AL to a valid unpacked decimal number, and zeros the top 4 bits; sets or clears flags
Kod:
if ( (al and 0Fh) > 9 or (AuxC =1) ) then
if (8088 or 8086) then
al := al + 6
else
ax := ax + 6
endif
ah := ah + 1
AuxC := 1 ;Set auxilliary carry
Carry := 1 ; and carry flags.
else
AuxC := 0 ;Clear auxilliary carry
Carry := 0 ; and carry flags.
endif
al := al and 0Fh
Działa to używając tego algorytmu.
// jeśli chcesz przykład to pisz