
3-12
Programmer’s Model
Rev. A
Copyright 2000 by LSI Logic Corporation. All rights reserved.
the exception handler. More details on actions taken on entering and
exiting an exception are provided in the following subsections.
3.6.1 Entering an Exception
When handling an exception, the ARM7TDMI-S core:
1.
Preserves the address of the next instruction in the appropriate Link
register.
If the exception has been entered from ARM state, then the address
of the next instruction is copied into the Link register (current PC +
4 or PC + 8, depending on the exception. If the exception has been
entered from Thumb state, then the value the ARM7TDMI-S core
writes into the Link register is the current PC offset by a value that
causes the program to resume from the correct place on return from
the exception. Thus the exception handler need not determine the
state when entering an exception. For example, in the case of a
Software Interrupt (
SWI
),
MOVS PC, R14_svc
always returns to the
Table 3.2
Exception Entry/Exit
Return Instruction
Previous State
Notes
ARM
R14_x
Thumb
R14_x
BL
MOV PC, R14
PC + 4
PC + 2
1
SWI
MOVS PC, R14_svc
PC + 4
PC + 2
1
UDEF
MOVS PC, R14_und
PC + 4
PC + 2
1
FIQ
SUBS PC, R14_fiq, #4
PC + 4
PC + 4
2
IRQ
SUBS PC, R14_irq, #4
PC + 4
PC + 4
2
PABT
SUBS PC, R14_abt, #4
PC + 4
PC + 4
1
DABT
SUBS PC, R14_abt, #8
PC + 8
PC + 8
3
RESET
NA
–
–
4
1. Where PC is the address of the BL/SWI/Undefined Instruction fetch that had the prefetch abort.
2. Where PC is the address of the instruction that did not get executed because the FIQ or IRQ took
priority.
3. Where PC is the address of the Load or Store instruction that generated the data abort.
4. The value saved in R14_svc upon reset is unpredictable.