From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,95a7ce6b0163274c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-05-07 23:04:05 PST Path: newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!195.158.233.21!news1.ebone.net!news.ebone.net!newsfeeds.net.uni-c.dk!news.net.uni-c.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: implementing software unsigned divide Date: Tue, 08 May 2001 08:04:05 +0200 Organization: Centre for Chaos and Turbulence Studies, Niels Bohr Institute Message-ID: <3AF78C54.DEA3DAB2@nbi.dk> References: NNTP-Posting-Host: alf.nbi.dk Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.net.uni-c.dk 989301845 25780 130.225.212.55 (8 May 2001 06:04:05 GMT) X-Complaints-To: usenet@news.net.uni-c.dk NNTP-Posting-Date: Tue, 8 May 2001 06:04:05 +0000 (UTC) X-Mailer: Mozilla 4.77 [en] (X11; U; OSF1 V4.0 alpha) X-Accept-Language: fo,da,no,sv,is,de,fr,en Xref: newsfeed.google.com comp.lang.ada:7308 Date: 2001-05-08T08:04:05+02:00 List-Id: Stephen: > I'm porting GNAT to a 16 bit microprocessor that does not provide a > hardware instruction for unsigned divide (it has multiply and signed > divide, both 16 and 32 bit). Can anyone provide a reference to a book > that discusses how to do this, and/or an algorithm that does it? I've > looked in Knuth, and did an initial web search, and haven't found > anything. I have heard that there exists a free (Open Source) library for doing calculations with very long integers. I suppose that you could find something useful there. A "cheap" solution could be to limit unsigned integers to the range 0 .. 2**31-1, but I am not sure this is allowed by the LRM. Jacob -- "... det er ul�kkert, at man selektivt vil t�mme ulande/�steuropa for velkvalificerede mennesker." Christian Mikkelsen