Does any one have any "cos" or "sin" functions? Or any math functions that arent already in the assembly language?
Printable View
Does any one have any "cos" or "sin" functions? Or any math functions that arent already in the assembly language?
yes, there are some floating point function in assembly, like "fcos" and "fsin" and a lot of stuff...
Mind telling me how to use them?
in masm32, for example (dunno if the "qword ptr"s are needed)
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)Code:.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