Keil Logo

Symbol naming rules

7.1 Symbol naming rules

You must follow some rules when naming symbols in assembly language source code.

The following rules apply:
  • Symbol names must be unique within their scope.
  • You can use uppercase letters, lowercase letters, numeric characters, or the underscore character in symbol names. Symbol names are case-sensitive, and all characters in the symbol name are significant.
  • Do not use numeric characters for the first character of symbol names, except in numeric local labels.
  • Symbols must not use the same name as built-in variable names or predefined symbol names.
  • If you use the same name as an instruction mnemonic or directive, use double bars to delimit the symbol name. For example:
    ||ASSERT||
    The bars are not part of the symbol.
  • You must not use the symbols |$t|, |$t.x|, or |$d| as program labels. These are mapping symbols that mark the beginning of Thumb, ThumbEE, and data within the object file.
  • Symbols beginning with the characters $v are mapping symbols that relate to VFP and might be output when building for a target with VFP. ARM recommends you avoid using symbols beginning with $v in your source code.
If you have to use a wider range of characters in symbols, for example, when working with compilers, use single bars to delimit the symbol name. For example:
|.text|
The bars are not part of the symbol. You cannot use bars, semicolons, or newlines within the bars.
Related concepts
Non-ConfidentialPDF file icon PDF versionARM DUI0379H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. 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.