External interface details
You can use the assembler either from the IAR Embedded Workbench IDE or from the command line. Refer to the IDE Project Management and Building documentation for information about using the assembler from the IAR Embedded Workbench IDE.
Assembler invocation syntax
The invocation syntax for the assembler is:
iasmrh850 [options][sourcefile][options]For example, when assembling the source file prog.s, use this command to generate an object file with debug information:
iasmrh850 prog ‑‑debug
By default, the IAR Assembler for RH850 recognizes the filename extensions s, asm, and msa for source files. The default filename extension for assembler output is o.
Generally, the order of options on the command line, both relative to each other and to the source filename, is not significant. However, there is one exception—when you use the -I option—the directories are searched in the same order that they are specified on the command line.
If you run the assembler from the command line without any arguments, the assembler version number and all available options, including brief descriptions, are directed to stdout and displayed on the screen.
Passing options
You can pass options to the assembler in three different ways:
Directly from the command line
Specify the options on the command line after the
iasmrh850command, see Assembler invocation syntax.Via environment variables
The assembler automatically appends the value of the environment variables to every command line, so it provides a convenient method of specifying options that are required for every assembly, see Environment variables.
Via a text file by using the
-foption, see -f.
For general guidelines for the option syntax, an options summary, and more information about each option, see Assembler options.
Environment variables
You can use these environment variables with the IAR Assembler:
Environment variable | Description |
|---|---|
| Specifies command line options, for example: |
| Specifies directories to search for include files, for example: set |
For example, setting this environment variable always generates a list file with the name temp.lst:
set IASMRH850=-l temp.lstFor information about the environment variables used by the compiler and linker, see Environment variables.
Error return codes
When using the IAR Assembler from within a batch file, you might have to determine whether the assembly was successful to decide what step to take next. For this reason, the assembler returns these error return codes: