5.4.1. The ALU status flags

The CPSR contains the following ALU status flags:

N

Set when the result of the operation was Negative.

Z

Set when the result of the operation was Zero.

C

Set when the operation resulted in a Carry.

V

Set when the operation caused oVerflow.

A carry occurs if the result of an add, subtract, or compare is greater than or equal to 232, or as the result of an inline barrel shifter operation in a move or logical instruction.

Overflow occurs if the result of an add, subtract, or compare is greater than or equal to 231, or less than –231.

Add an S suffix to an ARM instruction to make it set the ALU status flags in the CPSR.

Do not use the S suffix with CMP, CMN, TST, or TEQ. These comparison instructions always update the flags. This is their only effect.

Copyright © 1997, 1998 ARM Limited. All rights reserved.ARM DUI 0040D
Non-Confidential