
DR
AFT
DR
AFT
DRAFT
DR
D
RAFT
DRAFT
DRA
FT DRAF
D
RAFT DRAFT DRAFT DRAFT DRAFT D
DRAFT
D
RAFT DRA
FT DRAFT DRAFT DRAFT DRA
UM10360_0
© NXP B.V. 2009. All rights reserved.
User manual
Rev. 00.06 — 5 June 2009
678 of 808
NXP Semiconductors
UM10360
Chapter 34: Appendix: Cortex-M3 User Guide
2.9.3 IT
If-Then condition instruction.
2.9.3.1
Syntax
IT{
x
{
y
{
z
}}}
cond
where:
x
specifies the condition switch for the second instruction in the IT block.
y
specifies the condition switch for the third instruction in the IT block.
z
specifies the condition switch for the fourth instruction in the IT block.
cond
specifies the condition for the first instruction in the IT block.
The condition switch for the second, third and fourth instruction in the IT block can be
either:
T:
Then. Applies the condition
cond
to the instruction.
E:
Else. Applies the inverse condition of
cond
to the instruction.
Remark:
It is possible to use
AL
(the
always
condition) for
cond
in an
IT
instruction. If this
is done, all of the instructions in the IT block must be unconditional, and each of
x
,
y
, and
z
must be
T
or omitted but not
E
.
2.9.3.2
Operation
The
IT
instruction makes up to four following instructions conditional. The conditions can
be all the same, or some of them can be the logical inverse of the others. The conditional
instructions following the
IT
instruction form the
IT block
.
The instructions in the IT block, including any branches, must specify the condition in the
{cond}
part of their syntax.
Remark:
Your assembler might be able to generate the required
IT
instructions for
conditional instructions automatically, so that you do not need to write them yourself. See
your assembler documentation for details.
A
BKPT
instruction in an IT block is always executed, even if its condition fails.
Exceptions can be taken between an
IT
instruction and the corresponding IT block, or
within an IT block. Such an exception results in entry to the appropriate exception handler,
with suitable return information in LR and stacked PSR.
Instructions designed for use for exception returns can be used as normal to return from
the exception, and execution of the IT block resumes correctly. This is the only way that a
PC-modifying instruction is permitted to branch to an instruction in an IT block.
2.9.3.3
Restrictions
The following instructions are not permitted in an IT block:
•
IT
•
CBZ
and
CBNZ