Adr - ST STM32F3 Series Programming Manual

Hide thumbs Also See for STM32F3 Series:
Table of Contents

Advertisement

The STM32 Cortex-M4 instruction set
3.4.1

ADR

Load PC-relative address.
Syntax
ADR{cond} Rd, label
Where:
'cond' is an optional condition code (see
'Rd' is the destination register
'label' is a PC-relative expression (see
Operation
ADR determines the address by adding an immediate value to the PC. It writes the result to
the destination register.
ADR produces position-independent code, because the address is PC-relative.
If you use ADR to generate a target address for a BX or BLX instruction, you must ensure
that bit[0] of the address you generate is set to1 for correct execution.
Values of label must be within the range -4095 to 4095 from the address in the PC.
Note:
You might have to use the .W suffix to get the maximum offset range or to generate
addresses that are not word-aligned (see
Restrictions
Rd must be neither SP nor PC.
Condition flags
This instruction does not change the flags.
Examples
ADR R1, TextMessage; write address value of a location labelled as
70/262
; TextMessage to R1
Conditional execution on page
PC-relative expressions on page
Instruction width selection on page
PM0214 Rev 10
PM0214
65)
65)
68).

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