home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
NOTEPAD2.ZIP
/
UTIL.ASM
< prev
Wrap
Assembly Source File
|
1989-02-08
|
628b
|
30 lines
include cmacros.inc
.MODEL SMALL
.286
.CODE
;-----------------------------------------------------------------------
;
; MultDivNR(a, b, c): calc a * b / c, with 32-bit intermediate result
;
; Same as MultDiv, except with no rounding.
;
cProc MultDivNR,<PUBLIC>
ParmW a
ParmW b
ParmW c
cBegin
mov ax,a ; calc (a * b) / c (no rounding)
mov cx,c
or cx,cx
jz mdnrexit ; just return A if we'll get divide by 0
imul b
idiv cx
mdnrexit:
cEnd
END