4.11.3. MOV32 pseudo-instruction

Load a register with either:

MOV32 always generates two 32-bit instructions.

If MOV32 is used to load an address, the resulting code is not position-independent.

Syntax

MOV32{cond} register, expr

where:

cond

is an optional condition code (see Conditional execution).

register

is the register to be loaded.

expr

can be any one of the following:

symbol

A label in this or another program area.

constant

Any 32-bit constant.

symbol + constant

A label plus a 32-bit constant.

The assembler generates a MOV, MOVT pair of instructions. This allows you to load any 32-bit constant, or to access the whole address space.

If symbol is external, the assembler places a linker relocation directive in the object file. The linker generates the address at link time,

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 program-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.

Architectures

This ARM pseudo-instruction is available in all versions of the ARM architecture.

This 32-bit Thumb-2 pseudo-instruction is available in T2 variants of ARMv6 and above.

There is no 16-bit Thumb version of this pseudo-instruction.

Copyright © 2002-2005 ARM Limited. All rights reserved.ARM DUI 0204F
Non-Confidential