Assembler User GuidePreface Overview of the Assembler Overview of the ARM Architecture Structure of Assembly Language Modules Writing ARM Assembly Language About the Unified Assembler Language Register usage in subroutine calls Load immediate values Load immediate values using MOV and MVN Load immediate values using MOV32 Load immediate values using LDR Rd, =const Literal pools Load addresses into registers Load addresses to a register using ADR Load addresses to a register using ADRL Load addresses to a register using LDR Rd, =label Other ways to load and store registers Load and store multiple register instructions Load and store multiple register instructions in A Stack implementation using LDM and STM Stack operations for nested subroutines Block copy with LDM and STM Memory accesses The Read-Modify-Write operation Optional hash with immediate constants Use of macros Test-and-branch macro example Unsigned integer division macro example Instruction and directive relocations Frame directives Exception tables and Unwind tables Assembly language changes after RVCT v2.1 Condition Codes Using the Assembler Symbols, Literals, Expressions, and Operators VFP Programming Assembler Command-line Options ARM and Thumb Instructions VFP Instructions Directives Reference Via File Syntax
Instruction and directive relocations
4.24 Instruction and directive relocations
The assembler can embed relocation directives in object files to indicate labels with addresses that are unknown at assembly time. The assembler can relocate several types of instruction.
A relocation is a directive embedded in the object file that enables source code to refer to a label whose target address is unknown or cannot be calculated at assembly time. The assembler emits a relocation in the object file, and the linker resolves this to the address where the target is placed.
The assembler relocates the data directives
The assembler is permitted to emit a relocation for these instructions:
The assembler emits a relocation for these instructions if the label used meets any of the following requirements, as appropriate for the instruction type:
NoteYou can use the
IMPORT sym ; sym is an external symbol DCW sym ; Because DCW only outputs 16 bits, only the lower ; 16 bits of the address of sym are inserted at ; link-time.
of your data.