9.1.2. Use of modes and registers by exceptions

Typically, an application runs in user mode, but servicing exceptions requires privileged (that is, non-user mode) operation. An exception changes the processor mode, and this in turn means that each exception handler has access to a certain subset of the banked registers:

and, in the case of a FIQ, five more general purpose registers (r8_FIQ to r12_FIQ).

Each exception handler must ensure that other registers are restored to their original contents upon exit. You can do this by saving the contents of any registers the handler needs to use onto its stack and restoring them before returning. If you are using Angel or ARMulator, the required stacks are set up for you. Otherwise, you must set them up yourself. Refer to Chapter 10 Writing Code for ROM for more information.

Note

As supplied, the assembler does not predeclare symbolic register names of the form register_mode. To use this form, you must declare the appropriate symbolic names with the RN assembler directive. For example, lr_FIQ RN r14 declares the symbolic register name lr_FIQ for r14. Refer to the ARM Software Development Toolkit Reference Guide for more information on the RN directive.

Copyright © 1997, 1998 ARM Limited. All rights reserved.ARM DUI 0040D
Non-Confidential