Table 24. Condition Code Suffixes - ST STM32F3 Series Programming Manual

Hide thumbs Also See for STM32F3 Series:
Table of Contents

Advertisement

PM0214
Condition code suffixes
The instructions that can be conditional have an optional condition code, shown in syntax
descriptions as {cond}. Conditional execution requires a preceding IT instruction. An
instruction with a condition code is only executed if the condition code flags in the APSR
meet the specified condition.
You can use conditional execution with the IT instruction to reduce the number of branch
instructions in code.
Table 24
flags.
Suffix
EQ
NE
CS or HS
CC or LO
MI
PL
VS
VC
HI
LS
GE
LT
GT
LE
AL
Specific example 1: Absolute value
absolute value of a number. R0 = ABS(R1).
Specific example 1: Absolute value
MOVSR0, R1; R0 = R1, setting flags
IT MI ;
RSBMIR0, R1, #0;
Specific example 2: Compare and update value
update the value of R4 if the signed value R0 and R2 are greater than R1 and R3
respectively.
Specific example 2: Compare and update value
CMP R0, R1 ;
ITT GT ;
Table 24
also shows the relationship between condition code suffixes and the N, Z, C, and V

Table 24. Condition code suffixes

Flags
Z = 1
Z = 0
C = 1
C = 0
N = 1
N = 0
V = 1
V = 0
C = 1 and Z = 0
C = 0 or Z = 1
N = V
N != V
Z = 0 and N = V
Z = 1 and N != V
Can have any value
compare R0 and R1, setting flags
IT instruction for the two GT conditions
The STM32 Cortex-M4 instruction set
shows the condition codes to use.
Equal
Not equal
Higher or same, unsigned ≥
Lower, unsigned <
Negative
Positive or zero
Overflow
No overflow
Higher, unsigned >
Lower or same, unsigned
Greater than or equal, signed ≥
Less than, signed <
Greater than, signed >
Less than or equal, signed
Always. This is the default when no suffix is specified.
shows the use of a conditional instruction to find the
IT instruction for the negative condition
If negative, R0 = -R1
shows the use of conditional instructions to
PM0214 Rev 10
Meaning
67/262
261

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32F3 Series and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents