On 25 Jan 2008 at 12:00, cctalk-request at
classiccmp.org wrote:
I figure that one might do part of the multiplication
and then
right shift the result some since were are going to truncate the
LSBs anyway. The first result is expected to error some. With
the correct value for the multiply, the error will always be on
the low side, keeping the error calculation simple. The largest
error seems to grow linearly so even with some truncation,
one should be able to hit 10K or so with only 1 or2 conditionals,
using a large fractional munber to multiply.
I don't think I'd ever use this but it was fun to think about.
I suspected that this is what you might be doing (that ADD HL,H
really had me wondering), but I wonder if your method will hold
together for accuracy or be faster than a simple unrolled 10 bit
divide. Remember that without the need for an iteration test you
can use BC to hold the scaled +10 and use a DAD instead of an SBC,
shaving a byte from the loop.
Cheers,
Chuck