102
CHAPTER 5 CPU ARCHITECTURE
5.2 Processor Registers
The
μ
PD78018F, 78018FY subseries are provided with the following processor registers:
5.2.1 Control registers
Each of these registers has a dedicated function such as to control the program sequence, status, and stack
memory. The control registers include the program counter (PC), program status word (PSW), and stack pointer (SP).
(1) Program counter (PC)
The program counter is a 16-bit register that holds an address of the program to be executed next.
The contents of this register are automatically incremented according to the number of bytes of an instruction
to be fetched when a normal operation is performed. When a branch instruction is executed, immediate data
or the contents of a register is set to the program counter.
When the RESET signal is input, the value of the reset vector table at addresses 0000H and 0001H is set
to the program counter.
Figure 5-9. Program Counter Configuration
PC15 PC14 PC13 PC12 PC11 PC10
PC9 PC8
PC
PC7 PC6 PC5 PC4 PC3 PC2 PC1 PC0
0
15
(2) Program status word (PSW)
The program status word is an 8-bit register consisting of flags that are set or reset as a result of instruction
execution.
The contents of the program status word are automatically pushed to the stack when an interrupt request is
generated or when the PUSH PSW instruction is executed, and are automatically popped from the stack when
the RETB, RETI, or POP PSW instruction is executed.
The contents of the program status word are set to 02H when the RESET signal is input.
Figure 5-10. Program Status Word Configuration
7
0
IE
Z
RBS1
AC
RBS0
0
ISP
CY
PSW
(a) Interrupt enable flag (IE)
This flag controls acknowledgement of an interrupt request by the CPU.
When IE = 0, all the interrupts are disabled except the non-maskable interrupt.
When IE = 1, the interrupts are enabled. At this time, accepting an interrupt is controlled by the in-service
priority flag (ISP), interrupt mask flag corresponding to each interrupt, and interrupt priority specification
flag.
These flags are reset to 0 when the DI instruction is executed or when an interrupt request is accepted,
and is set to 1 when the EI instruction is executed.
(b) Zero flag (Z)
This flag is set to 1 when the result of an operation performed is zero; otherwise, it is reset to 0.