PDA

Click to See Complete Forum and Search --> : Cos, Sin


ChimpFace9000
Jun 18th, 2001, 05:56 PM
Does any one have any "cos" or "sin" functions? Or any math functions that arent already in the assembly language?

devmax
Jun 23rd, 2001, 10:02 PM
yes, there are some floating point function in assembly, like "fcos" and "fsin" and a lot of stuff...

ChimpFace9000
Jun 24th, 2001, 01:17 AM
Mind telling me how to use them?

Jimbob42
Jun 24th, 2001, 01:54 AM
in masm32, for example (dunno if the "qword ptr"s are needed)


.data
theta dq 1.2345
sin dq ?
cos dq ?

.code
fld qword ptr theta ;floating point load
fsincos ;i think that sine is in st(0)
fstp qword ptr sin ;store and pop sin
fstp qword ptr cos ;store and pop cos

there's a heap of other stuff, the documentation for a86 has just about all the opcodes and floating point opcodes (I'm not sure about asin or acos though)