idiv

8086 and later

Signed Divide

idiv r/m8 | idiv r/m16 | idiv r/m32 | idiv r/m64

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

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

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

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

Unsigned integer division is performed by the DIV instruction: see DIV.

Loading...

Forms

Every form of idiv 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
idiv r/m88086long
idiv r/m168086long
idiv r/m32386long
idiv r/m64x86-64long