
ML674001 Series/ML675001 Series User’s Manual
Chapter 2 CPU
2-13
2.12.6
Aborts
An abort indicates failure to complete the current memory access. The CPU detects abort exceptions during
the memory access cycle.
There are two types of aborts.
Prefetch abort: during instruction prefetch
Data abort:
during data access
A prefetch abort marks the instruction as invalid, but the exception is not processed until the instruction
reaches the head of the pipeline. If an intervening branch or other cause prevents execution, there is no abort
exception.
The handling of a data abort depends on the instruction type.
A single data transfer instruction (LDR or STR) proceeds as far as the base register update, if specified.
The abort handler must watch out for this.
A swap instruction (SWP) aborts without doing anything at all.
A block data transfer instruction (LDM or STM) runs to completion, updating the base register, if
specified.
If the instruction overwrites the base register contents with data--that is, includes the base register in the
transfer list--the overwrite is aborted. Detection of an abort blocks all such register overwrites. One important
consequence is that an aborted LDM instruction always preserves the contents of R15, the last register to be
transferred.
The exception handler, after removing the cause of the abort, must, regardless of the state (ARM or THUMB),
execute the appropriate instructions to restore the program counter (PC) and current program status (CPSR)
register and re-execute the aborted instruction.
Prefetch abort: SUBS PC, R14_abt, #4
Data abort:
SUBS PC, R14_abt, #8
2.12.7
Software Interrupts
A software interrupt (SWI) instruction switches the CPU to Supervisor mode, normally to request a special,
supervisory function. The SWI handler must, regardless of the original state (ARM or THUMB), terminate
by executing the following instruction.
MOV PC , R14_svc
2.12.8
Undefined Instructions
Attempting to execute an instruction not supported by the CPU triggers an undefined instruction trap. This
mechanism allows the programmer to expand the THUMB or ARM instruction set using software emulation.
The trap handler, after emulating the failed instruction, must, regardless of the original state (ARM or
THUMB), terminate by executing the following instruction.
MOVS PC , R14_und
This instruction restores the current program status register (CPSR) and returns to the instruction following
the undefined one.