lesmem@ark.UUCP (Marco Lesmeister) (12/03/85)
Could anyone out there help me? I am trying to figure out how the floating point-accumulator of the commodore-64 works, but I can't seem to work it out. My question is this: Suppose I want to calculate the sinus of some random number. - Where should I put this number? - How should I call the sinus subroutine (Which address should I call?) - Where can I get the result from? All this in machine language of course. I hope someone can help me, because I'm getting tired of searching through pages of disassemblies and manuals. Thanks in advance, Marco Lesmeister, --- ...!mcvax!vu44!botter!ark!lesmem Vrije Universiteit (Free University), Amsterdam, The Netherlands
wanttaja@ssc-vax.UUCP (Ronald J Wanttaja) (12/07/85)
> Could anyone out there help me? > > I am trying to figure out how the floating point-accumulator > of the commodore-64 works, but I can't seem to work it out. > > My question is this: > Suppose I want to calculate the sinus of some > random number. > - Where should I put this number? > - How should I call the sinus subroutine > (Which address should I call?) > - Where can I get the result from? > > All this in machine language of course. > > I hope someone can help me, because I'm getting tired of > searching through pages of disassemblies and manuals. 'tis the age-old story... I tried to mail this, and it came back, so: To tell the truth, if it's trig functions you're after, don't fight the floating point accumulator or use the basic subroutine. It's faster and easier to write a lookup table. For instance, I've got a routine that takes two two-byte values (X and Y), divides them, and uses a lookup table for getting the arctan. This routine uses a 256 degree circle instead of a 360 degree, but you could multiply the output by 360/256. The routine, with the lookup tables, takes less than 800 bytes, and is very fast. My assembly routine is too long to send, but you get the general idea... Ron W. (ssc-vax!wanttaja)
sinclair@aero.ARPA (William S. Sinclair) (12/11/85)
Dear ron; Unless you address the accuracy requirement, you are misleading him. Your table lookup method would give only a couple of places accuracy. He might need the full 8 places in his application. Bill S. Go ahead and flame! I brought marshmallows!! 213/647-1753