10.2.4 Program Counter (PC)
The program counter is a 16-bit register that contains the address of the next instruction
or operand to be fetched.
During normal program execution, the program counter automatically increments to the
next sequential memory location every time an instruction or operand is fetched. Jump,
branch, interrupt, and return operations load the program counter with an address other
than that of the next sequential location. This is called a change-of-flow.
During reset, the program counter is loaded with the reset vector that is located at
0xFFFE and 0xFFFF. The vector stored there is the address of the first instruction that
will be executed after exiting the reset state.
10.2.5 Condition Code Register (CCR)
The 8-bit condition code register contains the interrupt mask (I) and five flags that
indicate the results of the instruction just executed. Bits 6 and 5 are set permanently to 1.
The following paragraphs describe the functions of the condition code bits in general
terms.
Table 10-1. CCR Register Field Descriptions
Field
Description
7
V
Two's Complement Overflow Flag — The CPU sets the overflow flag when a two's complement
overflow occurs. The signed branch instructions BGT, BGE, BLE, and BLT use the overflow flag.
0 No overflow
1 Overflow
4
H
Half-Carry Flag — The CPU sets the half-carry flag when a carry occurs between accumulator bits
3 and 4 during an add-without-carry (ADD) or add-with-carry (ADC) operation. The half-carry flag is
required for binary-coded decimal (BCD) arithmetic operations. The DAA instruction uses the states
of the H and C condition code bits to automatically add a correction value to the result from a
previous ADD or ADC on BCD operands to correct the result to a valid BCD value.
0 No carry between bits 3 and 4
1 Carry between bits 3 and 4
3
I
Interrupt Mask Bit — When the interrupt mask is set, all maskable CPU interrupts are disabled.
CPU interrupts are enabled when the interrupt mask is cleared. When a CPU interrupt occurs, the
interrupt mask is set automatically after the CPU registers are saved on the stack, but before the
first instruction of the interrupt service routine is executed.
Interrupts are not recognized at the instruction boundary after any instruction that clears I (CLI or
TAP). This ensures that the next instruction after a CLI or TAP will always be executed without the
possibility of an intervening interrupt, provided I was set.
0 Interrupts enabled
Table continues on the next page...
Programmer's Model and CPU Registers
MC9S08PA4 Reference Manual, Rev. 5, 08/2017
200
NXP Semiconductors
Содержание MC9S08PA4
Страница 1: ...MC9S08PA4 Reference Manual Supports MC9S08PA4 Document Number MC9S08PA4RM Rev 5 08 2017 ...
Страница 2: ...MC9S08PA4 Reference Manual Rev 5 08 2017 2 NXP Semiconductors ...
Страница 22: ...MC9S08PA4 Reference Manual Rev 5 08 2017 22 NXP Semiconductors ...
Страница 28: ...System clock distribution MC9S08PA4 Reference Manual Rev 5 08 2017 28 NXP Semiconductors ...
Страница 150: ...Port data registers MC9S08PA4 Reference Manual Rev 5 08 2017 150 NXP Semiconductors ...
Страница 196: ...Human machine interfaces HMI MC9S08PA4 Reference Manual Rev 5 08 2017 196 NXP Semiconductors ...
Страница 224: ...Instruction Set Summary MC9S08PA4 Reference Manual Rev 5 08 2017 224 NXP Semiconductors ...
Страница 232: ...Functional Description MC9S08PA4 Reference Manual Rev 5 08 2017 232 NXP Semiconductors ...
Страница 258: ...FTM Interrupts MC9S08PA4 Reference Manual Rev 5 08 2017 258 NXP Semiconductors ...
Страница 268: ...Initialization application information MC9S08PA4 Reference Manual Rev 5 08 2017 268 NXP Semiconductors ...
Страница 294: ...Functional description MC9S08PA4 Reference Manual Rev 5 08 2017 294 NXP Semiconductors ...
Страница 370: ...Memory map and register description MC9S08PA4 Reference Manual Rev 5 08 2017 370 NXP Semiconductors ...
Страница 398: ...Resets MC9S08PA4 Reference Manual Rev 5 08 2017 398 NXP Semiconductors ...
Страница 400: ...MC9S08PA4 Reference Manual Rev 5 08 2017 400 NXP Semiconductors ...