NEC PD78P214 Manuale Utente

Pagina di 487
46
µ
PD78214 Sub-Series
(3) Register bank selection flags (RBS0, RBS1)
These two flags are used to select one of four register banks (see Table 3-2).
The flags hold two-bit information indicating the register bank selected by the SEL RBn instruction.
Table 3-2  Selecting a Register Bank
0
0
1
1
Register bank 0
Register bank 1
Register bank 2
Register bank 3
RBS1
0
1
0
1
RBS0
Specified register bank
(4) Auxiliary carry flag (AC)
If an operation generates a carry from bit 3 or a borrow into bit 3, this flag is set (1).  Otherwise, the flag is reset
(0).
The flag is used when a BCD conversion instruction is executed.
(5) Zero flag (Z)
If an operation results in zero, this flag is set (1).  Otherwise, the flag is reset (0).
(6) Interrupt request enable flag (IE)
This flag controls the CPU’s acknowledgment of interrupt requests.
If the flag is set to 0, interrupts are inhibited.  Only nonmaskable interrupts and unmasked macro services can
be acknowledged.  All other interrupts are prohibited.
If the flag is set to 1, interrupts are permitted.  The ISP flag, interrupt mask flag corresponding to each interrupt
request, and priority designation flag control the acknowledgment of an interrupt request.
When the EI instruction is executed, the IE flag is set (1).  When the DI instruction is executed or when an
interrupt is acknowledged, the flag is reset (0).
3.2.3  Stack Pointer (SP)
This 16-bit register holds the first address of a stack area (LIFO:  00000H to 0FFFFH) (see Fig. 3-8).  The stack pointer
is used to address a stack area when a subroutine is executed or when an interrupt is handled.
The contents of the SP are decremented before data is written into the stack area and incremented after data is
read from the stack area (see Figs. 3-9 and 3-10).
A special instruction can access the SP.
The contents of the SP become undefined when RESET is input.  Immediately after a reset is released (before a
subroutine is called or before an interrupt is acknowledged), run an initialization program to initialize the SP.
Example Initializing the SP
MOVW SP, #0FEE0H; SP 
← 0FEE0H (if used from FEDFH)
Fig. 3-8  Configuration of the Stack Pointer
SP15
15
SP14
14
SP13
13
SP12
12
SP11
11
SP10
10
SP9
9
SP8
8
SP7
7
SP6
6
SP5
5
SP4
4
SP3
3
SP2
2
SP1
1
SP0
0
SP