
Instruction Set
4-52
DIV
DIV
Tips
DIV requires the dividend to be twice the size of the divisor. To convert an 8-bit unsigned
dividend to its 16-bit equivalent (or a 16-bit dividend to its 32-bit equivalent), use MOV to
load the high half with 0.
If the unsigned dividend will fit in a 16-bit register and you don’t need the remainder, use
SHR to divide unsigned numbers by powers of 2. When dividing an unsigned number by
a power of 2, it is faster to use SHR than DIV.
The Am186 and Am188 microcontrollers do not provide an instruction that performs decimal
division. To divide a decimal number by another decimal number, use AAD to convert the
dividend to binary and then perform binary division using DIV.
Related Instructions
If you want to
See
Convert a two-digit unpacked decimal dividend to its unsigned binary equivalent AAD
Divide an integer by another integer
IDIV
Divide an unsigned number by a power of 2
SHR
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...