UM012811-0904
Address
Space
eZ8 CPU
User Manual
16
or modified by any instruction that uses 8-bit addressing. To change to a different page,
use the Set Register Pointer (SRP) instruction to change the value of the Register Pointer.
(Load instructions, LD or LDX, can also be used but require more bytes of code space).
Working Register Addressing of the Register File
Each Register File page is logically divided into 16 Working Register Groups of 16 regis-
ters each. The Working Registers within each Working Register Group are accessible
using 4-bit addressing. The high nibble of the eZ8 CPU Register Pointer (RP) contains the
base address of the active Working Register Group, referred to as the Working Group
Pointer. When accessing one of the Working Registers, the 4-bit address of the Working
Register is combined within the Page Pointer and the Working Group Pointer to form the
full 12-bit address {RP[3:0], RP[7:4], Address[3:0]}. Figure 4 illustrates this operation.
Figure 4. Working Register Addressing Example
Because Working Registers can typically be specified using fewer operand bytes, there are
fewer bytes of code needed, which reduces execution time. In addition, when processing
interrupts or changing tasks, the Register Pointer speeds context switching. The Set Regis-
ter Pointer (SRP) instruction sets the contents of the Register Pointer.
16-bit Register Pairs
Register data may be accessed as a 16-bit word using Register Pairs. In this case, the most
significant byte (MSB) of the data is stored in the even numbered register, while the least
significant byte (LSB) is stored in the next higher odd numbered register (see Figure 5).
Address the register pair using the address of the MSB.
0
1
1
1
0
0
1
1
Register Pointer
0
1
1
0
1
1
1
0
INC R6
0
1
1
1
0
1
1
0
Bit
0
Bit
7
0
0
1
1
Full 12-bit Register Address (376H)
Bit
11
Bit
0
Working Group
Page
Working Register
4-bit Address