.\" Title: yasm
.\" Author: Peter Johnson <peter@tortall.net>
-.\" Generator: DocBook XSL Stylesheets v1.70.1 <http://docbook.sf.net/>
-.\" Date: October 2006
+.\" Generator: DocBook XSL Stylesheets v1.71.1 <http://docbook.sf.net/>
+.\" Date: April 2007
.\" Manual: The Yasm Modular Assembler
.\" Source: Yasm
.\"
-.TH "YASM" "1" "October 2006" "Yasm" "The Yasm Modular Assembler"
+.TH "YASM" "1" "April 2007" "Yasm" "The Yasm Modular Assembler"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.PP
Many options may be given in one of two forms: either a dash followed by a single letter, or two dashes followed by a long option name. Options are listed in alphabetical order.
.SS "General Options"
-.TP 3n
+.PP
\fB\-a \fR\fB\fIarch\fR\fR or \fB\-\-arch=\fR\fB\fIarch\fR\fR: Select target architecture
+.RS 4
Selects the target architecture. The default architecture is
\(lqx86\(rq, which supports both the IA\-32 and derivatives and AMD64 instruction sets. To print a list of available architectures to standard output, use
\(lqhelp\(rq
\fIarch\fR. See
\fByasm_arch\fR(7)
for a list of supported architectures.
-.TP 3n
+.RE
+.PP
\fB\-f \fR\fB\fIformat\fR\fR or \fB\-\-oformat=\fR\fB\fIformat\fR\fR: Select object format
+.RS 4
Selects the output object format. The default object format is
\(lqbin\(rq, which is a flat format binary with no relocation. To print a list of available object formats to standard output, use
\(lqhelp\(rq
\fIformat\fR. See
\fByasm_objfmts\fR(7)
for a list of supported object formats.
-.TP 3n
+.RE
+.PP
\fB\-g \fR\fB\fIdebug\fR\fR or \fB\-\-dformat=\fR\fB\fIdebug\fR\fR: Select debugging format
+.RS 4
Selects the debugging format for debug information. Debugging information can be used by a debugger to associate executable code back to the source file or get data structure and type information. Available debug formats vary between different object formats;
\fByasm\fR
will error when an invalid combination is selected. The default object format is selected by the object format. To print a list of available debugging formats to standard output, use
\fIdebug\fR. See
\fByasm_dbgfmts\fR(7)
for a list of supported debugging formats.
-.TP 3n
+.RE
+.PP
\fB\-h\fR or \fB\-\-help\fR: Print a summary of options
+.RS 4
Prints a summary of invocation options. All other options are ignored, and no output file is generated.
-.TP 3n
+.RE
+.PP
\fB\-L \fR\fB\fIlist\fR\fR or \fB\-\-lformat=\fR\fB\fIlist\fR\fR: Select list file format
+.RS 4
Selects the format/style of the output list file. List files typically intermix the original source with the machine code generated by the assembler. The default list format is
\(lqnasm\(rq, which mimics the NASM list file format. To print a list of available list file formats to standard output, use
\(lqhelp\(rq
as
\fIlist\fR.
-.TP 3n
+.RE
+.PP
\fB\-l \fR\fB\fIlistfile\fR\fR or \fB\-\-list=\fR\fB\fIlistfile\fR\fR: Specify list filename
+.RS 4
Specifies the name of the output list file. If this option is not used, no list file is generated.
-.TP 3n
+.RE
+.PP
\fB\-m \fR\fB\fImachine\fR\fR or \fB\-\-machine=\fR\fB\fImachine\fR\fR: Select target machine architecture
+.RS 4
Selects the target machine architecture. Essentially a subtype of the selected architecture, the machine type selects between major subsets of an architecture. For example, for the
\(lqx86\(rq
architecture, the two available machines are
\fB\-a \fR\fB\fIarch\fR\fR. See
\fByasm_arch\fR(7)
for more details.
-.TP 3n
+.RE
+.PP
\fB\-o \fR\fB\fIfilename\fR\fR or \fB\-\-objfile=\fR\fB\fIfilename\fR\fR: Specify object filename
+.RS 4
Specifies the name of the output file, overriding any default name generated by Yasm.
-.TP 3n
+.RE
+.PP
\fB\-p \fR\fB\fIparser\fR\fR or \fB\-\-parser=\fR\fB\fIparser\fR\fR: Select parser
+.RS 4
Selects the parser (the assembler syntax). The default parser is
\(lqnasm\(rq, which emulates the syntax of NASM, the Netwide Assembler. Another available parser is
\(lqgas\(rq, which emulates the syntax of GNU AS. To print a list of available parsers to standard output, use
\fIparser\fR. See
\fByasm_parsers\fR(7)
for a list of supported parsers.
-.TP 3n
+.RE
+.PP
\fB\-r \fR\fB\fIpreproc\fR\fR or \fB\-\-preproc=\fR\fB\fIpreproc\fR\fR: Select preprocessor
+.RS 4
Selects the preprocessor to use on the input file before passing it to the parser. Preprocessors often provide macro functionality that is not included in the main parser. The default preprocessor is
\(lqnasm\(rq, which is an imported version of the actual NASM preprocessor. A
\(lqraw\(rq
\(lqhelp\(rq
as
\fIpreproc\fR.
-.TP 3n
+.RE
+.PP
\fB\-\-version\fR: Get the Yasm version
+.RS 4
This option causes Yasm to prints the version number of Yasm as well as a license summary to standard output. All other options are ignored, and no output file is generated.
-.\" end of SS subsection "General Options"
+.RE
.SS "Warning Options"
.PP
\fB\-W\fR
\fB\-Worphan\-labels\fR, all warnings are turned off
\fIexcept\fR
for orphan\-labels.
-.TP 3n
+.PP
\fB\-w\fR: Inhibit all warning messages
+.RS 4
This option causes Yasm to inhibit all warning messages. As discussed above, this option may be followed by other options to re\-enable specified warnings.
-.TP 3n
+.RE
+.PP
\fB\-Werror\fR: Treat warnings as errors
+.RS 4
This option causes Yasm to treat all warnings as errors. Normally warnings do not prevent an object file from being generated and do not result in a failure exit status from
\fByasm\fR, whereas errors do. This option makes warnings equivalent to errors in terms of this behavior.
-.TP 3n
+.RE
+.PP
\fB\-Wno\-unrecognized\-char\fR: Do not warn on unrecognized input characters
+.RS 4
Causes Yasm to not warn on unrecognized characters found in the input. Normally Yasm will generate a warning for any non\-ASCII character found in the input file.
-.TP 3n
+.RE
+.PP
\fB\-Worphan\-labels\fR: Warn on labels lacking a trailing option
+.RS 4
When using the NASM\-compatible parser, causes Yasm to warn about labels found alone on a line without a trailing colon. While these are legal labels in NASM syntax, they may be unintentional, due to typos or macro definition ordering.
-.TP 3n
+.RE
+.PP
\fB\-X \fR\fB\fIstyle\fR\fR: Change error/warning reporting style
+.RS 4
Selects a specific output style for error and warning messages. The default is
\(lqgnu\(rq
style, which mimics the output of
Visual Studio
or
Emacs, allowing the IDE to correctly recognize the error/warning message as such and link back to the offending line of source code.
-.\" end of SS subsection "Warning Options"
+.RE
.SS "Preprocessor Options"
.PP
While these preprocessor options theoretically will affect any preprocessor, the only preprocessor currently in Yasm is the
\(lqnasm\(rq
preprocessor.
-.TP 3n
+.PP
\fB\-D \fR\fB\fImacro[=value]\fR\fR: Pre\-define a macro
+.RS 4
Pre\-defines a single\-line macro. The value is optional (if no value is given, the macro is still defined, but to an empty value).
-.TP 3n
+.RE
+.PP
\fB\-e\fR or \fB\-\-preproc\-only\fR: Only preprocess
+.RS 4
Stops assembly after the preprocessing stage; preprocessed output is sent to the specified output name or, if no output name is specified, the standard output. No object file is produced.
-.TP 3n
+.RE
+.PP
\fB\-I \fR\fB\fIpath\fR\fR: Add include file path
+.RS 4
Adds directory
\fIpath\fR
to the search path for include files. The search path defaults to only including the directory in which the source file resides.
-.TP 3n
+.RE
+.PP
\fB\-P \fR\fB\fIfilename\fR\fR: Pre\-include a file
+.RS 4
Pre\-includes file
\fIfilename\fR, making it look as though
\fIfilename\fR
was prepended to the input. Can be useful for prepending multi\-line macros that the
\fB\-D\fR
can't support.
-.TP 3n
+.RE
+.PP
\fB\-U \fR\fB\fImacro\fR\fR: Undefine a macro
+.RS 4
Undefines a single\-line macro (may be either a built\-in macro or one defined earlier in the command line with
\fB\-D\fR.
-.\" end of SS subsection "Preprocessor Options"
+.RE
.SH "EXAMPLES"
.PP
To assemble NASM syntax, 32\-bit x86 source
into ELF file
\fIsource.o\fR, warning on orphan labels:
.sp
-.RS 3n
+.RS 4
.nf
yasm \-f elf32 \-Worphan\-labels source.asm
.fi
into Win64 file
\fIobject.obj\fR:
.sp
-.RS 3n
+.RS 4
.nf
yasm \-f win64 \-o object.obj x.asm
.fi
into flat binary file
\fIy.com\fR:
.sp
-.RS 3n
+.RS 4
.nf
yasm \-f bin \-r raw \-o y.com y.asm
.fi
\fBBITS 64\fR
directive) and generate a 32\-bit object file (by failing to specify
\fB\-m amd64\fR
-or selecting a 64\-bit object format such as ELF64 on the command line). Similarly, specifying
-\fB\-m amd64\fR
-does not default the BITS setting to 64. An easy way to avoid this is by directly specifying a 64\-bit object format such as
-\fB\-f elf64\fR.
+or selecting a 64\-bit object format such as ELF64 on the command line).
.SH "AUTHOR"
.PP
-\fBPeter\fR \fBJohnson\fR <peter@tortall.net>
+\fBPeter Johnson\fR <\&peter@tortall.net\&>
.sp -1n
-.IP "" 3n
+.IP "" 4
Author.
.SH "COPYRIGHT"
-Copyright \(co 2004, 2005, 2006 Peter Johnson
+Copyright \(co 2004, 2005, 2006, 2007 Peter Johnson
+.br
+