Instruction Set
4-41
CWD
CWD
This example divides one 16-bit integer by another 16-bit integer.
Tips
If you want to divide a 16-bit integer (the dividend) by another 16-bit integer (the divisor):
use MOV to copy the dividend to AX, use CWD to convert the dividend into its 32-bit
equivalent, and then use IDIV to perform the division.
Related Instructions
If you want to
See
Convert an 8-bit integer to its 16-bit equivalent
CBW
Divide an integer by another integer
IDIV
SDIVIDEND
DW
-1675
; F975h
SDIVISOR
DW
200
; 00C8h
; divide word integers
MOV
AX,SDIVIDEND
; AX = F975h = -1675
CWD
; DX::AX = FFFFF975h = -1675
IDIV
SDIVISOR
; AX = FFF8h = -8, the quotient
; DX = FFB5h = -75, 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...