SHx Assembler Command-line Options

To start the SHx assembler, enter a command line with the following format when the host computer operating system is in the input wait state.

shasm <input source file> [,<input source file>...][command line options>...]

When multiple source files are specified on the command line, the unit of assembly processing will be the concatenation of the specified files in the specified order. In this case, the .END directive must appear only in the last file. Command line options may begin with either a - (hyphen) or a / (slash). File names may be specified with either forward or backward slashes.

Note   If an argument could be interpreted as either a command line option or a file name, it will be interpreted as a command line option. If a file called /source.src is assembled by writing shasm /source, the assembler interprets /source as a switch and issues a message that there are no input files.

The assembler delivers a return code that reports whether or not the assembly processing terminated normally. The following table shows the return values that indicate the level of error that occurred.

Activity Return value
Normal termination 0
Warnings occurred 0
Errors occurred 2
Fatal error occurred 4

Command line options provide additional specifications for the assembly processing. The following table shows the command line options for SHASM.

Command line option Description
-OBJECT Specifies output of an object module. Default value.
-NOOBJECT Suppresses output of an object module.
-DEBUG Specifies output of debug information.
-NODEBUG Suppresses output of debug information.
-LIST Specifies output of an assembler listing. Default value.
-NOLIST Suppresses output of an assembler listing.
-SHOW Specifies output of the preprocessor function source program.
-NOSHOW Suppresses output of specified preprocessor function source statements and object code display lines in the source program listing.
-LINES Sets the number of lines in the assembler listing.
-COLUMNS Sets the number of columns in the assembler listing.
-FoOBJPATH Sets the path to which the object should be written. A synonym for the -o=OBJPATH option. Provided for compatibility with Microsoft-based tools.
-wide[_listing] Shows up to eight bytes of machine code or data per line in the assemble listing. Default is four bytes per line.
-nowide[_listing] Shows up to four bytes of machine code or data per line in the assemble listing. This is the default behavior.
-tab[_expand][=<number>] Expands tab characters in the assemble listing. The number, if specified, is the spacing of tab stops. Default is eight.
-Notab[_expand] Writes tab characters into the assemble listing unchanged. This is the default behavior.
-maxerr[ors]=<number> Aborts the assembly after <number> errors have been reported. Default is 100.
-Qsh<version>[r<revision>] Selects SH microprocessor version and revision that control the setting of the _M_SH and _M_SH_REV predefined symbols. Default is version SH-3.
-nologo Instructs not to print the logo banner when it runs.
-help
-usage
Output a detailed command line usage message and exit immediately.
-D<name>[=<number>] Predefines an equate; for example, -DTERM is equivalent to TERM.
-CPU=SH<version> Selects target CPU for the source program being assembled. Valid options are:
  • SH1
  • SH2
  • SH3
  • SH3E
  • SH4

The assembler listing is a listing to which the results of the assembly processing are output.

See Also

SHx Series Assembler | SHx Assembler Documentation Disclaimer | What's New for SH-4 | SHx Series Assembler Directives

 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.