emu387.tex 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. %
  2. % $Id$
  3. % This file is part of the FPC documentation.
  4. % Copyright (C) 1997, by Michael Van Canneyt
  5. %
  6. % The FPC documentation is free text; you can redistribute it and/or
  7. % modify it under the terms of the GNU Library General Public License as
  8. % published by the Free Software Foundation; either version 2 of the
  9. % License, or (at your option) any later version.
  10. %
  11. % The FPC Documentation is distributed in the hope that it will be useful,
  12. % but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. % Library General Public License for more details.
  15. %
  16. % You should have received a copy of the GNU Library General Public
  17. % License along with the FPC documentation; see the file COPYING.LIB. If not,
  18. % write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19. % Boston, MA 02111-1307, USA.
  20. %
  21. \chapter{The EMU387 unit}
  22. The \file{emu387} unit was written by Pierre M\"uller for \dos. It
  23. sets up the coprocessor emulation for FPC under \dos. It is not necessary to
  24. use this unit on other OS platforms because they either simply do not run on
  25. a machine without coprocessor, or they provide the coprocessor emulation
  26. themselves.
  27. It shouldn't be necessary to use the function in this unit, it should be
  28. enough to place this unit in the \var{uses} clause of your program to
  29. enable the coprocessor emulation under \dos. The unit initialization
  30. code will try and load the coprocessor emulation code and initialize it.
  31. \section{Functions and procedures}
  32. \begin{function}{npxsetup}
  33. \Declaration
  34. procedure npxsetup(prog\_name : string);
  35. \Description
  36. \var{npxsetup} checks whether a coprocessor is found. If not, it loads the
  37. file \file{wmemu387.dxe} into memory and initializes the code in it.
  38. If the environment variable \var{387} is set to \var{N}, then the emulation
  39. will be loaded, even if there is a coprocessor present. If the variable
  40. doesn't exist, or is set to any other value, the unit will try to detect
  41. the presence of a coprocessor unit.
  42. The function searches the file \file{wmemu387.dxe} in the following way:
  43. \begin{enumerate}
  44. \item If the environment variable \var{EMU387} is set, then it is assumed
  45. to point at the \file{wmemu387.dxe} file.
  46. \item if the environment variable \var{EMU387} does not exist, then the
  47. function will take the path part of \var{prog\_name} and look in that
  48. directory for the file \file{wmemu387.dxe}.
  49. \end{enumerate}
  50. It should never be necessary to call this function, because the
  51. initialization code of the unit contains a call to the function with
  52. as an argument \var{paramstr(0)}. This means that you should deliver the
  53. file \var{wmemu387.dxe} together with your program.
  54. \Errors
  55. If there is an error, an error message is printed to standard error, and
  56. the program is halted, since any floating-point code is bound to fail anyhow.
  57. \end{function}