29
CHAPTER 3 CPU
3.2.1
Condition Code Register (CCR)
The condition code register (CCR) is the lower 8 bits of the program status register
(PS). The condition code register consists of bits (C, V, Z, N, and H) for indicating the
results of arithmetic operations or data to be transferred and control bits (I, IL1, and IL0)
for controlling the acceptance of interrupt requests.
■
Configuration of the Condition Code Register (CCR)
Figure 3.2-2 Configuration of Condition Code Register
■
Bits for Indicating Arithmetic Operation Results
●
Half carry flag (H)
When a carry from bit3 to bit4 or a borrow from bit4 to bit3 occurs as a result of an arithmetic operation,
the half carry flag is set to "1". Otherwise, the half carry flag is cleared with "0". The half carry flag is
intended only for decimal adjustment instructions, and thus should not be used for operations other than
addition or subtraction.
●
Negative flag (N)
When the highest bit becomes "1" as a result of an arithmetic operation, the negative flag is set to "1".
When it becomes "0", it is cleared with "0".
●
Zero flag (Z)
When the result of an arithmetic operation is "0", the zero flag is set to "1". Otherwise, the zero flag is
cleared with "0".
●
Overflow flag (V)
When a complement on 2 overflow occurs as a result of an arithmetic operation, the overflow flag is set to
"1". Otherwise, the overflow flag is cleared with "0".
●
Carry flag (C)
When a carry from bit7 or a borrow to bit7 occurs as a result of an arithmetic operation, the carry flag is set
to "1". Otherwise, the carry flag is cleared with "0". The shift instruction causes the value to be shifted out.
RP
CCR
bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 CCR initial value
PS
R4
R3
R2
R1
R0
-
-
-
H
I
IL1 IL0
N
Z
V
C
X011XXXX
B
Half carry flag
Interrupt enable flag
Interrupt level bits
Negative flag
Zero flag
Overflow flag
Carry flag
X: Undefined
Summary of Contents for F2MC-8L F202RA
Page 2: ......
Page 4: ......
Page 32: ...16 CHAPTER 1 OVERVIEW ...
Page 90: ...74 CHAPTER 3 CPU ...
Page 142: ...126 CHAPTER 5 TIME BASE TIMER POPW A RETI ENDS END ...
Page 150: ...134 CHAPTER 6 WATCHDOG TIMER ...
Page 176: ...160 CHAPTER 7 8 BIT PWM TIMER ...
Page 220: ...204 CHAPTER 8 8 16 BIT CAPTURE TIMER COUNTER ...
Page 240: ...224 CHAPTER 9 12 BIT PPG TIMER ...
Page 274: ...258 CHAPTER 11 EXTERNAL INTERRUPT CIRCUIT 2 LEVEL ...
Page 362: ...346 CHAPTER 15 BUZZER OUTPUT ...
Page 390: ...374 CHAPTER 17 FLASH MEMORY ...
Page 419: ...403 INDEX INDEX The index follows on the next page This is listed in alphabetic order ...
Page 434: ...418 INDEX ...
Page 436: ......