div

8086 and later

Unsigned Divide

div r/m8 | div r/m16 | div r/m32 | div r/m64

DIV performs unsigned integer division. The explicit operand provided is the divisor; the dividend and destination operands are implicit, in the following way:

  • For DIV r/m8, AX is divided by the given operand; the quotient is stored in AL and the remainder in AH.

  • For DIV r/m16, DX:AX is divided by the given operand; the quotient is stored in AX and the remainder in DX.

  • For DIV r/m32, EDX:EAX is divided by the given operand; the quotient is stored in EAX and the remainder in EDX.

Signed integer division is performed by the IDIV instruction: see IDIV.

Loading...

Forms

Every form of div the assembler accepts, from NASM's own instruction table. The second column is the processor that introduced the form; a badge marks a form that needs an extension, that is lockable, or that long mode dropped.

FormSinceNotes
div r/m88086long
div r/m168086long
div r/m32386long
div r/m64x86-64long