1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML 2.0//EN">
4 <TITLE>80386 Programmer's Reference Manual -- Opcode DIV
</TITLE>
7 <B>up:
</B> <A HREF=
"c17.htm">
8 Chapter
17 --
80386 Instruction Set
</A><BR>
9 <B>prev:
</B><A HREF=
"DEC.htm"> DEC Decrement by
1</A><BR>
10 <B>next:
</B><A HREF=
"ENTER.htm"> ENTER Make Stack Frame for Procedure Parameters
</A>
14 <H1>DIV -- Unsigned Divide
</H1>
17 Opcode Instruction Clocks Description
19 F6 /
6 DIV AL,r/m8
14/
17 Unsigned divide AX by r/m byte
21 F7 /
6 DIV AX,r/m16
22/
25 Unsigned divide DX:AX by r/m
23 F7 /
6 DIV EAX,r/m32
38/
41 Unsigned divide EDX:EAX by r/m
24 dword (EAX=Quo, EDX=Rem)
30 temp := dividend / divisor;
31 IF temp does not fit in quotient
35 remainder := dividend MOD (r/m);
41 Divisions are unsigned. The divisor is given by the r/m operand.
42 The dividend, quotient, and remainder use implicit registers. Refer to
43 the table under
"Description"
48 DIV performs an unsigned division. The dividend is implicit; only the
49 divisor is given as an operand. The remainder is always less than the
50 divisor. The type of the divisor determines which registers to use as
54 Size Dividend Divisor Quotient Remainder
56 word DX:AX r/m16 AX DX
57 dword EDX:EAX r/m32 EAX EDX
60 <H2>Flags Affected
</H2>
62 OF, SF, ZF, AR, PF, CF are undefined.
64 <H2>Protected Mode Exceptions
</H2>
66 Interrupt
0 if the quotient is too large to fit in the designated register
67 (AL, AX, or EAX), or if the divisor is
0; #GP(
0) for an illegal memory
68 operand effective address in the CS, DS, ES, FS, or GS segments; #SS(
0)
69 for an illegal address in the SS segment; #PF(fault-code) for a page fault
71 <H2>Real Address Mode Exceptions
</H2>
73 Interrupt
0 if the quotient is too big to fit in the designated register
74 (AL, AX, or EAX), or if the divisor is
0; Interrupt
13 if any part of the
75 operand would lie outside of the effective address space from
0 to
0FFFFH
77 <H2>Virtual
8086 Mode Exceptions
</H2>
79 Same exceptions as in Real Address Mode; #PF(fault-code) for a page
86 <B>up:
</B> <A HREF=
"c17.htm">
87 Chapter
17 --
80386 Instruction Set
</A><BR>
88 <B>prev:
</B><A HREF=
"DEC.htm"> DEC Decrement by
1</A><BR>
89 <B>next:
</B><A HREF=
"ENTER.htm"> ENTER Make Stack Frame for Procedure Parameters
</A>