🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #23050

Re: Looking for software implementation of integer div, rem, mod

#23050
From: ddunfield on BIX
Date: Sun, 22 Oct 1995 00:00
26 lines
1966 bytes
lehotsky@mc.com (Alan Lehotsky) writes:

>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.

----------------------------------------------------------------------
Dave Dunfield (ddunfield@bix.com)    Embedded system development tools
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]
-- 
Send compilers articles to compilers@iecc.com,
meta-mail to compilers-request@iecc.com.
Technical Details
Message-ID: <95-10-102@comp.compilers>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <95-10-074@comp.compilers>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,ea9fc146354444c7,start
X-Google-Attributes: gid11318c,public
X-Google-Thread: 102b75,ea9fc146354444c7,start
X-Google-Attributes: gid102b75,public
X-Google-Thread: ff499,ea9fc146354444c7,start
X-Google-Attributes: gidff499,public
From: ddunfield@BIX.com (ddunfield on BIX)
Subject: Re: Looking for software implementation of integer div, rem, mod
Date: 1995/10/22
Message-ID: <95-10-102@comp.compilers>
X-Deja-AN: 117941587
approved: compilers@chico.iecc.com
sender: compilers-sender@chico.iecc.com
references: <95-10-074@comp.compilers>
organization: Delphi Internet Services Corporation
keywords: arithmetic, comment
newsgroups: comp.arch,comp.compilers,gnu.gcc.help