Keil Logo

Miscellaneous directives

5.18 Miscellaneous directives

Miscellaneous directives perform a range of different functions.


This topic includes descriptions of [COMMUNITY] features. See Support level definitions.

The following table shows how to translate armasm syntax miscellaneous directives to GNU syntax directives:

Table 5-8 Miscellaneous directives translation

armasm syntax directive GNU syntax directive Description
foo EQU 0x1C .equ foo, 0x1C

Assigns a value to a symbol. Note the rearrangement of operands.

.equ is a synonym for .set.

EXPORT StartHere

GLOBAL StartHere

.global StartHere

.type StartHere, @function

Declares a symbol that can be used by the linker (that is, a symbol that is visible to the linker).

armasm automatically determines the types of exported symbols. However, armclang requires that you explicitly specify the types of exported symbols using the .type directive.

If the .type directive is not specified, the linker outputs warnings of the form:

Warning: L6437W: Relocation #RELA:1 in test.o(.text) with respect to symbol...

Warning: L6318W: test.o(.text) contains branch to a non-code symbol symbol.

GET file


.include file Includes a file within the file being assembled.
IMPORT foo .global foo Provides the assembler with a name that is not defined in the current assembly.
INCBIN .incbin Includes a file within the file being assembled. The file is included verbatim. The assembler always emits a $d (data) mapping symbol for the .incbin directive.[COMMUNITY]
INFO n, "string" .warning "string" The INFO directive supports diagnostic generation on either pass of the assembly (specified by n). The .warning directive does not let you specify a particular pass, because the armclang integrated assembler only performs one pass.
ENTRY armlink --entry=location The ENTRY directive declares an entry point to a program. armclang does not provide an equivalent directive. Use armlink --entry=location to specify the entry point directly to the linker, rather than defining it in the assembly code.
END .end Marks the end of the assembly file.
PRESERVE8 .eabi_attribute Tag_ABI_align_preserved, 1

Emits a build attribute which guarantees that the functions in the file preserve 8-byte stack alignment.


For armasm syntax assembly language source files, even if you do not specify the PRESERVE8 directive, armasm automatically emits the build attribute if all functions in the file preserve 8-byte stack alignment. For GNU syntax assembly language source files, the armclang integrated assembler does not automatically emit this build attribute. Therefore you must manually inspect and ensure that all functions in your GNU syntax assembly language source file preserve 8-byte stack alignment and then manually add the directive to the file.
Non-ConfidentialPDF file icon PDF version100068_0616_01_en
Copyright © 2014–2021 Arm Limited or its affiliates. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.