Keil Logo

DEFINE Assembler Directive




One or more names (in accordance with the naming conventions of the C language) separated by commas. An optional value may be assigned to each name.




Options — A51 — Misc Controls.


The DEFINE directive defines C preprocessor symbols on the assembler command line. This is equivalent to using the #define directive in your program source code. You may use the #if, #ifdef, and #ifndef preprocessor directives to query names defined with the DEFINE directive.

Defined names are copied exactly as they are entered and are case-sensitive. Each name may be assigned a value.


  • The DEFINE directive may be specified only on the command line. Use the C preprocessor #define directive to define symbols inside an assembler source file.
  • The DEFINE directive may not be used to define preprocessor macros.

The C preprocessor processes the source text of a source file before it is actually assembled. This means that the DEFINE symbol can be used anywhere in the source code. For example DEFINE (check="15+5") replaces all symbols that have the name check with the text 15+5.

See Also


A51 SAMPLE.ASM DEFINE (check=15, NoExtRam)

A51 MYPROG.ASM DF (X1="1+5")
  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.