Using Division Instructions:

The DIV instruction divides unsigned numbers, and IDIV divides
signed numbers. Both return a quotient and a remainder.
Table 4.1 summarizes the division operations. The dividend
is the number to be divided, and the divisor is the number to
divide by. The quotient is the result. The divisor can be in any
register or memory location but cannot be an immediate value.

Size of Operand

Dividend Register

Size of Divisor

Quotient

Remainder

16 bits

AX

8 bits

AL

AH

32 bits

DX:AX

16 bits

AX

DX

64 bits (80386and 80486)

EDX:EAX

32 bits

EAX

EDX

Table: Division Operations

Unsigned division does not require careful attention to flags.
The following examples illustrate signed division, which can be more complex.

If the dividend and divisor are the same size, sign-extend or
zero-extend the dividend so that it is the length expected by
the division instruction. See “Extending Signed and Unsigned
Integers,” later in this unit.