Programmer’s Model
2-8
Copyright © 2001, 2004 ARM Limited. All rights reserved.
ARM DDI 0210C
2.6
Registers
The ARM7TDMI processor has a total of 37 registers:
•
31 general-purpose 32-bit registers
•
6 status registers.
These registers are not all accessible at the same time. The processor state and operating
mode determine which registers are available to the programmer.
2.6.1
The ARM-state register set
In ARM state, 16 general registers and one or two status registers are accessible at any
one time. In privileged modes, mode-specific banked registers become available. Figure
2-3 on page 2-10 shows which registers are available in each mode.
The ARM-state register set contains 16 directly-accessible registers, r0 to r15. A further
register, the CPSR, contains condition code flags and the current mode bits. Registers
r0 to r13 are general-purpose registers used to hold either data or address values.
Registers r14 and r15 have the following special functions:
Link register
Register r14 is used as the subroutine
Link Register
(LR).
Register r14 receives a copy of r15 when a
Branch with Link
(BL)
instruction is executed.
At all other times you can treat r14 as a general-purpose register.
The corresponding banked registers r14_svc, r14_irq, r14_fiq,
r14_abt and r14_und are similarly used to hold the return values
of r15 when interrupts and exceptions arise, or when BL
instructions are executed within interrupt or exception routines.
Program counter
Register r15 holds the PC.
In ARM state, bits [1:0] of r15 are undefined and must be ignored.
Bits [31:2] contain the PC.
In Thumb state, bit [0] is undefined and must be ignored. Bits
[31:1] contain the PC.
By convention, r13 is used as the
Stack Pointer
(SP).
In privileged modes, another register, the
Saved Program Status Register
(SPSR), is
accessible. This contains the condition code flags and the mode bits saved as a result of
the exception which caused entry to the current mode.
Banked registers are discrete physical registers in the core that are mapped to the
available registers depending on the current processor operating mode. Banked register
contents are preserved across operating mode changes.
Содержание ARM7TDMI
Страница 6: ...Contents vi Copyright 2001 2004 ARM Limited All rights reserved ARM DDI 0210C ...
Страница 10: ...List of Tables x Copyright 2001 2004 ARM Limited All rights reserved ARM DDI 0210C ...
Страница 14: ...List of Figures xiv Copyright 2001 2004 ARM Limited All rights reserved ARM DDI 0210C ...
Страница 46: ...Introduction 1 26 Copyright 2001 2004 ARM Limited All rights reserved ARM DDI 0210C ...
Страница 120: ...Coprocessor Interface 4 18 Copyright 2001 2004 ARM Limited All rights reserved ARM DDI 0210C ...
Страница 142: ...Debug Interface 5 22 Copyright 2001 2004 ARM Limited All rights reserved ARM DDI 0210C ...
Страница 276: ...Differences Between Rev 3a and Rev 4 C 6 Copyright 2001 2004 ARM Limited All rights reserved ARM DDI 0210C ...
Страница 282: ...Glossary Glossary 6 Copyright 2001 2004 ARM Limited All rights reserved ARM DDI 0210C ...