MOV32 always generates two 32-bit instructions,
a MOV, MOVT pair. This enables you to
load any 32-bit immediate, or to access the whole 32-bit address
space.
Syntax
MOV32{cond} Rd, expr
where:
cond
is an optional condition code.
Rd
is the register to be loaded. Rd must
not be SP or PC.
expr
can be any one of the following:
symbol
A label in this or another program area.
#constant
Any 32-bit immediate value.
symbol + constant
A label plus a 32-bit immediate value.
Usage
The main purposes of the MOV32 pseudo-instruction
are:
To generate literal constants
when an immediate value cannot be generated in a single instruction.
To load a PC-relative or external address into a
register. The address remains valid regardless of where the linker
places the ELF section containing the MOV32.
Note
An address loaded in this way is fixed at link time, so the
code is not position-independent.
MOV32 sets the Thumb bit (bit 0) of the address
if the label referenced is in Thumb code.
Architectures
This pseudo-instruction is available in ARMv6T2 and above
in both ARM and Thumb.
Examples
MOV32 r3, #0xABCDEF12 ; loads 0xABCDEF12 into R3
MOV32 r1, Trigger+12 ; loads the address that is 12 bytes higher than
; the address Trigger into R1
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.