16.99 MOVL pseudo-instruction

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

MOVL generates either two or four instructions. If a Wd register is specified, MOVL generates a MOV, MOVK pair. If an Xd register is specified, MOVL generates a MOV followed by three MOVK instructions. If the assembler can load the register using a single MOV instruction, it additionally generates either one or three NOPs.

Syntax

MOVL Wd,expr

MOVL Xd,expr

where:

Wd

Is the register to load with a 32-bit value.

Xd

Is the register to load with a 64-bit value.

expr

Can be any one of the following:

symbol

A label in this or another program area.

#constant

Any 32-bit or 64-bit immediate value.

symbol + constant

A label plus a 32-bit or 64-bit immediate value.

Usage

Use the MOVL pseudo-instruction to:

  • Generate literal constants when an immediate value cannot be generated in a single instruction.

  • 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 MOVL.

    Note:

    An address loaded in this way is fixed at link time, so the code is not position-independent.

Examples

     MOVL w3, #0xABCDEF12   ; loads 0xABCDEF12 into w3
     MOVL x1, Trigger+12    ; loads the address that is 12 bytes higher than
                            ; the address Trigger into x1
Non-ConfidentialPDF file icon PDF versionDUI0801J
Copyright © 2014–2017, 2019 Arm Limited or its affiliates. All rights reserved.