EasyManua.ls Logo

Intel 8253 - Numeric Exceptions and Their Defaults; Recommended Protocol for Ms-Dos and Windows* 95 Compatible Handlers; Two Options for Handling Numeric Exceptions

Intel 8253
773 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
AP-578
14
2/21/97 12:57 PM 24329102.DOC
INTEL CONFIDENTIAL
(until publication date)
As explained in Section 2.3.3, if a No-Wait
instruction is used outside of the FPU exception
handler, in the Intel486 and Pentium processors, it
may accept an unmasked exception from a
previous FPU instruction which happens to fall
within the external interrupt sampling window that is
opened near the beginning of execution of all FPU
instructions. This will not happen in the Pentium Pro
processor, because this sampling window has been
removed from the No-Waitgroup of FPU
instructions.
3.0 RECOMMENDED PROTOCOL
FOR MS-DOS AND
WINDOWS* 95 COMPATIBLE
HANDLERS
3
The activities of numeric programs can be split into
two major areas: program control and arithmetic.
The program control part performs activities such
as deciding what functions to perform, calculating
addresses of numeric operands, and loop control.
The arithmetic part simply adds, subtracts,
multiplies, and performs other operations on the
numeric operands. The processor is designed to
handle these two parts separately and efficiently.
An FPU exception handler, if a system chooses to
implement one, is often one of the most
complicated parts of the program control code.
3.1 Numeric Exceptions and their
Defaults
The FPU can recognize six classes of numeric
exception conditions while executing numeric
instructions:
Footnotes
3
Although there are some differences in the way
FPU exceptions are handled between MS-DOS,
and WINDOWS 95 and WINDOWS 3.1 (and
earlier versions), the WINDOWS operating
systems operate the processor in the MS-DOS
compatable mode, and the recommended protocol
given here applies to all these systems. On the
other hand, current versions of WINDOWS NT
use the FPU native mode.
1. #I Invalid operation
#IS
Stack fault
#IA
IEEE standard invalid operation
2. #Z
Divide-by-zero
3. #D
Denormalized operand
4. #O
Numeric overflow
5. #U
Numeric underflow
6. #P
Inexact result (precision)
For complete details on these exceptions and their
defaults, see the Pentium
Processor Family
Developers Manual, Volume 3, Sections 7.1.7
through 7.1.13.
3.1.1 TWO OPTIONS FOR HANDLING
NUMERIC EXCEPTIONS
Depending on options determined by the software
system designer, the processor takes one of two
possible courses of action when a numeric
exception occurs:
1. The FPU can handle selected exceptions
itself, producing a default fix-up that is
reasonable in most situations. This allows the
numeric program execution to continue
undisturbed. Programs can mask individual
exception types to indicate that the FPU
should generate this safe, reasonable result
whenever the exception occurs. The default
exception fix-up activity is treated by the FPU
as part of the instruction causing the
exception; no external indication of the
exception is given (except that the instruction
takes longer to execute when it handles a
masked exception.) When masked exceptions
are detected, a flag is set in the numeric status
register, but no information is preserved
regarding where or when it was set.

Table of Contents