2 AVR Assembler Command Line Options
usage: avrasm2.exe [options] file.asm
Options:
-f [O|M|I|G|-] output file format:
-fO Debug info for simulation in Atmel Studio (default)
-fO1 | -fO2 - force format version 1 or 2 (default: auto)
-fM Motorola hex -fI Intel hex -fG Generic hex format
-f- No output file -o ofile Put output in 'ofile'.
-d dfile Generate debug info for simulation in Atmel Studio in 'dfile'. Can only be used with the -f [M|I|G] option.
-l lfile Generate listing in 'lfile'
-m mfile Generate map in 'mfile'
-e efile Place EEPROM contents in 'efile'
-w Relative jumps are allowed to wrap for program ROM up to 4k words in size [ignored]
-C ver Specify AVR core version
-c Case sensitive
-1/-2 Turn on/off AVR Assembler version 1 compatibility. [Deprecated]
-p1|0 Set/unset AVRASM1 implicit .device include (also set by -1) [Deprecated]
-I dir Preprocessor: Add 'dir' to include search path
-i file Preprocessor: Explicitly pre-include file
-D name[=value] Preprocessor: Define symbol. If =value is omitted, it is set to 1.
-U name Preprocessor: Undefine symbol.
-S file Produce include/label info file for Atmel Studio
-v verbosity [0-9][s]:
-vs Include target resource usage statistics
-vl Output low-level assembly code to stdout
-v0 Silent, only error messages printed
-v1 Error and warning messages printed
-v2 Error, warning, and info messages printed (default)
-v3-v9 Unspecified, increasing amounts of assembler internal dumps.
-V Format map and list files for Verilog.
-O i|w|e Overlap report: ignore|warning|error [error]
-W-b|+bo|+bi Byte operand out of range warning disable|overflow|integer
-W+ie|+iw Unsupported instruction error | warning
-W+fw Label slip caused by forward ref accepted (DANGEROUS)
-FD|Tfmt __DATE__ | __TIME__ format, using strftime(3) format string
-f output-file-format
Supported formats are generic/Intel/Motorola hex, and AVR Object files. There are two sub variants of the AVR Object file format:
-
Standard (V1) format, with 16-bit line number fields, supporting source files with up to 65534 lines
-
Extended (V2) format, with 24-bit line number fields, supporting source files with up to ~16M lines
By default, when output format is unspecified or specified with -fO, the assembler will select the appropriate format automatically, V1 if the file has less than 65533 lines, V2 if it has more. The -fO1 and -fO2 options may be used to force V1 or V2 output file format regardless of number of lines.
If V1 file format is used with source files with more than 65534 lines, the assembler will issue a warning, and the lines above 65534 cannot be debugged with Atmel Studio.
For all normal assembler projects, the default option should be safe. The extended format is primarily intended for machine-generated assembly files.
-w
Wrap relative jumps. This option is obsoleted, because AVRASM2 automatically determines when to wrap relative jumps, based on program memory size. The option is recognized but ignored.
-C core-version
Specify AVR Core version. The core version is normally specified in part definition files (partdef.inc), this option is intended for testing of the assembler, and generally not useful for end-users.
-c
-1 -2 [Deprecated]
-I directory
Add directory to the include file search path. This affects both the preprocessor #include directive and the assembler INCLUDE directive.
Multiple -I directives may be given. Directories are searched in the order specified.
-i file
Include a file. #include file directive is processed before the first source code line is processed. Multiple i directives may be used and will be processed in order.
-D name[=value] -U name
Define and undefine a preprocessor macro, respectively. Note that function-type preprocessor macros may not be defined from the command line. If -D is given no value, it is set to 1.
-S
Produces information about the include files, output files and label information Contained in the source file.
-vs
-vl
This will print the raw instructions emitted to standard output, after all symbolic info is replaced. Mainly for assembler debugging purposes.
-v0
Print error messages only, warning and info messages are suppressed.
-v1
Print error and warning messages only, info messages are suppressed.
-v2
Print error, warning, and info messages. This is the default behavior.
-v3 ... -v9
Print increasing amounts of assembler internal status dump. Mostly used for assembler debugging.
-V
Formats the List and Map File for Verilog. It sets the Verilog Option.
-O i|w|e
If different sections of code are mapped to overlapping memory locations using the ORG directive, an error message is normally issued.
This option allows setting this condition to cause an error (-Oe, default), a warning (-Ow) or be completely ignored (-Oi). Not recommended for normal programs.
This may also be set by #pragma overlap directive.
-W-b |-W+bo | -W+bi
-b, +bo, and +bi correspond to no warning, warning when overflow, and warning when integer value out of range, respectively. This may also be set by #pragma warning range.
-W+ie|+iw
+ie and +iw selects if use of unsupported instructions gives error or warning, respectively. The default is to give an error. Corresponds to #pragma error instruction/pragma warning instruction, respectively.
-FDformat -FTformat
Specify the format of the __DATE__ and __TIME__ Pre-defined Macros, respectively. The format string is passed directly to the strftime(3) C library function. The __DATE__ and __TIME__ preprocessor macros will always be string tokens, i.e., their values will appear in double quotes.
The default formats are "%b %d %Y" and "%H:%M:%S", respectively.
Example: To specify ISO format for __DATE__, specify -FD"%Y-%m-%d"
These formats may only be specified at the command line, there are no corresponding #pragma directives.
#message "__DATE__ =" __DATE__ "__TIME__ =" __TIME__
This will print the value of the date and time macros when the program is assembled, making verification easy (see #error, #warning, and #message directive documentation). An alternative syntax for the format specification may be considered in future AVRASM2 versions to avoid this problem.
Some relevant strftime() format specifiers (see strftime(3) manual page for full details):
- %Y - Year, four digits
- %y - Year, two digits
- %m - Month number (01-12)
- %b - Abbreviated month name
- %B - Full month name
- %d - Day number in month (01-31)
- %a - Abbreviated weekday name
- %A - Full weekday name
- %H - Hour, 24-hour clock (00-23)
- %I - Hour, 12-hour clock (01-12)
- %p - "AM" or "PM" for 12-hour clock
- %M - Minute (00-59)
- %S - Second (00-59)