Instruction Set
4-7
AAM
AAM
This example uses AAM to divide an unsigned binary number by 10. (The binary number
must be 99 or less.) Note that the quotient occupies the high byte of the result, and the
remainder occupies the low byte of the result. If you use DIV to divide an unsigned number
by 10, the quotient and remainder occupy the opposite halves of the result.
Tips
The microcontroller can only multiply unpacked decimal numbers. To multiply packed
decimal numbers, unpack them first.
To convert an unpacked decimal digit to its ASCII equivalent, use OR after AAM to add
30h (ASCII 0) to the digit.
Related Instructions
If you want to
See
Multiply two unsigned numbers
MUL
UBINARY
DB
44h
; 68
; divide unsigned binary number by 10
MOV
AL,UBINARY
; AL = 44h = 68
AAM
; AH = 06h = 6, the quotient
; AL = 08h = 8, the remainder
Содержание Am186 Series
Страница 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Страница 10: ...Table of Contents x...
Страница 18: ...Programming 1 8...
Страница 40: ...Instruction Set Listing 3 14...