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