2.4. Conditional execution

In ARM state, and in Thumb state on processors with Thumb-2, most data processing instructions have an option to update ALU status flags in the Current Program Status Register (CPSR) according to the result of the operation.

In Thumb state on earlier architectures, most data processing instructions update the ALU status flags automatically. There is no option not to update the flags. Other instructions cannot update the flags.

Almost every ARM instruction can be executed conditionally on the state of the ALU status flags in the CPSR. See Table 2.2 for a list of the suffixes to add to instructions to make them conditional.

Almost all Thumb-2 instructions can be made conditional by the use of a special IT (If-Then) instruction. In addition, there are several conditional branch instructions.

In Thumb state on pre-Thumb-2 processors, the only mechanism for conditional execution is a conditional branch.

Flags are preserved until updated. A conditional instruction that is not executed has no effect on the flags.

Some instructions update a subset of the flags. The other flags are unchanged by these instructions. Details are specified in the descriptions of the instructions.

In ARM state, and in Thumb state on processors with Thumb-2, you can execute an instruction conditionally, based upon the flags set in another instruction, either:

This section describes:

Copyright © 2002-2005 ARM Limited. All rights reserved.ARM DUI 0204F