KS57C2308/P2308/C2316/P2316 ADDRESS SPACES
2-9
Working Register Banks
For addressing purposes, the working register area is divided into four register banks — bank 0, bank 1, bank 2,
and bank 3. Any one of these banks can be selected as the working register bank by the register bank selection
instruction (SRB n) and by setting the status of the register bank enable flag (ERB).
Generally, working register bank 0 is used for the main program, and banks 1, 2, and 3 for interrupt service
routines. Following this convention helps to prevent possible data corruption during program execution due to
contention in register bank addressing.
Table 2-3. Working Register Organization and Addressing
ERB Setting SRB Settings Selected Register Bank
3210
000––Always set to bank 0
0 0 Bank 0
10001 Bank 1
1 0 Bank 2
1 1 Bank 3
Paired Working Registers
Each of the register banks is subdivided into eight 4-bit registers. These registers, named Y, Z, W, X, H, L, E and
A, can either be manipulated individually using 4-bit instructions, or together as register pairs for 8-bit data
manipulation.
The names of the 8-bit register pairs in each register bank are EA, HL, WX, YZ and WL. Registers A, L, X and Z
always become the lower nibble when registers are addressed as 8-bit pairs. This makes a total of eight 4-bit
registers or four 8-bit double registers in each of the four working register banks.
YZ
WX
HL
E A
(MSB) (LSB) (MSB) (LSB)
Figure 2-5. Register Pair Configuration