beautypg.com

3 supervisor/user stack pointers (a7 and other_a7) – Motorola ColdFire MCF5281 User Manual

Page 51

background image

ColdFire Core

Freescale Semiconductor

2-5

2.2.3

Supervisor/User Stack Pointers (A7 and OTHER_A7)

This ColdFire architecture supports two independent stack pointer (A7) registers—the supervisor stack
pointer (SSP) and the user stack pointer (USP). The hardware implementation of these two
program-visible 32-bit registers does not identify one as the SSP and the other as the USP. Instead, the
hardware uses one 32-bit register as the active A7 and the other as OTHER_A7. Thus, the register contents
are a function of the processor operation mode, as shown in the following:

if SR[S] = 1

then

A7 = Supervisor Stack Pointer

OTHER_A7 = User Stack Pointer

else

A7 = User Stack Pointer

OTHER_A7 = Supervisor Stack Pointer

The BDM programming model supports direct reads and writes to A7 and OTHER_A7. It is the
responsibility of the external development system to determine, based on the setting of SR[S], the mapping
of A7 and OTHER_A7 to the two program-visible definitions (SSP and USP). This functionality is
enabled by setting the enable user stack pointer bit, CACR[EUSP]. If this bit is cleared, only a single stack
pointer (A7), defined for ColdFire ISA_A, is available. EUSP is cleared at reset.

To support dual stack pointers, the following two supervisor instructions are included in the ColdFire
instruction set architecture to load/store the USP:

move.l Ay,USP;move to USP

move.l USP,Ax;move from USP

These instructions are described in the ColdFire Family Programmer’s Reference Manual. All other
instruction references to the stack pointer, explicit or implicit, access the active A7 register.

NOTE

The SSP is loaded during reset exception processing with the contents of
location 0x0000_0000.

BDM: Load: 0x088 + n; n = 0–6 (An)

Store: 0x188 + n; n = 0–6 (An)

Access: User read/write

BDM read/write

31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10

9

8

7

6

5

4

3

2

1

0

R

Address

W

Reset – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

Figure 2-3. Address Registers (A0–A6)

MCF5282 and MCF5216 ColdFire Microcontroller User’s Manual, Rev. 3

This manual is related to the following products: