Conditional execution in Thumb state

In Thumb state on processors before ARMv6T2, the only mechanism for conditional execution is a conditional branch. You can conditionally skip over the instruction using a conditional branch instruction.

In Thumb state on ARMv6T2 or later processors, instructions can also be conditionally executed by:

The Thumb CBZ (Conditional Branch on Zero) and CBNZ (Conditional Branch on Non-Zero) instructions compare the value of a register against zero and branch on the result.

IT is a 16-bit instruction that enables almost all Thumb instructions to be conditionally executed, on the value of the ALU flags, using the condition code suffix. Each IT instruction provides conditional execution for up to four following instructions.

Example 19. Conditional instructions using IT block

    ; flags set by a previous instruction
    ITT   EQ
    LSLEQ r0, r0, #24
    ADDEQ r0, r0, #2

Show/hideSee also

Copyright © 2010-2012 ARM. All rights reserved.ARM DUI 0473H