EasyManuals Logo
Home>ST>Computer Hardware>STM32H7 Series

ST STM32H7 Series User Manual

ST STM32H7 Series
262 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #80 background imageLoading...
Page #80 background image
The STM32 Cortex-M4 instruction set PM0214
80/262 PM0214 Rev 9
Restrictions
In these instructions:
• Do not use PC.
• Do not use SP for Rd and Rt.
• For STREX, Rd must be different from both Rt and Rn.
• The value of offset must be a multiple of four in the range 0-1020.
Condition flags
These instructions do not change the flags.
Examples
MOV R1, #0x1 ; initialize the ‘lock taken’ value try
LDREX R0, [LockAddr] ; load the lock value
CMP R0, #0 ; is the lock free?
ITT EQ ; IT instruction for STREXEQ and CMPEQ
STREXEQ R0, R1, [LockAddr] ; try and claim the lock
CMPEQ R0, #0 ; did this succeed?
BNE try ; no – try again
; yes – we have the lock
3.4.9 CLREX
Clear Exclusive.
Syntax
CLREX{cond}
Where:
‘cond’ is an optional condition code (see Conditional execution on page 65)
Operation
Use
CLREX
to make the next
STREX
,
STREXB
, or
STREXH
instruction write 1 to its destination
register and fail to perform the store. It is useful in exception handler code to force the failure
of the store exclusive if the exception occurs between a load exclusive instruction and the
matching store exclusive instruction in a synchronization operation.
See Synchronization primitives on page 34 for more information.
Condition flags
These instructions do not change the flags.
Examples
CLREX

Table of Contents

Other manuals for ST STM32H7 Series

Questions and Answers:

Question and Answer IconNeed help?

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

ST STM32H7 Series Specifications

General IconGeneral
BrandST
ModelSTM32H7 Series
CategoryComputer Hardware
LanguageEnglish

Related product manuals