The carry flag C stores the carry out Cₙ of the ALU's adder. It's the flag for unsigned arithmetic.
- After ADD: C = 1 means the unsigned sum didn't fit in n bits (unsigned overflow). The result shows the true sum minus 2ⁿ.
- After SUB, computed as A + + 1: C = 1 means no borrow, so A ≥ B. C = 0 means a borrow: A < B as unsigned numbers, and the result has wrapped around.
That makes C the unsigned comparison flag. After A − B: C = 0 means A < B; C = 1 with Z = 0 means A > B; Z = 1 means they're equal.
Two conventions exist. This course, like ARM processors, keeps the raw carry-out, so C = 1 means no borrow after SUB. x86 processors invert it on subtraction and treat it as a borrow, so there C = 1 means a borrow happened. Check which convention a question uses.
C says nothing about signed results. For twos complement numbers, use the overflow flag V. A carry-out of 1 is completely normal when adding two negative numbers, for example.