X86-assembly/Instructions/idiv

From aldeid
Jump to navigation Jump to search
You are here:
idiv

Description

  • The idiv instruction divides the contents of the 64-bit integer EDX:EAX by the specified operand value.
  • The quotient result of the division is stored into EAX
  • The remainder is placed in EDX.

Syntax

idiv <reg32>
idiv <mem>

Examples

idiv ebx              ; EDX:EAX / EBX. Quotient saved to EAX, remainder in EDX
idiv DWORD PTR [var]  ; EDX:EAX / 32-bit value stored at memory location var. Quotient in EAX, remainder in EDX

Comments