IDIV Division, Signed Flags: O D I T S Z A P C ? - - - ? ? ? ? ? IDIV source
Logic AL ← AX / source AH ← remainder or AX ← DX:AX / source DX ← remainder or EAX ← EDX:EAX / source ; 386+ EDX ← remainder
IDIV performs a signed division. The dividend, quotient, and remainder are implicitly allocated to fixed registers, while only the divisor is given as an explicit operand. The type of the divisor determines which registers are used. Non-integral quotients are truncated toward zero. The remainder has the same sign as the dividend.
Note If the resulting quotient is too large to fit in the destination, or if the divisor is zero, an interrupt 0 (divide by zero) is generated. If a divide-by-zero occurs, the quotient and remainder are undefined.