E-1
APPENDIX E
GUIDELINES FOR WRITING FPU
EXCEPTIONS HANDLERS
As described in Chapter 7, Floating-Point Unit, the Intel Architecture (IA) supports two mech-
anisms for accessing exception handlers to handle unmasked FPU exceptions: native mode and
MS-DOS compatibility mode. The primary purpose of this appendix is to provide detailed in-
formation to help software engineers design and write FPU exception-handling facilities to run
on PC systems that use the MS-DOS compatibility modeI for handling FPU exceptions. Some
of the information in this appendix will also be of interest to engineers who are writing native-
mode FPU exception handlers. The information provided is as follows:
Discussion of the origin of the MS-DOS* FPU exception handling mechanism and its
relationship to the FPUs native exception handling mechanism.
Description of the IA flags and processor pins that control the MS-DOS FPU exception
handling mechanism.
Description of the external hardware typically required to support MS-DOS exception
handling mechanism.
Description of the FPUs exception handling mechanism and the typical protocol for FPU
exception handlers.
Code examples that demonstrate various levels of FPU exception handlers.
Discussion of FPU considerations in multitasking environments.
Discussion of native mode FPU exception handling.
The information given is oriented toward the most recent generations of IA processors, starting
with the Intel486. It is intended to augment the reference information given in Chapter 7,
Floating-Point Unit.
A more extensive version of this appendix is available in the application note AP-578, Software
and Hardware Considerations for FPU Exception Handlers for Intel Architecture Processors
(Order Number 242415-001), which is available from Intel.
NOTES
I Microsoft Windows* 95 and Windows* 3.1 (and earlier versions) operating systems use almost the same
FPU exception handling interface as the operating system. The recommendations in this appendix for a
MS-DOS* compatible exception handler thus apply to all three operating systems.