Compaq 386 Floating Point Error

Product Version(s): 4.00
Operating System:   MS-DOS
Flags: ENDUSER |
Last Modified:  4-MAR-1988    ArticleIdent: Q19948

Problem:
   When running in real mode and using a 80287, a floating
point exception occurs (such as divide by zero) and the CX
register is destroyed.

Response:
   The problem can occur with any product that accesses the
80287 directly. Compaq is aware of the problem and has a
solution available. If you are having such a problem,
contact the Compaq hotline directly for more information.
   In FORTRAN, the problem may show itself by a program
hanging in an infinite loop or (even worse) having loops
terminate early. If you are using FORTRAN Version 4.0, you
may be able to avert the problem by recompiling to disable
loop optimization (either -Od or -Odct).
   Note that if you try to demonstrate this problem with
CodeView, you cannot simply go to the offending instruction
and then single step; you will not see the problem. You
must set a breakpoint several instructions past the "bad"
instruction.
   If you are using FORTRAN or C, you can determine if they
have the problem by one of two methods:

   1. Re-compile with -FPa compiler option. If doing this
action allows your program to run, contact COMPAQ.
   2. Mask (disable) the floating point exceptions. This is
not the solution of choice since there are certain
exceptions (denormal and invalid) that you are not
permitted to mask.