Keil Logo

Technical Support

On-Line Manuals

Assembler User Guide

Preface Overview of the Assembler Overview of the ARM Architecture Structure of Assembly Language Modules Writing ARM Assembly Language Condition Codes Using the Assembler Symbols, Literals, Expressions, and Operators VFP Programming Assembler Command-line Options --16 --32 --apcs=qualifier…qualifier --arm --arm_only --bi --bigend --brief_diagnostics, --no_brief_diagnostics --checkreglist --comment_section, --no_comment_section --compatible=name --cpreproc --cpreproc_opts=option[,option,…] --cpu=list --cpu=name --debug --depend=dependfile --depend_format=string --diag_error=tag[,tag,…] --diag_remark=tag[,tag,…] --diag_style={arm|ide|gnu} --diag_suppress=tag[,tag,…] --diag_warning=tag[,tag,…] --dllexport_all --dwarf2 --dwarf3 --errors=errorfile --execstack, --no_execstack --execute_only --exceptions, --no_exceptions --exceptions_unwind, --no_exceptions_unwind --fpmode=model --fpu=list --fpu=name -g --help -idir[,dir, …] --keep --length=n --li --library_type=lib --liclinger=seconds --list=file --list= --littleend -m --maxcache=n --md --no_code_gen --no_esc --no_hide_all --no_regs --no_terse --no_warn -o filename --pd --predefine "directive" --reduce_paths, --no_reduce_paths --regnames --report-if-not-wysiwyg --show_cmdline --split_ldm --thumb --thumbx --unaligned_access, --no_unaligned_access --unsafe --untyped_local_labels --version_number --via=filename --vsn --width=n --xref ARM and Thumb Instructions VFP Instructions Directives Reference Via File Syntax

--predefine "directive"

9.57 --predefine "directive"

Instructs armasm to pre-execute one of the SETA, SETL, or SETS directives.

You must enclose directive in quotes, for example:
armasm --predefine "VariableName SETA 20" inputfile.s
armasm also executes a corresponding GBLL, GBLS, or GBLA directive to define the variable before setting its value.
The variable name is case-sensitive. The variables defined using the command line are global to armasm source files specified on the command line.

Considerations when using --predefine

Be aware of the following:
  • The command-line interface of your system might require you to enter special character combinations, such as \", to include strings in directive. Alternatively, you can use --via file to include a --predefine argument. The command-line interface does not alter arguments from --via files.
  • --predefine is not equivalent to the compiler option -Dname. --predefine defines a global variable whereas -Dname defines a macro that the C preprocessor expands.
    Although you can use predefined global variables in combination with assembly control directives, for example IF and ELSE to control conditional assembly, they are not intended to provide the same functionality as the C preprocessor in armasm. If you require this functionality, ARM recommends you use the compiler to pre-process your assembly code.
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.