45
Chapter 3 CPU Function
3
3.2 REGISTERS
3.2.1 Program Counter (PC)
This 16-bit binary counter holds the address of the program to be executed next (see
Fig. 3-6
).
Usually, the address is automatically incremented according to the number of bytes of the instruction to be
fetched. If an instruction causing a branch is executed, the contents of the register or immediate data are set.
When RESET is input, the contents at address 00000H of the internal ROM (external memory for the
µ
PD78213)
are specified in the low-order eight bits of the PC and the contents at address 00001H are specified in the high-order
eight bits of the PC.
Fig. 3-6 Configuration of the Program Counter
PC15 PC14 PC13 PC12 PC11 PC10 PC9 PC8 PC7 PC6 PC5 PC4 PC3 PC2 PC1 PC0
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
PC
3.2.2 Program Status Word (PSW)
This 8-bit register consists of flags that are set or reset according to the execution results of an instruction (see
Fig.
3-7
).
The contents can be read and written in units of eight bits. Each flag can be manipulated by a bit manipulation
instruction. The PSW is saved to a stack when a vectored interrupt request is acknowledged or when the BRK or
PUSH PSW instruction is executed. The PSW is restored when an RETI, RETB, or POP PSW instruction is executed.
When RESET is input, the PSW is set to 02H. (In this state, no interrupt requests can be acknowledged.)
Fig. 3-7 Configuration of the Program Status Word
IE
Z
RBS1 AC RBS0
0
ISP
CY
7
6
5
4
3
2
1
0
PSW
(1) Carry flag (CY)
This flag indicates whether an overflow or underflow occurs when an add/subtract instruction is executed.
If a shift/rotate instruction is executed, the flag holds a shift-out value. If a bit arithmetic/logical instruction
is executed, the flag functions as a bit accumulator.
(2) Interrupt priority status flag (ISP)
This flag manages the priority of maskable vectored interrupts that can currently be acknowledged. If a
maskable interrupt is acknowledged, the contents of the priority designation flag of the acknowledged
interrupt are transferred to the ISP flag. If a non-maskable interrupt (NMI) is acknowledged, this flag is set to
0.
If the ISP flag is set to 0, vectored interrupts assigned a lower priority by the priority designation flag register
(PR0) cannot be acknowledged. If the ISP flag is set to 1, interrupts can be acknowledged, independent of the
priority. The actual acknowledgment of interrupts is controlled according to the status of the IE flag.
The contents are updated each time a maskable vectored interrupt is acknowledged.
For details, see
Chapter 12
.
Summary of Contents for PD78212
Page 11: ......
Page 53: ...24 ...
Page 61: ...32 µPD78214 Sub Series 9 VSS Ground 10 NC non connection Not connected inside the chip ...
Page 65: ...36 ...
Page 83: ...54 ...
Page 135: ...106 ...
Page 271: ...242 ...
Page 405: ...376 ...
Page 417: ...388 ...
Page 423: ...394 ...
Page 449: ...420 ...
Page 457: ...428 ...
Page 471: ...442 ...
Page 487: ...458 ...