5- 56
MC68341 USER’S MANUAL
MOTOROLA
5.5.3.2.3 Type II—Correcting Faults via RTE. Instructions aborted because of a type II
fault are restarted upon return from the exception handler. A fault handler must establish
safe restart conditions. If a fault is caused by a nonresident page in a demand-paged
virtual memory configuration, the fault address must be read from the stack, and the
appropriate page retrieved. An RTE instruction terminates the exception handler. After
unstacking the machine state, the instruction is refetched and restarted.
5.5.3.2.4 Type III—Correcting Faults via Software. Sufficient information is contained in
the stack frame to complete MOVEM in software. After the cause of the fault is corrected,
the faulted bus cycle must be rerun. Perform the following procedures to complete an
instruction through software:
A. Set Up for Rerun
1. Read the MOVEM opcode and extension from locations pointed to by stack frame
PC and PC
+ 2. The EA need not be recalculated since the next operand address
is saved in the stack frame. However, the opcode EA field must be examined to
determine how to update the address register and PC when the instruction is
complete.
2. Adjust the mask to account for operands already transferred. Subtract the stacked
operand transfer count from 16 to obtain the number of operands transferred. Scan
the mask using this count value. Each time a set bit is found, clear it and decrement
the counter. When the count is zero, the mask is ready for use.
3. Adjust the operand address. If the predecrement addressing mode is in effect,
subtract the operand size from the stacked value; otherwise, add the operand size to
the stacked value.
B. Rerun Instruction
1. Scan the mask for set bits. Read/write the selected register from/to the operand
address as each bit is found.
2. As each operand is transferred, clear the mask bit and increment (decrement) the
operand address. When all bits in the mask are cleared, all operands have been
transferred.
3. If the addressing mode is predecrement or postincrement, update the register to
complete the execution of the instruction.
4. If TR is set in the stacked SSW, create a six-word stack frame and execute the trace
handler. If either B1 or B0 is set in the SSW, create another six-word stack frame
and execute the hardware breakpoint handler.
5. De-allocate the stack and return control to the faulted program.
5.5.3.2.5 Type III—Correcting Faults by Conversion and Restart. In some situations, it
may be necessary to rerun all the operand transfers for a faulted instruction rather than
continue from a faulted operand. Clearing the MV bit in the stacked SSW converts a type
III fault into a type II fault. Consequently, MOVEM, like all other type II
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
..
.