Programmers Model
ARM DDI 0363G
Copyright © 2006-2011 ARM Limited. All rights reserved.
3-14
ID073015
Non-Confidential
3.7
Exceptions
Exceptions are taken whenever the normal flow of a program must temporarily halt, for
example, to service an interrupt from a peripheral. Before attempting to handle an exception, the
processor preserves the critical parts of the current processor state so that the original program
can resume when the handler routine has finished.
This section provides information of the processor exception handling:
•
Exception entry and exit summary
•
•
•
•
•
•
•
.
Note
When the processor is in debug halt state, and an exception occurs, it is handled differently to
normal. See
3.7.1
Exception entry and exit summary
summarizes the PC value preserved in the relevant R14 on exception entry, and the
instruction that ARM recommends for exiting the exception handler.
Table 3-4 Exception entry and exit
Exception
or entry
Recommended
return instruction
Previous state
Notes
ARM R14_x
Thumb R14_x
SVC
a
MOVS PC, R14_svc
IA + 4
IA + 2
Where the IA is the address of the SVC or Undefined
instruction.
UNDEF
Varies
b
IA + 4
IA + 2
PABT
SUBS PC, R14_abt, #4
IA + 4
IA + 4
Where the IA is the address of instruction that had the
Prefetch Abort.
FIQ
SUBS PC, R14_fiq, #4
IA + 4
IA + 4
Where the IA is the address of the instruction that was
not executed because the FIQ or IRQ took priority.
IRQ
SUBS PC, R14_irq, #4
IA + 4
IA + 4
DABT
SUBS PC, R14_abt, #8
IA + 8
IA + 8
Where the IA is the address of the Load or Store
instruction that generated the Data Abort.
RESET
NA
-
-
The value saved in R14_svc on reset is Unpredictable.
BKPT
SUBS PC, R14_abt, #4
IA + 4
IA + 4
Software breakpoint.
a. Formerly SWI.
b. The return instruction you must use after an UNDEF exception is handled depends on whether you want to retry the undefined instruction
or not and, if not, on the size of the undefined instruction.