Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
1.6 KiB

  1. page ,132
  2. title 87trig - trigonometric functions - SIN, COS, TAN
  3. ;***
  4. ;87trig.asm - trigonometric functions - SIN, COS, TAN
  5. ;
  6. ; Copyright (c) 1984-2001, Microsoft Corporation. All rights reserved.
  7. ;
  8. ;Purpose:
  9. ; Support for SIN, COS, TAN
  10. ;
  11. ;Revision History:
  12. ;
  13. ; 11-06-91 GDP rewritten for 386
  14. ;
  15. ;*******************************************************************************
  16. .xlist
  17. include cruntime.inc
  18. include mrt386.inc
  19. include elem87.inc
  20. .list
  21. .data
  22. extrn _piby2:tbyte
  23. staticT _piby4, 03FFEC90FDAA22168C235R ; pi/4
  24. staticD _plossval, 04D000000R ; 2^27
  25. staticD _tlossval, 04F000000R ; 2^31
  26. CODESEG
  27. extrn _rtindfnpop:near
  28. extrn _rtonenpop:near
  29. extrn _rttosnpop:near
  30. extrn _rtinfnpopse:near
  31. extrn _rttosnpop:near
  32. extrn _rttosnpopde:near
  33. extrn _tosnan1:near
  34. ;----------------------------------------------------------
  35. ;
  36. ; FORWARD TRIGONOMETRIC FUNCTIONS
  37. ;
  38. ;----------------------------------------------------------
  39. ;
  40. ; INPUTS - The argument is the stack top.
  41. ; The sign of argument is the 04h bit of CL.
  42. ;
  43. ; OUTPUT - The result is the stack top.
  44. ;
  45. ;----------------------------------------------------------
  46. jmponC2 macro tag
  47. fstsw ax
  48. fwait
  49. sahf
  50. JSP tag
  51. endm
  52. labelNP _fFCOS, PUBLIC
  53. lab fFCOS
  54. fcos
  55. jmponC2 ArgTooLarge
  56. ret
  57. labelNP _fFSIN, PUBLIC
  58. lab fFSIN
  59. fsin
  60. jmponC2 ArgTooLarge
  61. ret
  62. lab fFTAN
  63. fptan
  64. fstsw ax
  65. fstp st(0) ; pop TOS (fptan pushed an extra value)
  66. sahf
  67. JSP ArgTooLarge
  68. ret
  69. lab ArgTooLarge
  70. mov DSF.ErrorType, TLOSS ; set TLOSS error
  71. jmp _rtindfnpop
  72. end