EasyManua.ls Logo

Freescale Semiconductor MC68881 - Page 225

Default Icon
409 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...
SECTION 6
EXCEPTION PROCESSING
This section describes how the MC68881/MC68882 (FPCP) and the main processor handle
exceptional conditions during the processing of floating-point instructions. These excep-
tional conditions may be detected internally by the FPCP, internally by the main processor,
or externally by the main processor.
The MC68020/MC68030 (MPU) processes exceptions by treating any coprocessor in an
M68000 system as an extension to the main processor; the fact that a coprocessor is
separate from the main processor is transparent to the programmer. Thus, the exception
processing for all coprocessors in a system is coordinated by the main processor in a
manner that is consistent across all exception types, whether detected during the execution
of an instruction native to the main processor or during a coprocessor instruction.
The processing of an exception detected during the execution of an FPCP instruction
involves the following basic steps:
1. Detect the exception
2. Determine the exception vector number and report the exception to the main pro-
cessor (if detected by the FPCP)
3. Change processing states if needed (user to supervisor)
4. Save the old context of the main processor (performed automatically by the MPU)
5. Load a new context from the address contained in the exception vector table
6. Execute the exception handler
7. Return to the previous context
The first two steps involve slightly different operations for exceptions detected by the main
processor and those detected by the FPCP, but the manner in which these operations are
performed is consistent with noncoprocessor related exceptions. The major difference in
the processing of exceptions detected by the FPCP and the main processor is the point at
which exception processing starts. For all main-processor-detected exceptions and some
coprocessor-detected exceptions, processing for the exception begins during the execution
of the coprocessor instruction by the main processor. However, for many of the copro-
cessor=detected exceptions, processing for the exception does not begin until after the
main processor completes execution of the offending instruction and attempts execution
of a new floating-point instruction. The manner of handling this type exception supports
a sequential instruction programming model.
The action of the processor during step 7 depends upon the type of exception that was
previously taken. When the exception handler completes execution, a return from exception
(RTE) instruction is executed, and the previously interrupted program resumes execution
at one of the following points:
1. The beginning of the instruction that was pre-empted by an exception detected by or
reported to the MPU (pre-instruction exception)
2. The point where the exception occurred during the execution of an instruction (mid-
instruction exception)
MC68881/MC68882 USER'S MANUAL FREESCALE
6-1

Table of Contents

Related product manuals