3/24/97 3-2 XA Memory Organization
less significant word), and this must have an even number. Thus valid double-register pairs are
(R0,R1), (R2,R3), (R4,R5) and (R6, R7).
As described in section 4.7, there are two stack pointers, one for user mode and another for
system mode. At any given instant only one stack pointer is accessible and its value is in R7.
When PSW.SM is 0, user mode is active and the USP is accessible via R7. When PSW.SM is 1,
the XA is operating in system mode, and SSP is in SP (R7). (Note however, as described in
Chapter 4, all interrupts save stack frames on the system stack, using the SSP, regardless of the
current operating mode.)
There are four distinct instances of registers R0 through R3. At any given time, only 1 set of the
4 banks is active, referenced as R0 through R3, and the contents of the other banks are
inaccessible. This allows high-speed context-switching, for example, for interrupt service
routines. PSW bits RS1 and RS0 select the active register bank:
RS1 RS0 visible register bank
---- ----- ------------------------
0 0 bank 0
0 1 bank 1
1 0 bank 2
1 1 bank 3
Figure 3.1 XA Register File Overview
16 bits
R7
R6
R5
R4
R3
R2
R1
R0
R15
R14
R13
R12
R11
R10
R9
R8
general registers
general registers
derivative-optional
present in all
XA derivatives
(word-accessible only)