home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / t_power / emul87.doc < prev    next >
Encoding:
Text File  |  1988-02-02  |  3.4 KB  |  76 lines

  1. EMUL87 -- An 8087 Emulator for Turbo Pascal
  2.  
  3. Written by Martin Weigel 12/87
  4.            Compuserve [76237,733]
  5.  
  6. EMUL87 is a terminate but stay resident program that emulates the functionality
  7. of the 8087 math coprocessor for Turbo Pascal programs. It requires an 80286
  8. or 80386 processor to operate. Using the EMUL87 programs allows the fastest
  9. possible floating point math on machines with the math coprocessor, while
  10. still allowing program operation on most common hardware (AT, no 287). You
  11. can use inline 8087 instructions, without worrying!
  12.  
  13. The only major limitation is that older PCs and XTs (8088, 8086 and 186 based
  14. machines) will HAVE to aquire a math coprocessor to run your software.
  15.  
  16. A more minor limitation is that the Floating Point Emulator is based on
  17. Borlands Turbo C floating point emulator, and the emulation is NOT COMPLETE.
  18. This means that EMUL87 cannot be used as a generic 87 eliminator. The missing
  19. instructions are FINCSTP, FDECSTP, FFREE and floating stack wraparound.
  20. The only program that I have had a problem with is the D86 debugger (part of
  21. the A86 assembler package; everything works, but the 87 register display
  22. does not come up properly).
  23.  
  24. Also, EMUL87 will not "fool" any program that is deliberately looking for
  25. a 80287 chip. The '87 code will have to be generic 8087 to be successfully
  26. emulated.
  27.  
  28. I tried wrapping the emulator into a Turbo Pascal 4 Unit, but with segment
  29. naming problems, etc, it was going to be far too difficult to accomplish
  30. in any meaningful time frame, so I settled for keeping a TSR implementation.
  31.  
  32. There are three programs in this package:
  33.  
  34.     EMUL87      The 87 emulator itself. If the processor is not a 286 or
  35.                 386, it will refuse to go resident. If a 287 or 387 is
  36.                 present, it will refuse to go resident. If the word
  37.                 "force" is put on the command line, it will override
  38.                 the 287/387 detection and force EMUL87 resident. EMUL87
  39.                 takes 14K of memory.
  40.  
  41.     EMON        Turn EMUL87 on (if it is in memory)
  42.  
  43.     EMOFF       Turn EMUL87 off (if it is in memory)
  44.  
  45.  
  46. Typical use of the EMUL87 package is in a batch file:
  47.  
  48.     EMUL87                    -- load the emulator
  49.     EMON                      -- enable it
  50.     ...myapplication...       -- run the 87 code
  51.     EMOFF                     -- turn the emulator off
  52.  
  53. There is currently no way to remove EMUL87 from memory, nor am I likely to
  54. provide one. It does contain a check to prevent from being multiply loaded.
  55.  
  56. Hints:
  57.  
  58.     The force option is useful to test programs with 87 emulation, even if
  59.     you have the chip. Its easier than removing the chip!
  60.  
  61.     EMUL87 works with Turbo Pascal 3 (8087 version), Turbo Pascal 4 with
  62.     {$N+} compilation and Turbo C. The popular TCDEBUG program benefits
  63.     because it is incapable of de-assembling emulator opcodes!
  64.  
  65. Bugs:
  66.  
  67.     Watch out for Ctrl-Alt-Del! If the emulator is enabled, ALL floating
  68.     point instructions are going to be trapped. Ctrl-Alt-Del Warm Start
  69.     routine DOES NOT clear the instruction trapping! In order to be safe,
  70.     EMOFF should be put into your AUTOEXEC.BAT file, BEFORE any programs
  71.     are actually run.
  72.  
  73.     If a program (like the popular ARC program) tries to detect the
  74.     presence of an '87 chip, and EMUL87 is not loaded to catch the instruction,
  75.     your machine WILL end up in hyperspace.
  76.