This technical note describes how to place an assembler symbol at an absolute memory address.
Placing an assembler symbol at an absolute memory address can be done in two ways:
TN_17934_test_project_IAR_Embedded_Workbench_for Arm_7_70_1.zip
Use ASEGN to start a named absolute section placed at the memory address address. This can be used for both constant and read/write data, as in this source example:
ASEGN `.rodata`:CONST:NOROOT,08000H
DATA
my_const:
DC32 42
ASEGN `.bss`:DATA:NOROOT,020008000H
DATA
my_var:
DS8 4
The result is that my_const is placed at 0x8000 and my_var is placed at 0x20008000.
These two actions are needed:
In the following example, the symbol my_func is associated with the section .my_func_section.
PUBLIC my_func
SECTION .my_func_section:CODE:NOROOT(1)
THUMB
my_func:
MOV R0,#+32768
LDR R0,[R0, #+0]
BX LR ;; return
REQUIRE my_const
By adding these lines in the linker configuration file, the named section will be placed (at link time) at the absolute memory address 0x00010000.
define symbol __MY_CODE__ = 0x00010000;
place at address mem:__MY_CODE__ { readonly section .my_func_section };
All product names are trademarks or registered trademarks of their respective owners.