From Intellivision Wiki
m (Protected "Carry Flag" ([edit=autoconfirmed] (indefinite) [move=autoconfirmed] (indefinite)))
Latest revision as of 08:12, 4 December 2010
The Carry Flag (C), if set, indicates that the previous operation resulted in an unsigned integer overflow. If clear, the previous operation did not result in an unsigned integer overflow.
For unsigned addition, the Carry is set when the addition's result is larger than what would fit in a 16-bit register, and cleared otherwise. For unsigned subtraction, the Carry is set whenever the minuend (the number being subtracted from) is greater than or equal to the subtrahend (the number being subtracted), and cleared otherwise. (In essence, it indicates "Did Not Borrow.") The Carry bit can be used in conjunction with ADCR to perform Extended Precision Arithmetic.
Since the CMP family of instructions compare numbers by subtracting them, one sometimes sees Branch if Carry set described as an unsigned variation of "Branch if Greater-than or Equal" (also BHIS: Branch if HIgher or Same), and Branch if No Carry set described as an unsigned variation of "Branch if Less-than" (also BLO: Branch if LOwer). The names BHIS and BLO come from the PDP-11.
The behavior of the following opcodes is affected by the status of the Carry Flag.
- Indicates slight variation from normal Carry Flag behavior. See opcode documentation for more details.