Skip to main content

IAR Embedded Workbench for RX 5.20

-D

In this section:
Syntax
-Dsymbol[=value] 
Parameters

symbol

The name of the symbol you want to define.

value

The value of the symbol. If no value is specified, 1 is used.

Description

Use this option to define a symbol to be used by the preprocessor.

Example

You might want to arrange your source code to produce either the test version or the production version of your application, depending on whether the symbol TESTVER was defined. To do this, use include sections such as:

#ifdef  TESTVER
...			; additional code lines for test version only
#endif

Then select the version required on the command line as follows:

Production version: iasmrx prog

Test version: iasmrx prog -DTESTVER

Alternatively, your source might use a variable that you must change often. You can then leave the variable undefined in the source, and use -D to specify the value on the command line, for example:

iasmrx prog -DFRAMERATE=3 

Caution

Project>Options>Assembler>Preprocessor>Defined symbols