Typewriter User Manual

5- 58 MC68340 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. Setup for Rerun
Read the MOVEM opcode and extension from locations pointed to by stackframe 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.
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.
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
Scan the mask for set bits. Read/write the selected register from/to the operand address
as each bit is found.
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.
If the addressing mode is predecrement or postincrement, update the register to complete
the execution of the instruction.
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.
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
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...