![](/images/new-backgrounds/1290705/290705215x1.webp)
DIV
DIVIDEDIV
Operation:
(temp) - (NUMR)
if (temp) I (DIVR) >MAX then the following, in sequence (QUO), (REM) undefined
(SP) - (SP) - 2
((SP) +1:(SP)) - FLAGS
(IF) - 0
(TF)
(SP) - (SP) - 2
((SP) +1:(SP)) - (CS)
(CS) - (2) i.e., the contents of memory locations 2 and 3
(SP) - (SP) - 2 ((SP) + 1:(SP)) - (IP)
(IP) - (0) i.e., the contents of locations 0 and 1
else
(QUO) - (temp) I (DIVR), where I is unsigned division
(REM) - (temp) % (DIVR) where
%is unsigned modulo
Flags Affected:
AF, CF, OF, PF, SF, ZF undefined
Description:
DIV source
DIV (divide) performs an unsigned division of the accumulator (and its extension) by the source operand. If the source operand is a byte, it is divided into the
remainder is returned in DX. If the quotient exceeds the capacity of its destination register (FFH for byte source, FFFFH for word source); as when division by zero is attempted, a type 0 interrupt is generated, and the quotient and remainder are undefined. Nonin- tegral quotients are truncated to integers. The content of AF, CF, OF, PF, SF and ZF is un- defined following execution of DIV.