06.02.2013 Views

ARM Compiler toolchain Using the Linker - ARM Information Center

ARM Compiler toolchain Using the Linker - ARM Information Center

ARM Compiler toolchain Using the Linker - ARM Information Center

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7.10 Importing linker-defined symbols in <strong>ARM</strong> assembler<br />

7.10.1 See also<br />

Accessing and managing symbols with armlink<br />

To import linker-defined symbols into your assembler source code, use <strong>the</strong> IMPORT directive and<br />

create a 32-bit data word to hold <strong>the</strong> value of <strong>the</strong> symbol, for example:<br />

IMPORT |Image$$ZI$$Limit|<br />

...<br />

zi_limit DCD |Image$$ZI$$Limit|<br />

To load <strong>the</strong> value into a register, such as r1, use <strong>the</strong> LDR instruction:<br />

LDR r1, zi_limit<br />

The LDR instruction must be able to reach <strong>the</strong> 32-bit data word. The accessible memory range<br />

varies between <strong>ARM</strong> and Thumb, and <strong>the</strong> architecture you are using.<br />

Concepts<br />

• Image$$ execution region symbols on page 7-6.<br />

Reference<br />

Assembler Reference:<br />

• Memory access instructions on page 3-9<br />

• IMPORT and EXTERN on page 6-71.<br />

<strong>ARM</strong> DUI 0474C Copyright © 2010-2011 <strong>ARM</strong>. All rights reserved. 7-13<br />

ID080411 Non-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!