Carry Flag

From Intellivision Wiki
Revision as of 20:55, 11 January 2005 by Pingaso (talk | contribs)
Jump to: navigation, search

The Carry Flag (C), if set, indicates that the previous operation resulted in an unsigned integer overflow or underflow. If clear, the previous operation did not result in an unsigned overflow or underflow. For example, during the process of arithmetic addition, an unsigned overflow can occur when two positive signed integers are added together and results in a third positive signed integer that is too large to contain in a single 16-bit register.

The behavior of the following opcodes is affected by the status of the Carry Flag.

BC
BNC
BUSC
BESC
ADCR
GSWD
RLC*
RRC*

In addition to affecting the behavior of the opcodes above, the following opcodes affect the status of the Carry Flag.

CLRC
SETC
NEGR
ADCR
RSWD*
RRC*
RLC*
SARC*
SLLC*
ADDR
SUBR
CMPR
ADD
ADD@
SUB
SUB@
CMP
CMP@

  • Indicates slight variation from normal Carry Flag behavior. See opcode documentation for more details.