9.3. Installing an exception handler

Any new exception handler must be installed in the vector table. When installation is complete, the new handler executes whenever the corresponding exception occurs.

Exception handlers can be installed in two ways:

Branch instruction

This is the simplest method of reaching the exception handler. Each entry in the vector table contains a branch to the required handler routine. However, this method does have a limitation. Because the branch instruction only has a range of 32MB relative to the pc, with some memory organizations the branch may be unable to reach the handler.

Load pc instruction

With this method, the program counter is forced directly to the handler address by:

  1. storing the absolute address of the handler in a suitable memory location (within 4KB of the vector address)

  2. placing an instruction in the vector that loads the program counter with the contents of the chosen memory location.

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