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-7-bit X-Google-Thread: 103376,95a7ce6b0163274c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-05-08 00:44:47 PST Path: newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!212.54.64.131!news100.image.dk!cass.news.pipex.net!pipex!warm.news.pipex.net!pipex!news.kvaerner.com!news@kvaerner.com From: "Tarjei T. Jensen" Newsgroups: comp.lang.ada Subject: Re: implementing software unsigned divide Date: Tue, 8 May 2001 09:44:31 +0200 Organization: Kvaerner Group IT Message-ID: <9d8854$oll16@news.kvaerner.com> References: NNTP-Posting-Host: 155.209.159.96 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Newsreader: Microsoft Outlook Express 4.72.2120.0 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2120.0 Xref: newsfeed.google.com comp.lang.ada:7313 Date: 2001-05-08T09:44:31+02:00 List-Id: Stephen Leake wrote in message ... >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. Why not do it the way you did at school? There is nothing special about binary numbers. You can have a look at old books on assembly programming. Some of them implemented extended arithmetic. Some even did floating point. The worst that could happen is that you have to scale from a 8 bit to a 16 bit machine. Greetings,