
Instruction Set
4-3
AAA
AAA
Examples
This example adds two unpacked decimal numbers.
Tips
To convert an unpacked decimal digit to its ASCII equivalent, use OR after AAA to add 30h
(ASCII 0) to the digit.
ADC, ADD, SBB, and SUB set AF when the result needs to be converted for decimal
arithmetic. AAA, AAS, DAA, and DAS use AF to determine whether an adjustment is
needed. This is the only use for AF.
Related Instructions
If you want to
See
Add two numbers and the value of CF
ADC
Add two numbers
ADD
Convert an 8-bit unsigned binary sum to its packed decimal equivalent
DAA
UADDEND1
DB
05h
; 5 unpacked BCD
UADDEND2
DB
07h
; 7 unpacked BCD
; add unpacked decimal numbers
XOR
AX,AX
; clear AX
MOV
AL,UADDEND1
; AL = 05h = 5 unpacked BCD
ADD
AL,UADDEND2
; AX = 000Ch = 12
AAA
; AX = 0102h = 12 unpacked BCD
; the AF and CF flags will be set, indicating the carry into AH
Summary of Contents for Am186 Series
Page 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Page 10: ...Table of Contents x...
Page 18: ...Programming 1 8...
Page 40: ...Instruction Set Listing 3 14...