home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / turbopas / tpl60n19.zip / MATH.PAS < prev    next >
Pascal/Delphi Source File  |  1992-05-01  |  2KB  |  66 lines

  1. { Unit Math makes some undocumented, but fully functional routines of the
  2.   coprocessor/emulator floating point package available to the user. These
  3.   functions are *not* available for REAL arithmetic in $N- mode.
  4.  
  5.   Copyright (c) 1990-1992 Norbert Juffa                                   }
  6.  
  7.  
  8.  
  9. {$N+,E+}
  10.  
  11. UNIT Math;
  12.  
  13.  
  14. INTERFACE
  15.  
  16. FUNCTION Tan (X: EXTENDED): EXTENDED;
  17.  
  18. FUNCTION Log (X: EXTENDED): EXTENDED;
  19.  
  20. FUNCTION Ld  (X: EXTENDED): EXTENDED;
  21.  
  22. FUNCTION PowerOfTen (X: EXTENDED): EXTENDED;
  23.  
  24. FUNCTION PowerOfTwo (X: EXTENDED): EXTENDED;
  25.  
  26.  
  27. IMPLEMENTATION
  28.  
  29. FUNCTION Tan (X: EXTENDED): EXTENDED; ASSEMBLER;
  30. ASM
  31.    FLD   TBYTE PTR [X]    { get argument }
  32.    INT   3Eh              { call shortcut interrupt }
  33.    DW    90F0h            { signal Tan wanted to shortcut handler }
  34. END;
  35.  
  36. FUNCTION Log (X: EXTENDED): EXTENDED; ASSEMBLER;
  37. ASM
  38.    FLD   TBYTE PTR [X]    { get argument }
  39.    INT   3Eh              { call shortcut interrupt }
  40.    DW    90F8h            { signal Log10 wanted to shortcut handler }
  41. END;
  42.  
  43. FUNCTION Ld  (X: EXTENDED): EXTENDED; ASSEMBLER;
  44. ASM
  45.    FLD   TBYTE PTR [X]    { get argument }
  46.    INT   3Eh              { call shortcut interrupt }
  47.    DW    90F6h            { signal Log2 wanted to shortcut handler }
  48. END;
  49.  
  50. FUNCTION PowerOfTen (X: EXTENDED): EXTENDED; ASSEMBLER;
  51. ASM
  52.    FLD   TBYTE PTR [X]    { get argument }
  53.    INT   3Eh              { call shortcut interrupt }
  54.    DW    90FEh            { signal Power of 10 wanted to shortcut handler}
  55. END;
  56.  
  57. FUNCTION PowerOfTwo (X: EXTENDED): EXTENDED; ASSEMBLER;
  58. ASM
  59.    FLD   TBYTE PTR [X]    { get argument }
  60.    INT   3Eh              { call shortcut interrupt }
  61.    DW    90FCh            { signal Power of 2 wanted to shortcut handler }
  62. END;
  63.  
  64.  
  65. END. { Math }
  66.