XC2200 Derivatives
System Units (Vol. 1 of 2)
Memory Organization
User’s Manual
3-7
V2.1, 2008-08
MemoryX2K, V1.3
General Purpose Registers
The General Purpose Registers (GPRs) use a block of 16 consecutive words either
within the global register bank or within one of the two local register banks. The bit-field
BANK in register PSW selects the currently active register bank. The global register bank
is mirrored to a section in the DPRAM, the Context Pointer (CP) register determines the
base address of the currently active global register bank section. This register bank may
consist of up to 16 Word-GPRs (R0, R1, … R15) and/or of up to 16 byte-GPRs
(RL0,RH0, … RL7, RH7). The sixteen byte-GPRs are mapped onto the first eight Word
GPRs (see
).
In contrast to the system stack, a register bank grows from lower towards higher address
locations and occupies a maximum space of 32 bytes. The GPRs are accessed via short
2-, 4-, or 8-bit addressing modes using the Context Pointer (CP) register as base
address for the global bank (independent of the current DPP register contents).
Additionally, each bit in the currently active register bank can be accessed individually.
The XC2200 supports fast register bank (context) switching. Multiple global register
banks can physically exist within the DPRAM at the same time. Only the global register
Table 3-2
Mapping of General Purpose Registers to DPRAM Addresses
DPRAM Address High Byte Registers Low Byte Registers Word Registers
<CP> + 1E
H
–
–
R15
<CP> + 1C
H
–
–
R14
<CP> + 1A
H
–
–
R13
<CP> + 18
H
–
–
R12
<CP> + 16
H
–
–
R11
<CP> + 14
H
–
–
R10
<CP> + 12
H
–
–
R9
<CP> + 10
H
–
–
R8
<CP> + 0E
H
RH7
RL7
R7
<CP> + 0C
H
RH6
RL6
R6
<CP> + 0A
H
RH5
RL5
R5
<CP> + 08
H
RH4
RL4
R4
<CP> + 06
H
RH3
RL3
R3
<CP> + 04
H
RH2
RL2
R2
<CP> + 02
H
RH1
RL1
R1
<CP> + 00
H
RH0
RL0
R0