Looking for software implementation of integer div, rem, mod

Looking for software implementation of integer div, rem, mod

Post by ddunfield on B » Mon, 23 Oct 1995 04:00:00




>I'm looking for a software implementation of 32/32 divide, with and
>without remainder and modulus.
>C code is preferred.  An implementation that uses only
>shifts, adds (and/or multiplies) would be ideal.  The chip I'm working
>with has no divide assists (except for single-precision float, where
>it has the ability to compute an inverse).
>I already checked the math software archives at netlib, et al.

Look for BIGNUM.ZIP, it's on my BBS (see below), and possibly on
SIMTEL, or connectn.acs.niu.edu /dunfield directory. It contains C
source showing how to do multi-byte arithmetic using only shifts,
adds and subtracts. Should be exactly what you are looking for.

----------------------------------------------------------------------

Dunfield Development Systems  Box 31044  Nepean Ontario Canada K2B 8S8
Tel: 613-256-5820   Fax: 613-256-5821   BBS(v32/v42/HST): 613-256-6289
[Archie didn't turn that up, but did find a bunch of bignum handling code
at ripem.msu.edu. -John]
--