ST STM32F4 Series Programming Manual page 145

Cortex-m4
Hide thumbs Also See for STM32F4 Series:
Table of Contents

Advertisement

PM0214
Other restrictions when using an IT block are:
a branch or any instruction that modifies the PC must either be outside an IT block or
must be the last instruction inside the IT block. These are:
Do not branch to any instruction inside an IT block, except when returning from an
exception handler
All conditional instructions except Bcond must be inside an IT block. Bcond can be
either outside or inside an IT block but has a larger branch range if it is inside one
Each instruction inside the IT block must specify a condition code suffix that is either
the same or logical inverse as for the other instructions in the block.
Your assembler might place extra restrictions on the use of IT blocks, such as prohibiting the
use of assembler directives within them.
Condition flags
This instruction does not change the flags.
Example
ITTE
ANDNE
ADDSNE R2, R2, #1
MOVEQ
CMP
ITE
ADDGT
ADDLE
IT
ADDGT
ITTEE
MOVEQ
ADDEQ
ANDNE
BNE.W
IT
ADD
ADD PC, PC, Rm
MOV PC, Rm
B, BL, BX, BLX
any LDM, LDR, or POP instruction that writes to the PC
TBB and TBH
NE
; Next 3 instructions are conditional
R0, R0, R1
; ANDNE does not update condition flags
; ADDSNE updates condition flags
R2, R3
; Conditional move
R0, #9
; Convert R0 hex value (0 to 15) into ASCII
; ('0'-'9', 'A'-'F')
GT
; Next 2 instructions are conditional
R1, R0, #55
; Convert 0xA -> 'A'
R1, R0, #48
; Convert 0x0 -> '0'
GT
; IT block with only one conditional instruction
R1, R1, #1
; Increment R1 conditionally
EQ
; Next 4 instructions are conditional
R0, R1
; Conditional move
R2, R2, #10
; Conditional add
R3, R3, #1
; Conditional AND
dloop
; Branch instruction can only be used in the last
; instruction of an IT block
NE
; Next instruction is conditional
R0, R0, R1
; Syntax error: no condition code used in IT block
DocID022708 Rev 6
The STM32 Cortex-M4 instruction set
145/260
259

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Stm32l4+ seriesStm32f3 series

Table of Contents

Save PDF