; ; divide.sh ; ; Various routines of a division-related nature (MDW/TMA) ; ; © 1994 Straylight ; ;----- Overview ------------------------------------------------------------- ; ; Functions provided: ; ; divide ; div_unsigned [ :LNOT::DEF:divide__dfn GBLL divide__dfn ; --- divide --- ; ; On entry: R0 == dividend ; R1 == divisor ; ; On exit: R0 == quotient ; R1 == remainder ; ; Use: A standard divide routine. Fairly speedy, hopefully. ; The results are always such that ; ; |quotient| <= |(divisor/dividend)|, ; ; |remainder| < |divisor| ; ; and ; ; quotient * divisor + remainder == dividend IMPORT divide ; --- div_unsigned --- ; ; On entry: R0 == dividend ; R1 == divisor ; ; On exit: R0 == quotient ; R1 == remainder ; ; Use: As for divide, except that it considers its operands to be ; unsigned. IMPORT div_unsigned ] ;----- That's all, folks ---------------------------------------------------- END