DIV—Unsigned DivideInstruction Operand EncodingDescriptionDivides unsigned the value in the AX, DX:AX, EDX:EAX, or RDX:RAX registers (dividend) by the source operand (divisor) and stores the result in the AX (AH:AL), DX:AX, EDX:EAX, or RDX:RAX registers. The source operand can be a general-purpose register or a memory location. The action of this instruction depends on the operand size (dividend/divisor). Division using 64-bit operand is available only in 64-bit mode.Non-integral results are truncated (chopped) towards 0. The remainder is always less than the divisor in magni-tude. Overflow is indicated with the #DE (divide error) exception rather than with the CF flag.In 64-bit mode, the instruction’s default operation size is 32 bits. Use of the REX.R prefix permits access to addi-tional registers (R8-R15). Use of the REX.W prefix promotes operation to 64 bits. In 64-bit mode when REX.W is applied, the instruction divides the unsigned value in RDX:RAX by the source operand and stores the quotient in RAX, the remainder in RDX. See the summary chart at the beginning of this section for encoding data and limits. See Table 3-15.OpcodeInstructionOp/ En64-Bit ModeCompat/Leg ModeDescriptionF6 /6DIV r/m8MValidValidUnsigned divide AX by r/m8, with result stored in AL:= Quotient, AH:= Remainder.REX + F6 /6DIV r/m8*MValidN.E.Unsigned divide AX by r/m8, with result stored in AL:= Quotient, AH:= Remainder.F7 /6DIV r/m16MValidValidUnsigned divide DX:AX by r/m16, with result stored in AX:= Quotient, DX:= Remainder.F7 /6DIV r/m32MValidValidUnsigned divide EDX:EAX by r/m32, with result stored in EAX:= Quotient, EDX:= Remainder.REX.W + F7 /6DIV r/m64MValidN.E.Unsigned divide RDX:RAX by r/m64, with result stored in RAX:= Quotient, RDX:= Remainder.NOTES:*In 64-bit mode, r/m8 can not be encoded to access the following byte registers if a REX prefix is used: AH, BH, CH, DH.Op/EnOperand 1Operand 2Operand 3Operand 4MModRM:r/m (w)NANANATable 3-15. DIV Action Operand SizeDividendDivisorQuotientRemainderMaximum QuotientWord/byteAXr/m8ALAH255Doubleword/wordDX:AXr/m16AXDX65,535Quadword/doublewordEDX:EAXr/m32EAXEDX232− 1Doublequadword/quadwordRDX:RAXr/m64RAXRDX264− 1
This UNOFFICIAL reference was generated from the official Intel® 64 and IA-32 Architectures Software Developer’s Manual by a dumb script. There is no guarantee that some parts aren't mangled or broken and is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.