A-6
M68040 USER’S MANUAL
MOTOROLA
MC68LC040 REV2.3 (01/29/2000)
a pending unimplemented floating-point instruction exception. The access error ex-
ception handler then completes the write-backs in software, and exception processing
for the unimplemented floating-point instruction exception begins immediately after re-
turn from the access error handler.
3. The processor begins exception processing for the unimplemented floating-point in-
struction by making an internal copy of the current SR. The processor then enters the
supervisor mode and clears the trace bits (T1 and T0). It creates a format $4 stack
frame and saves the internal copy of the SR, PC, vector offset, calculated effective ad-
dress, and PC value of the faulted instruction in the stack frame.
The effective address field of the format $4 stack frame contains the calculated effec-
tive address of the operand for the faulted floating-point instruction using the address-
ing mode in which the effective address is calculated. For immediate and register
direct addressing modes, this field is $0. The saved PC value is the logical address of
the instruction that follows the unimplemented floating-point instruction. This value will
be restored during RTE execution. The vector offset format number ($4) is used for
this eight-word stack frame. Note that an MC68040 cannot correctly handle a stack for-
mat $4. The PC of the faulted instruction contains a long-word PC of the floating-point
instruction that caused the trap to occur. The information is provided so that the in-
struction is available for software emulation of floating-point instructions. The proces-
sor generates exception vector number 11 for the unimplemented F-line instruction
exception vector, fetches the address of the F-line exception handler from the excep-
tion vector table, and begins execution of the handler after prefetching instructions to
fill the pipeline. Refer to Section 8 Exception Processing for details about exception
processing.
A.5.2 MC68LC040 Stack Frames
When the processor executes an RTE instruction, it examines the stack frame on top of the
active supervisor stack to determine if it is a valid frame and what type of context restoration
it requires. The MC68LC040 provides ve different stack frames for exception processing
and allows for an MC68040-specic stack frame. The set of frames includes four- and
six-word stack frames, a four-word throwaway stack frame, an access error stack frame, and
a new eight-word unimplemented oating-point stack frame. The stack frame that the
MC68040 can generate and the MC68LC040 can process is the oating-point post-instruc-
tion stack frame. Refer to Section 8 Exception Processing for details about exception
stack frames.
Table 12-1. Eight-Word Stack Frame (Format $4)
Stack Frames
Exception Types
Stacked PC Points To
F
re
e
sc
a
le
S
e
m
ic
o
n
d
u
c
to
r,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
c
..
.