Chapter 2. ColdFire Core
2-17
Programming Model
2.2.1.3 Stack Pointer (A7, SP)
The processor core supports a single hardware stack pointer (A7) used during stacking for
subroutine calls, returns, and exception handling. The stack pointer is implicitly referenced
by certain operations and can be explicitly referenced by any instruction specifying an
address register. The initial value of A7 is loaded from the reset exception vector, address
0x0000. The same register is used for user and supervisor modes, and may be used for word
and longword operations.
A subroutine call saves the program counter (PC) on the stack and the return restores the
PC from the stack. The PC and the status register (SR) are saved on the stack during
exception and interrupt processing. The return from exception instruction restores SR and
PC values from the stack.
2.2.1.4 Program Counter (PC)
The PC holds the address of the executing instruction. For sequential instructions, the
processor automatically increments PC. When program flow changes, the PC is updated
with the target instruction. For some instructions, the PC specifies the base address for
PC-relative operand addressing modes.
2.2.1.5 Condition Code Register (CCR)
The CCR, Figure 2-4, occupies SR[7–0], as shown in Figure 2-3. CCR[4–0] are indicator
flags based on results generated by arithmetic operations.
7
6
5
4
3
2
1
0
Field
—
X
N
Z
V
C
Reset
000
Undefined
R/W
R
R/W
R/W
R/W
R/W
R/W
Figure 2-4. Condition Code Register (CCR)
CCR fields are described in Table 2-1.
Table 2-1. CCR Field Descriptions
Bits
Name
Description
7–5
—
Reserved, should be cleared.
4
X
Extend condition code bit. Assigned the value of the carry bit for arithmetic operations; otherwise not
affected or set to a specified result. Also used as an input operand for multiple-precision arithmetic.
3
N
Negative condition code bit. Set if the msb of the result is set; otherwise cleared.
2
Z
Zero condition code bit. Set if the result equals zero; otherwise cleared.
1
V
Overflow condition code bit. Set if an arithmetic overflow occurs, implying that the result cannot be
represented in the operand size; otherwise cleared.
0
C
Carry condition code bit. Set if a carry-out of the data operand msb occurs for an addition or if a
borrow occurs in a subtraction; otherwise cleared.
Содержание DigitalDNA ColdFire MCF5272
Страница 1: ...MCF5272UM D Rev 0 02 2001 MCF5272 ColdFire Integrated Microprocessor User s Manual ...
Страница 38: ...xxxviii MCF5272 User s Manual TABLES Table Number Title Page Number ...
Страница 58: ...1 10 MCF5272 User s Manual MCF5272 Specific Features ...
Страница 90: ...2 42 MCF5272 User s Manual Exception Processing Overview ...
Страница 96: ...3 6 MCF5272 User s Manual MAC Instruction Execution Timings ...
Страница 158: ...5 46 MCF5272 User s Manual Motorola Recommended BDM Pinout ...
Страница 184: ...7 12 MCF5272 User s Manual Interrupt Controller Registers ...
Страница 338: ...13 44 MCF5272 User s Manual Application Examples ...
Страница 414: ...18 6 MCF5272 User s Manual PWM Programming Model ...
Страница 452: ...19 38 MCF5272 User s Manual Power Supply Pins ...
Страница 482: ...20 30 MCF5272 User s Manual Reset Operation ...
Страница 492: ...21 10 MCF5272 User s Manual Non IEEE 1149 1 Operation ...
Страница 548: ...INDEX Index 12 MCF5272 User s Manual ...