Renesas H8S/2138 Series Manuál Strana 10

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 148
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 9
Microcomputer Technical Q&A
2
Q&A No.: QAH8S-002
Category: CPU
Subject: Difference between V Flag and C Flag in CCR
Question
The V flag and C flag in CCR are both set if overflow occurs during an operation. What is the
difference between these flags?
Answer
The V flag in CCR is used to identify whether overflow occurs in a signed operation. To take the
example of a byte-size operation, this flag is set to 1 if the operation result is smaller than the
negative minimum value (H'80) larger than the positive maximum value (H'7F).
V flag
H'80
H'7FH'00
Overflow Overflow
The C flag, on the other hand, is used to identify whether overflow occurs in an unsigned
operation. To take the example of a byte-size operation, this flag is set to 1 if the operation result
is larger than the maximum value (H'FF) or smaller than the minimum value (H'00).
C flag
H'00
H'FF
Overflow Overflow
Zobrazit stránku 9
1 2 ... 5 6 7 8 9 10 11 12 13 14 15 ... 147 148

Komentáře k této Příručce

Žádné komentáře