13.64 MOV32 pseudo-instruction

Load a register with either a 32-bit immediate value or any address.

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

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.

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 T32 bit (bit 0) of the address if the label referenced is in T32 code.

Architectures

This pseudo-instruction is available in A32 and T32.

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
Non-ConfidentialPDF file icon PDF versionDUI0801J
Copyright © 2014–2017, 2019 Arm Limited or its affiliates. All rights reserved.