◄Map► ◄Up► ◄Contents► ◄Index► ◄Back► ──────────────────────────────────────────────────────────────────────────── ;* DivLong - Divides an unsigned long integer by an unsigned short integer. ;* The procedure does not check for overflow or divide-by-zero. ;* ;* Shows: Instruction - div ;* ;* Params: Long1 - First integer (dividend) ;* Short2 - Second integer (divisor) ;* Remn - Pointer to remainder ;* ;* Return: Quotient as short integer DivLong PROC USES di, Long1:DWORD, Short2:WORD, Remn:PWORD mov ax, WORD PTR Long1[0] ; AX = low word of dividend mov dx, WORD PTR Long1[2] ; DX = high word of dividend div Short2 ; Divide by short integer LoadPtr es, di, Remn ; Point ES:DI to remainder mov es:[di], dx ; Copy remainder ret ; Return with AX = quotient DivLong ENDP -♦-