Skip to main content
Knowledgebase
Home
Renesas Electronics America - Knowledgebase

What is the difference between CCR's V flag and C flag?

Latest Updated:03/26/2009

Question:

Since the CCR's V flag and C flag both flag a 1 when an operation overflows, what is the difference?

Answer:

The CCR's V flag is accessed to see if an overflow has occurred in a signed operation. In figure 1.1, which is a byte-sized operation, the flag is set to 1 when the result is smaller than the negative minimum (H'80) or larger than the positive maximum (H'7F).

In contrast, the CCR's C flag is accessed to see if an overflow has occurred in an unsigned operation. In figure 1.2, which is a byte-sized operation, the flag is set to 1 when the result is smaller than the minimum (H'00) or larger than the maximum (H'FF).

Suitable Products
H8/300H Tiny
H8/36109
H8/36087
H8/36077, H8/36079
H8/36064
H8/36049
H8/36037, H8/36057
H8/36014, H8/36024
H8/3694
H8/3687
H8/3672
H8/3664
H8/36912, H8/36902