7480 Group and 7481 Group User's Manual
1-18
HARDWARE
1.7.5 Program Counter (PC)
The program counter is a 16-bit counter consisting of the high-order 8 bits (PCH) and the low-order 8 bits
(PCL). The program counter indicates the address of the program memory to be next fetched.
At reset, the high-order 8 bits (PCH) of the program counter contain the contents of address ‘FFFF16’, and
the low-order 8 bits (PCL) contain the contents of address ‘FFFE16’.
1.7.6 Processor Status Register (PS)
The processor status register is an 8-bit register. This register consists of 5 flags which hold the states
immediately after arithmetic or logical operation, and 3 flags which determine the CPU operation.
C, Z, V, and N flags are used to test the branch instructions. However, Z, V, and N flags are invalid in the
decimal mode.
Each flag of the processor status register is described below. Also, Table 1.7.2 lists the instructions that
set these flags to ‘1’ or ‘0’.
(1)
Carry Flag C (bit 0)
This flag holds a carry or a borrow from the arithmetic logic unit after following an arithmetic or logical
operation. Also, the shift and rotate instructions can affect the content of this flag.
The Carry flag is set to ‘1’ by using the SEC instruction and cleared to ‘0’ by using the CLC
instruction.
(2)
Zero Flag Z (bit 1)
This flag is ‘1’ when the result of an arithmetic, logical or transfer operation is ‘0’, otherwise it is ‘0’.
The Zero flag is invalid in the decimal mode.
There is no instruction that can affect the content of this flag.
(3)
Interrupt Disable Flag I (bit 2)
This flag disables all interrupts except the BRK instruction interrupt. When it is set to ‘1’, interrupt
is disabled. When an interrupt is accepted, the flag automatically goes to ‘1’.
This flag is set to ‘1’ by using the SEI instruction and cleared to ‘0’ by using the CLI instruction.
Note: This flag is set to ‘1’ (interrupt disabled) at reset.
(4)
Decimal Mode Flag D (bit 3)
This flag determines whether addition and subtraction are performed in the binary or decimal mode.
When this flag is ‘0’, ordinary binary operation is performed; On the other hand, when it is ‘1’, an 8-
bit word is handled as a decimal number of two digits. Decimal adjust is automatically performed in
the decimal operation. However, the decimal operation can be performed only at the ADC and SBC
instructions.
This flag is set to ‘1’ by using the SED instruction and cleared to ‘0’ by using the CLD instruction.
Note: This flag is undefined at reset; then it is necessary to initialize this flag because it directly
affects the result of arithmetic operation.
1.7 Central Processing Unit (CPU)