Placing at absolute address in assembler source

Technical Note 17934






5/7/2020 3:19 PM


This technical note describes how to place an assembler symbol at an absolute memory address.


You can place an assembler symbol at an absolute memory address in two ways:

With IAR Embedded Workbench for Arm version 7.40 (or later), placing assembler data using the ASEGN directive.

Placing a symbol, through a named section, when linking.

Placing assembler code requires these actions:

  • First, in assembler source code associate the code label with a named section.
  • Secondly, when linking, place that named section at an absolute memory address.

Example project for this technical note


Placing data using the ASEGN directive:

Use ASEGN to start a named absolute section placed at the memory address address. This can be used for both constant data and read/write data, as in this source example:

        ASEGN `.rodata`:CONST:NOROOT,08000H
        DC32 42

        ASEGN `.bss`:DATA:NOROOT,020008000H
        DS8 4

The result is that my_const is placed at 0x8000 and my_var is placed at 0x20008000.

Placing the symbol, through a named section, when linking:

Do these actions:

  • In the assembler source code: Associate the assembler symbol with a named section.
  • In the linker configuration (.icf) file: Place the named section at an absolute memory address.

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)
        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 (when linking) at the absolute memory address 0x00010000.

define symbol __MY_CODE__   = 0x00010000;
place at address mem:__MY_CODE__ { readonly section .my_func_section };


  • Absolute placement of data can be done with the ASEGN directive.
  • Absolute placement of code (can also be used for data) is performed in two steps.

All product names are trademarks or registered trademarks of their respective owners.

We do no longer support Internet Explorer. To get the best experience of, we recommend upgrading to a modern browser such as Chrome or Edge.