KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q30644: Trapping FP Execptions with In-Line 8087 Code

Article: Q30644
Product(s): See article
Version(s): 5.00 5.10 | 5.10
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | docerr | mspl13_c
Last Modified: 27-OCT-1988

Problem:

I am following the instructions on Pages 167-68 of the "Microsoft C
Optimizing Compiler User's Guide" to generate true in-line 8087 code.
I can link a module to remove the fixups for the interrupts, but I can
no longer handle floating-point exceptions using the signal function.

Response:

This is a documentation error. To trap floating-point exceptions with
the signal function while having true in-line 8087 code, you need to
add the following instructions to your FIXUP.ASM module:

           extrn __fpmath:far
           extrn __fptaskdata:far
           extrn __fpsignal:far

           CDATA   segment word common 'DATA'
                   dw      0
                   dd      __fpmath
                   dd      __fptaskdata
                   dd      __fpsignal
           CDATA   ends

Without the previous code, the start-up code will not initialize
the emulator and the signal function returns an error when you attempt
to use signal to trap floating-point exceptions.

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.