Directives Reference

7.3.1LTORG

The LTORG directive instructs the assembler to assemble the current literal pool immediately.

Syntax

LTORG

Usage

The assembler assembles the current literal pool at the end of every code section. The end of a code section is determined by the AREA directive at the beginning of the following section, or the end of the assembly.

These default literal pools can sometimes be out of range of some LDR, LDFD, and LDFS pseudo-instructions. See LDR ARM pseudo-instructionon page 4-82 and LDR Thumb pseudo-instructionon page 5-41 for more information. Use LTORG to ensure that a literal pool is assembled within range. Large programs can require several literal pools.

Place LTORG directives after unconditional branches or subroutine return instructions so that the processor does not attempt to execute the constants as instructions.

The assembler word-aligns data in literal pools.

Example

 

AREA

Example, CODE, READONLY

start

BL

func1

 

func1

 

 

; function body

 

; code

 

 

 

LDR

r1,=0x55555555

; => LDR R1, [pc, #offset to Literal Pool 1]

 

; code

 

 

 

MOV

pc,lr

; end function

 

LTORG

 

; Literal Pool 1 contains literal &55555555.

data

SPACE

4200

; Clears 4200 bytes of memory,

 

 

 

; starting at current location.

 

END

 

; Default literal pool is empty.

7-14

Copyright © 2000, 2001 ARM Limited. All rights reserved.

ARM DUI 0068B

Page 296
Image 296
ARM VERSION 1.2 manual Ltorg, Syntax