Type Iii) Correcting Faults Via Software - Motorola CPU32 Reference Manual

Hide thumbs Also See for CPU32:
Table of Contents

Advertisement

6.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. Do the
following to complete an instruction through software:
A. Setup for Rerun
Read the MOVEM opcode and extension from locations pointed to by stack
frame PC and PC + 2. The effective address need not be recalculated, since
the next operand address is saved in the stack frame. However, the opcode ef-
fective address field must be examined to determine how to update the address
register and program counter 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 trans-
ferred. 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 the TR bit is set in the stacked SSW, create a six-word stack frame and ex-
ecute the trace handler. If either B1 or B0 in the SSW is set, create another six
word stack frame and execute the hardware breakpoint handler.
De-allocate the stack and return control to the faulted program.
6.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 exceptions, will be restarted upon return from the exception handler.
When a fault occurs after an operand has transferred, that transfer is not "undone".
However, these memory locations are accessed a second time when the instruction is
restarted. If a register used in an effective address calculation is overwritten before a
fault occurs, an incorrect effective address is calculated upon instruction restart.
MOTOROLA
6-20
EXCEPTION PROCESSING
CPU32
REFERENCE MANUAL

Advertisement

Table of Contents
loading

Table of Contents