The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => 16 bit DOS Programming => Topic started by: paragasu on September 13, 2006, 08:39:05 AM

Title: help degree to sin, cos, tan?
Post by: paragasu on September 13, 2006, 08:39:05 AM
anyone can can help me? i got an assigment to make a program in asm. the program will ask the user input in degree
and then display the value in sin, cos, tan. I really don't have idea how to make it work.
i know, first  i have to convert the value into radian,..
and using FPU instruction like FSINCOS, FPTAN, FCOS..
i don't have any idea how it works. can somebody help me?
Title: Re: help degree to sin, cos, tan?
Post by: sw337 on September 13, 2006, 09:58:25 AM
hi paragasu !

radians = degrees*PI / 180.0

Did that help ?
Title: Re: help degree to sin, cos, tan?
Post by: Tedd on September 13, 2006, 11:16:02 AM
Look up the following instructions.. :wink
- finit
- fild/fld
- fistp/fstp
- fmul/fdiv
- fsin/fcos/fptan

And of course, you'll need to figure out how to get the user's input.
Title: Re: help degree to sin, cos, tan?
Post by: raymond on September 14, 2006, 01:45:47 AM
Homework means STUDY.
Have a look at the following:

http://www.ray.masmcode.com/fpu.html