Hello MORB
On 04-Aug-00, you wrote:
> Hi,
>
> for my current vmu project, I need to divide a 24 bits number by a 16
> bits number (otherwise, it's too imprecise and gives crapy results), and
> I wonder how to do this by using the DIV instruction (which divides a 16
> bits number by a 8 bits number)...
>
> I figured easily how to do multiplications of 16 bits (or more) values,
> because I remember how to do a multiplication by hand, but I can't
> remember at all how division works :(
>
> If somebody could help...
Here's my memory of long division (using decimals)
...
820 / 37 = 22.162 (.162 recurring)
-----------------------------------
2 .
37 | 820.
--
82 / 37 = 2 (Rem 8)
22.
37 | 828.0
- -
80 / 37 = 2 (Rem 6)
22.1
37 | 828.60
--
60 / 37 = 1 (Rem 23)
22.16
37 | 828.6230
--- [since 23 < 37, use 230 instead]
230 / 37 = 6 (rem 8)
..etc
I have no idea if this will be of any help to you, but as you said you
managed to program long multiplication since you remembered how to do it
manually, then maybe it will be useful
--
_ Richard Munn RAMTronics Software
// www : http://come.to/ramtronics
\X/ email : richard.munn@...
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com