Integer Multiply/Divide on Sparc
Wm E Davidsen Jr
davidsen at crdos1.crd.ge.COM
Thu Jan 25 03:30:14 AEST 1990
Actually memory is cheap enough to use 64k for a lookup table. Make a
16 bit address from the two bytes to multiply as
0 78 15
|_______|______|
| byte1 | byte2|
|_______|______|
and just pull the answer out of memory.
Actually, the Intel practice of treating a 32 bit register as lots of
little registers, with the 8 and 16 bit portions addressible by name,
would be handy for some of this stuff, eliminating a shift. It should
still be quite fast.
--
bill davidsen (davidsen at crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
"Stupidity, like virtue, is its own reward" -me
More information about the Comp.lang.c
mailing list