2.6.3.7.1 Condition Flags

The APSR contains the following condition flags:
  • N: Set to 1 when the result of the operation was negative, cleared to 0 otherwise.
  • Z: Set to 1 when the result of the operation was zero, cleared to 0 otherwise.
  • C: Set to 1 when the operation resulted in a carry, cleared to 0 otherwise.
  • V: Set to 1 when the operation caused overflow, cleared to 0 otherwise.

For more information about the APSR, refer to 2.5.1.3.5 Program Status Register.

A carry occurs:

  • If the result of an addition is greater than or equal to 232
  • If the result of a subtraction is positive or zero
  • As the result of an inline barrel shifter operation in a move or logical instruction

Overflow occurs when the sign of the result, in bit[31], does not match the sign of the result had the operation been performed at infinite precision, for example:

  • If adding two negative values results in a positive value
  • If adding two positive values results in a negative value
  • If subtracting a positive value from a negative value generates a positive value
  • If subtracting a negative value from a positive value generates a negative value

The Compare operations are identical to subtracting, for CMP, or adding, for CMN, except that the result is discarded. See the instruction descriptions for more information. Most instructions update the status flags only if the S suffix is specified. See the instruction descriptions for more information.