
19
μ
PD75517(A)
2.2 GENERAL REGISTER BANK CONFIGURATION
The
μ
PD75517(A) contains four register banks, each consisting of eight general registers: X, A, B, C, D, E,
H, and L. These registers are mapped to addresses 00H to 1FH in memory bank 0 of the data memory. (See
Fig. 2-3.
) To specify a general register bank, a register bank enable flag (RBE) and a register bank select register
(RBS) are contained. The RBS is a register used to select a register bank, and the RBE is a flag used to determine
whether a register bank selected using the RBS is to be enabled. The register bank (RB) enabled at instruction
execution is determined as RB = RBERBS
As indicated in Table 2-2, the
μ
PD75517(A) enables the user to create programs in a very efficient manner
by selecting a register bank from the four register banks, depending on whether the processing is normal
processing or interrupt processing. (The RBE is automatically saved and set at the time of interrupt processing,
and is automatically restored upon completion of interrupt processing.)
Table 2-2 Example of the Use of Register Banks with Normal Routines and Interrupt Routines
The RBE and RBS are set as indicated below.
Example
SET1
CLR1
SEL
SEL
RBE ; RBE
←
1
RBE ; RBE
←
0
RB0 ; RBS
←
0
RB3 ; RBS
←
3
The general registers allow transfers, comparisons, arithmetic/logical operations, and increments and
decrements not only on a 4-bit basis, but also on an 8-bit basis with the XA, HL, DE, and BC register pairs.
In this case, the register pairs of the register bank that has the inverted value of bit 0 of a register bank specified
by RBERBS can be specified as XA’, HL’, DE’, and BC’, thus providing eight 8-bit registers. (See
Fig. 2-4
.)
Example
SET1
SEL
MOV
ADDS HL, XA
SUBS
INCS
MOV
MOV
RBE
RB2
XA, #18H ; XA
←
18H
; HL
←
HL+XA
HL’, XA
; HL’
←
HL’–XA (HL’ is HL of register bank 3)
HL
; HL
←
HL+1
XA, #00H ; XA
←
00H (string effect)
XA, #10H ; XA
←
10H (string effect)
; RBE
←
1
; RBS
←
2
Normal processing
Single interrupt processing
Dual interrupt processing
Multiple (triple or more) interrupt processing
Use register banks 2 and 3 with RBE = 1.
Use register bank 0 with RBE = 0.
Use register bank 1 with RBE = 1.
(In this case, the RBS needs to be saved and restored.)
Save the registers with PUSH or POP.