yeah, i've written multiplication and division using bit shifts and
subtraction. the problem is i wrote it a long time ago, in x86 assembly (in
fact i posted the source on the massena newsgroup several months ago). i
don't feel like translating it, or figuring it out again. :-) what can i
say, i can be lazy sometimes (at least when i'm writing freeware :-).
----- Original Message -----
From: Roger Chaplin <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, September 12, 1999 6:34 PM
Subject: Re: What's the best Currency Format?
> "Chris Antos" <[EMAIL PROTECTED]> wrote:
> > hm. i suppose i could do that. you have to be careful about division,
> > though. i'm not sure about 68k series, but the x86 series does 64 bit
> > division, but considers it an overflow if either the quotient or
remainder
> > exceeds 32bits (or maybe i'm even more dated than i realize - i'm going
by
> > the 386 reference, and maybe the Pentium has a way around this, i don't
> > know).
>
> The MC68000 (that's the CPU core at the heart of the MC68328) can do
> only 32-bit multiplication and division. (Actually, it can multiply two
> 16-bit numbers giving a 32-bit result, and divide a 32-bit by a 16-bit,
> giving 16-bit quotient and remainder.) Anything beyond that has to be
> handled by some kind of library routine.
>
> Writing a little routine to multiply two 32-bit values into a 64-bit
> intermediate product, then dividing by a 32-bit scale factor, is a
> technique I've used successfully on a couple of projects. I stole the
> idea from Forth's */ operator.
>
> --
> Roger Chaplin
> <[EMAIL PROTECTED]>
>