Re: A82: a division problem


[Prev][Next][Index][Thread]

Re: A82: a division problem



At 10:43 PM 10/1/97 -0400, you wrote:
>if I wanted to divide a number by 16 for the sprite routine that I am making
>I would go
>SLA b
>SLA b
>SLA b
>SLA b
>(I think)
>To find the remainder would I check the carry flag after each SLA and then
>combine that into a binary byte or something or would it just be easier to
>subtract the answer from the original or something. To help you understand
>what I am trying to say, I am making a sprite routine that will write a
>sprite directly into the display port. Since I like to understand the
>programs I use I generally write my own. This allows me to learn more about
>programing too. So to find what column the sprite is in I have to divide the
>x-pos (stored at b) by 16, then I have to move the sprite the remainder of
>the way to the left. To do this I need to find the remainder. Or would it be
>easier/faster to do 
First of all, shift left *multiplies*, secondly, ever heard of the Russian
Peasent's algorythom for multiplication of positive ints?  Supposedly it's
the best way to do multiplication on computers (for + ints).  E-mail me if
you want info on it.


Robert Glass  rglass@lab.Lander.edu  dash_squirrel@geocities.com
http://www.geocities.com/Yosemite/3542  http://iceweasel.home.ml.org

The SPC quote of the week:
Big Cheese offering suggestions on how to get rid of a dragon:
We could elect the dragon vice-president, that way we'd never hear from it
again.