A simplified ARM programmer’s model is provided in this section.
Register File. In the ARM
processor, 16 general purpose registers are available at any time.
Each register is 32-bit in size. The registers are referred to as
rn, where n represents the register
index. All instructions treat registers
Any operation that can be performed on
r0 can be performed equally well on registers
r15 are assigned special functions by
r15 is the program
counter, and contains the address of the next instruction to be
r14 is the link register, and
used to store the return address, when a subroutine is invoked.
Status Register. The Current Program Status Register
cpsr) is a dedicated 32-bit register,
that contains the following fields.
Only the condition flags field will be used in the examples provided in this tutorial. And hence only the condition flags will be elaborated here.
The condition flags indicates the various conditions that occur while performing arithmetic and logical operations. The various condition flags and their meaning are given in the following table.
Table A.1. Condition Flags
Operation caused a carry.
Operation caused an overflow.
Operation resulted in 0.
Operation resulted in a negative value.