Digi NS7520 DJ Equipment User Manual


 
www.digi.com
      35
Working with the CPU
After emulating the failed instruction, the trap handler should execute the following
instruction irrespective of the state (Thumb or ARM):
MOVS PC, R14_und.
This instruction restores the PC and CPSR, and returns to the instruction following the
undefined instruction.
SWI exception
An SWI is used for entering supervisor mode, usually to request a particular supervisor
function. An SWI handler should return by executing this instruction irrespective of
the state (ARM or Thumb):
MOVS PC, R14_SVC.
This instruction restores the PC and CPSR, and returns to the instruction following the
SWI.
Abort exception
An abort indicates that the current memory access cannot be completed, and is
signaled by the external ABORT input. The ARM7TDMI checks for the abort exception
during memory access cycles.
There are two types of abort exception:
Prefetch abort. Occurs during an instruction prefetch. If a prefetch abort
occurs, the prefetch instruction is marked as invalid but the exception is
not taken until the instruction reaches the head of the pipeline. If the
instruction is not executed (for example, if a branch occurs while the
instruction is in the pipeline), the abort does not take place.
Data abort. Occurs during a data operand access. If a data abort occurs, the
action taken depends on the instruction type:
Single data transfer instructions (LDR, STR) write back modified base
registers; the abort handler must be aware of this.
A swap instruction (SWP) is aborted as though it had not been executed.
Block data transfer instructions (LDM, STM) complete. If write-back is set,
the base is updated. If the instruction would have overwritten the base with
data (that is, the base is in the transfer list), the overwriting is prevented.
All register overwriting is prevented after an abort is indicated, which
means that
R15 (always the last register to be transferred) is preserved in an
aborted LDM instruction.