OLD | NEW |
| 1 '\" t |
1 .\" Title: yasm | 2 .\" Title: yasm |
2 .\" Author: Peter Johnson <peter@tortall.net> | 3 .\" Author: Peter Johnson <peter@tortall.net> |
3 .\" Generator: DocBook XSL Stylesheets v1.71.1 <http://docbook.sf.net/> | 4 .\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/> |
4 .\" Date: April 2007 | 5 .\" Date: April 2007 |
5 .\" Manual: The Yasm Modular Assembler | 6 .\" Manual: The Yasm Modular Assembler |
6 .\" Source: Yasm | 7 .\" Source: Yasm |
| 8 .\" Language: English |
7 .\" | 9 .\" |
8 .TH "YASM" "1" "April 2007" "Yasm" "The Yasm Modular Assembler" | 10 .TH "YASM" "1" "April 2007" "Yasm" "The Yasm Modular Assembler" |
| 11 .\" ----------------------------------------------------------------- |
| 12 .\" * set default formatting |
| 13 .\" ----------------------------------------------------------------- |
9 .\" disable hyphenation | 14 .\" disable hyphenation |
10 .nh | 15 .nh |
11 .\" disable justification (adjust text to left margin only) | 16 .\" disable justification (adjust text to left margin only) |
12 .ad l | 17 .ad l |
| 18 .\" ----------------------------------------------------------------- |
| 19 .\" * MAIN CONTENT STARTS HERE * |
| 20 .\" ----------------------------------------------------------------- |
13 .SH "NAME" | 21 .SH "NAME" |
14 yasm \- The Yasm Modular Assembler | 22 yasm \- The Yasm Modular Assembler |
15 .SH "SYNOPSIS" | 23 .SH "SYNOPSIS" |
16 .HP 5 | 24 .HP \w'\fByasm\fR\ 'u |
17 \fByasm\fR [\fB\-f\ \fR\fB\fIformat\fR\fR] [\fB\-o\ \fR\fB\fIoutfile\fR\fR] [\fB
\fIother\ options\fR\fR...] {\fIinfile\fR} | 25 \fByasm\fR [\fB\-f\ \fR\fB\fIformat\fR\fR] [\fB\-o\ \fR\fB\fIoutfile\fR\fR] [\fB
\fIother\ options\fR\fR...] {\fIinfile\fR} |
18 .HP 5 | 26 .HP \w'\fByasm\fR\ 'u |
19 \fByasm\fR \fB\-h\fR | 27 \fByasm\fR \fB\-h\fR |
20 .SH "DESCRIPTION" | 28 .SH "DESCRIPTION" |
21 .PP | 29 .PP |
22 The Yasm Modular Assembler is a portable, retargetable assembler written under t
he | 30 The Yasm Modular Assembler is a portable, retargetable assembler written under t
he |
23 \(lqnew\(rq | 31 \(lqnew\(rq |
24 (2 or 3 clause) BSD license. Yasm currently supports the x86 and AMD64 instructi
on sets, accepts NASM and GAS assembler syntaxes, outputs binary, ELF32, ELF64,
COFF, Win32, and Win64 object formats, and generates source debugging informatio
n in STABS, DWARF 2, and CodeView 8 formats. | 32 (2 or 3 clause) BSD license\&. Yasm currently supports the x86 and AMD64 instruc
tion sets, accepts NASM and GAS assembler syntaxes, outputs binary, ELF32, ELF64
, COFF, Win32, and Win64 object formats, and generates source debugging informat
ion in STABS, DWARF 2, and CodeView 8 formats\&. |
25 .PP | 33 .PP |
26 YASM consists of the | 34 YASM consists of the |
27 \fByasm\fR | 35 \fByasm\fR |
28 command, libyasm, the core backend library, and a large number of modules. Curre
ntly, libyasm and the loadable modules are statically built into the | 36 command, libyasm, the core backend library, and a large number of modules\&. Cur
rently, libyasm and the loadable modules are statically built into the |
29 \fByasm\fR | 37 \fByasm\fR |
30 executable. | 38 executable\&. |
31 .PP | 39 .PP |
32 The | 40 The |
33 \fByasm\fR | 41 \fByasm\fR |
34 command assembles the file infile and directs output to the file | 42 command assembles the file infile and directs output to the file |
35 \fIoutfile\fR | 43 \fIoutfile\fR |
36 if specified. If | 44 if specified\&. If |
37 \fIoutfile\fR | 45 \fIoutfile\fR |
38 is not specified, | 46 is not specified, |
39 \fByasm\fR | 47 \fByasm\fR |
40 will derive a default output file name from the name of its input file, usually
by appending | 48 will derive a default output file name from the name of its input file, usually
by appending |
41 \fI.o\fR | 49 \&.o |
42 or | 50 or |
43 \fI.obj\fR, or by removing all extensions for a raw binary file. Failing that, t
he output file name will be | 51 \&.obj, or by removing all extensions for a raw binary file\&. Failing that, the
output file name will be |
44 \fIyasm.out\fR. | 52 yasm\&.out\&. |
45 .PP | 53 .PP |
46 If called with an | 54 If called with an |
47 \fIinfile\fR | 55 \fIinfile\fR |
48 of | 56 of |
49 \(lq\-\(rq, | 57 \(lq\-\(rq, |
50 \fByasm\fR | 58 \fByasm\fR |
51 assembles the standard input and directs output to the file | 59 assembles the standard input and directs output to the file |
52 \fIoutfile\fR, or | 60 \fIoutfile\fR, or |
53 \fIyasm.out\fR | 61 yasm\&.out |
54 if no | 62 if no |
55 \fIoutfile\fR | 63 \fIoutfile\fR |
56 is specified. | 64 is specified\&. |
57 .SH "OPTIONS" | 65 .SH "OPTIONS" |
58 .PP | 66 .PP |
59 Many options may be given in one of two forms: either a dash followed by a singl
e letter, or two dashes followed by a long option name. Options are listed in al
phabetical order. | 67 Many options may be given in one of two forms: either a dash followed by a singl
e letter, or two dashes followed by a long option name\&. Options are listed in
alphabetical order\&. |
60 .SS "General Options" | 68 .SS "General Options" |
61 .PP | 69 .PP |
62 \fB\-a \fR\fB\fIarch\fR\fR or \fB\-\-arch=\fR\fB\fIarch\fR\fR: Select target arc
hitecture | 70 \fB\-a \fR\fB\fIarch\fR\fR or \fB\-\-arch=\fR\fB\fIarch\fR\fR: Select target arc
hitecture |
63 .RS 4 | 71 .RS 4 |
64 Selects the target architecture. The default architecture is | 72 Selects the target architecture\&. The default architecture is |
65 \(lqx86\(rq, which supports both the IA\-32 and derivatives and AMD64 instructio
n sets. To print a list of available architectures to standard output, use | 73 \(lqx86\(rq, which supports both the IA\-32 and derivatives and AMD64 instructio
n sets\&. To print a list of available architectures to standard output, use |
66 \(lqhelp\(rq | 74 \(lqhelp\(rq |
67 as | 75 as |
68 \fIarch\fR. See | 76 \fIarch\fR\&. See |
69 \fByasm_arch\fR(7) | 77 \fByasm_arch\fR(7) |
70 for a list of supported architectures. | 78 for a list of supported architectures\&. |
71 .RE | 79 .RE |
72 .PP | 80 .PP |
73 \fB\-f \fR\fB\fIformat\fR\fR or \fB\-\-oformat=\fR\fB\fIformat\fR\fR: Select obj
ect format | 81 \fB\-f \fR\fB\fIformat\fR\fR or \fB\-\-oformat=\fR\fB\fIformat\fR\fR: Select obj
ect format |
74 .RS 4 | 82 .RS 4 |
75 Selects the output object format. The default object format is | 83 Selects the output object format\&. The default object format is |
76 \(lqbin\(rq, which is a flat format binary with no relocation. To print a list o
f available object formats to standard output, use | 84 \(lqbin\(rq, which is a flat format binary with no relocation\&. To print a list
of available object formats to standard output, use |
77 \(lqhelp\(rq | 85 \(lqhelp\(rq |
78 as | 86 as |
79 \fIformat\fR. See | 87 \fIformat\fR\&. See |
80 \fByasm_objfmts\fR(7) | 88 \fByasm_objfmts\fR(7) |
81 for a list of supported object formats. | 89 for a list of supported object formats\&. |
82 .RE | 90 .RE |
83 .PP | 91 .PP |
84 \fB\-g \fR\fB\fIdebug\fR\fR or \fB\-\-dformat=\fR\fB\fIdebug\fR\fR: Select debug
ging format | 92 \fB\-g \fR\fB\fIdebug\fR\fR or \fB\-\-dformat=\fR\fB\fIdebug\fR\fR: Select debug
ging format |
85 .RS 4 | 93 .RS 4 |
86 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 differ
ent object formats; | 94 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 ge
t data structure and type information\&. Available debug formats vary between di
fferent object formats; |
87 \fByasm\fR | 95 \fByasm\fR |
88 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 t
o standard output, use | 96 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 forma
ts to standard output, use |
89 \(lqhelp\(rq | 97 \(lqhelp\(rq |
90 as | 98 as |
91 \fIdebug\fR. See | 99 \fIdebug\fR\&. See |
92 \fByasm_dbgfmts\fR(7) | 100 \fByasm_dbgfmts\fR(7) |
93 for a list of supported debugging formats. | 101 for a list of supported debugging formats\&. |
| 102 .RE |
| 103 .PP |
| 104 \fB\-L \fR\fB\fIlist\fR\fR or \fB\-\-lformat=\fR\fB\fIlist\fR\fR: Select list fi
le format |
| 105 .RS 4 |
| 106 Selects the format/style of the output list file\&. List files typically intermi
x the original source with the machine code generated by the assembler\&. The de
fault list format is |
| 107 \(lqnasm\(rq, which mimics the NASM list file format\&. To print a list of avail
able list file formats to standard output, use |
| 108 \(lqhelp\(rq |
| 109 as |
| 110 \fIlist\fR\&. |
| 111 .RE |
| 112 .PP |
| 113 \fB\-l \fR\fB\fIlistfile\fR\fR or \fB\-\-list=\fR\fB\fIlistfile\fR\fR: Specify l
ist filename |
| 114 .RS 4 |
| 115 Specifies the name of the output list file\&. If this option is not used, no lis
t file is generated\&. |
| 116 .RE |
| 117 .PP |
| 118 \fB\-m \fR\fB\fImachine\fR\fR or \fB\-\-machine=\fR\fB\fImachine\fR\fR: Select t
arget machine architecture |
| 119 .RS 4 |
| 120 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 |
| 121 \(lqx86\(rq |
| 122 architecture, the two available machines are |
| 123 \(lqx86\(rq, which is used for the IA\-32 and derivative 32\-bit instruction set
, and |
| 124 \(lqamd64\(rq, which is used for the 64\-bit instruction set\&. This differentia
tion is required to generate the proper object file for relocatable object forma
ts such as COFF and ELF\&. To print a list of available machines for a given arc
hitecture to standard output, use |
| 125 \(lqhelp\(rq |
| 126 as |
| 127 \fImachine\fR |
| 128 and the given architecture using |
| 129 \fB\-a \fR\fB\fIarch\fR\fR\&. See |
| 130 \fByasm_arch\fR(7) |
| 131 for more details\&. |
| 132 .RE |
| 133 .PP |
| 134 \fB\-o \fR\fB\fIfilename\fR\fR or \fB\-\-objfile=\fR\fB\fIfilename\fR\fR: Specif
y object filename |
| 135 .RS 4 |
| 136 Specifies the name of the output file, overriding any default name generated by
Yasm\&. |
| 137 .RE |
| 138 .PP |
| 139 \fB\-p \fR\fB\fIparser\fR\fR or \fB\-\-parser=\fR\fB\fIparser\fR\fR: Select pars
er |
| 140 .RS 4 |
| 141 Selects the parser (the assembler syntax)\&. The default parser is |
| 142 \(lqnasm\(rq, which emulates the syntax of NASM, the Netwide Assembler\&. Anothe
r available parser is |
| 143 \(lqgas\(rq, which emulates the syntax of GNU AS\&. To print a list of available
parsers to standard output, use |
| 144 \(lqhelp\(rq |
| 145 as |
| 146 \fIparser\fR\&. See |
| 147 \fByasm_parsers\fR(7) |
| 148 for a list of supported parsers\&. |
| 149 .RE |
| 150 .PP |
| 151 \fB\-r \fR\fB\fIpreproc\fR\fR or \fB\-\-preproc=\fR\fB\fIpreproc\fR\fR: Select p
reprocessor |
| 152 .RS 4 |
| 153 Selects the preprocessor to use on the input file before passing it to the parse
r\&. Preprocessors often provide macro functionality that is not included in the
main parser\&. The default preprocessor is |
| 154 \(lqnasm\(rq, which is an imported version of the actual NASM preprocessor\&. A |
| 155 \(lqraw\(rq |
| 156 preprocessor is also available, which simply skips the preprocessing step, passi
ng the input file directly to the parser\&. To print a list of available preproc
essors to standard output, use |
| 157 \(lqhelp\(rq |
| 158 as |
| 159 \fIpreproc\fR\&. |
94 .RE | 160 .RE |
95 .PP | 161 .PP |
96 \fB\-h\fR or \fB\-\-help\fR: Print a summary of options | 162 \fB\-h\fR or \fB\-\-help\fR: Print a summary of options |
97 .RS 4 | 163 .RS 4 |
98 Prints a summary of invocation options. All other options are ignored, and no ou
tput file is generated. | 164 Prints a summary of invocation options\&. All other options are ignored, and no
output file is generated\&. |
99 .RE | |
100 .PP | |
101 \fB\-L \fR\fB\fIlist\fR\fR or \fB\-\-lformat=\fR\fB\fIlist\fR\fR: Select list fi
le format | |
102 .RS 4 | |
103 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 defaul
t list format is | |
104 \(lqnasm\(rq, which mimics the NASM list file format. To print a list of availab
le list file formats to standard output, use | |
105 \(lqhelp\(rq | |
106 as | |
107 \fIlist\fR. | |
108 .RE | |
109 .PP | |
110 \fB\-l \fR\fB\fIlistfile\fR\fR or \fB\-\-list=\fR\fB\fIlistfile\fR\fR: Specify l
ist filename | |
111 .RS 4 | |
112 Specifies the name of the output list file. If this option is not used, no list
file is generated. | |
113 .RE | |
114 .PP | |
115 \fB\-m \fR\fB\fImachine\fR\fR or \fB\-\-machine=\fR\fB\fImachine\fR\fR: Select t
arget machine architecture | |
116 .RS 4 | |
117 Selects the target machine architecture. Essentially a subtype of the selected a
rchitecture, the machine type selects between major subsets of an architecture.
For example, for the | |
118 \(lqx86\(rq | |
119 architecture, the two available machines are | |
120 \(lqx86\(rq, which is used for the IA\-32 and derivative 32\-bit instruction set
, and | |
121 \(lqamd64\(rq, which is used for the 64\-bit instruction set. This differentiati
on is required to generate the proper object file for relocatable object formats
such as COFF and ELF. To print a list of available machines for a given archite
cture to standard output, use | |
122 \(lqhelp\(rq | |
123 as | |
124 \fImachine\fR | |
125 and the given architecture using | |
126 \fB\-a \fR\fB\fIarch\fR\fR. See | |
127 \fByasm_arch\fR(7) | |
128 for more details. | |
129 .RE | |
130 .PP | |
131 \fB\-o \fR\fB\fIfilename\fR\fR or \fB\-\-objfile=\fR\fB\fIfilename\fR\fR: Specif
y object filename | |
132 .RS 4 | |
133 Specifies the name of the output file, overriding any default name generated by
Yasm. | |
134 .RE | |
135 .PP | |
136 \fB\-p \fR\fB\fIparser\fR\fR or \fB\-\-parser=\fR\fB\fIparser\fR\fR: Select pars
er | |
137 .RS 4 | |
138 Selects the parser (the assembler syntax). The default parser is | |
139 \(lqnasm\(rq, which emulates the syntax of NASM, the Netwide Assembler. Another
available parser is | |
140 \(lqgas\(rq, which emulates the syntax of GNU AS. To print a list of available p
arsers to standard output, use | |
141 \(lqhelp\(rq | |
142 as | |
143 \fIparser\fR. See | |
144 \fByasm_parsers\fR(7) | |
145 for a list of supported parsers. | |
146 .RE | |
147 .PP | |
148 \fB\-r \fR\fB\fIpreproc\fR\fR or \fB\-\-preproc=\fR\fB\fIpreproc\fR\fR: Select p
reprocessor | |
149 .RS 4 | |
150 Selects the preprocessor to use on the input file before passing it to the parse
r. Preprocessors often provide macro functionality that is not included in the m
ain parser. The default preprocessor is | |
151 \(lqnasm\(rq, which is an imported version of the actual NASM preprocessor. A | |
152 \(lqraw\(rq | |
153 preprocessor is also available, which simply skips the preprocessing step, passi
ng the input file directly to the parser. To print a list of available preproces
sors to standard output, use | |
154 \(lqhelp\(rq | |
155 as | |
156 \fIpreproc\fR. | |
157 .RE | 165 .RE |
158 .PP | 166 .PP |
159 \fB\-\-version\fR: Get the Yasm version | 167 \fB\-\-version\fR: Get the Yasm version |
160 .RS 4 | 168 .RS 4 |
161 This option causes Yasm to prints the version number of Yasm as well as a licens
e summary to standard output. All other options are ignored, and no output file
is generated. | 169 This option causes Yasm to prints the version number of Yasm as well as a licens
e summary to standard output\&. All other options are ignored, and no output fil
e is generated\&. |
162 .RE | 170 .RE |
163 .SS "Warning Options" | 171 .SS "Warning Options" |
164 .PP | 172 .PP |
165 \fB\-W\fR | 173 \fB\-W\fR |
166 options have two contrary forms: | 174 options have two contrary forms: |
167 \fB\-W\fR\fB\fIname\fR\fR | 175 \fB\-W\fR\fB\fIname\fR\fR |
168 and | 176 and |
169 \fB\-Wno\-\fR\fB\fIname\fR\fR. Only the non\-default forms are shown here. | 177 \fB\-Wno\-\fR\fB\fIname\fR\fR\&. Only the non\-default forms are shown here\&. |
170 .PP | 178 .PP |
171 The warning options are handled in the order given on the command line, so if | 179 The warning options are handled in the order given on the command line, so if |
172 \fB\-w\fR | 180 \fB\-w\fR |
173 is followed by | 181 is followed by |
174 \fB\-Worphan\-labels\fR, all warnings are turned off | 182 \fB\-Worphan\-labels\fR, all warnings are turned off |
175 \fIexcept\fR | 183 \fIexcept\fR |
176 for orphan\-labels. | 184 for orphan\-labels\&. |
177 .PP | 185 .PP |
178 \fB\-w\fR: Inhibit all warning messages | 186 \fB\-w\fR: Inhibit all warning messages |
179 .RS 4 | 187 .RS 4 |
180 This option causes Yasm to inhibit all warning messages. As discussed above, thi
s option may be followed by other options to re\-enable specified warnings. | 188 This option causes Yasm to inhibit all warning messages\&. As discussed above, t
his option may be followed by other options to re\-enable specified warnings\&. |
181 .RE | 189 .RE |
182 .PP | 190 .PP |
183 \fB\-Werror\fR: Treat warnings as errors | 191 \fB\-Werror\fR: Treat warnings as errors |
184 .RS 4 | 192 .RS 4 |
185 This option causes Yasm to treat all warnings as errors. Normally warnings do no
t prevent an object file from being generated and do not result in a failure exi
t status from | 193 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 e
xit status from |
186 \fByasm\fR, whereas errors do. This option makes warnings equivalent to errors i
n terms of this behavior. | 194 \fByasm\fR, whereas errors do\&. This option makes warnings equivalent to errors
in terms of this behavior\&. |
187 .RE | 195 .RE |
188 .PP | 196 .PP |
189 \fB\-Wno\-unrecognized\-char\fR: Do not warn on unrecognized input characters | 197 \fB\-Wno\-unrecognized\-char\fR: Do not warn on unrecognized input characters |
190 .RS 4 | 198 .RS 4 |
191 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 fil
e. | 199 Causes Yasm to not warn on unrecognized characters found in the input\&. Normall
y Yasm will generate a warning for any non\-ASCII character found in the input f
ile\&. |
192 .RE | 200 .RE |
193 .PP | 201 .PP |
194 \fB\-Worphan\-labels\fR: Warn on labels lacking a trailing option | 202 \fB\-Worphan\-labels\fR: Warn on labels lacking a trailing option |
195 .RS 4 | 203 .RS 4 |
196 When using the NASM\-compatible parser, causes Yasm to warn about labels found a
lone on a line without a trailing colon. While these are legal labels in NASM sy
ntax, they may be unintentional, due to typos or macro definition ordering. | 204 When using the NASM\-compatible parser, causes Yasm to warn about labels found a
lone 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\&. |
197 .RE | 205 .RE |
198 .PP | 206 .PP |
199 \fB\-X \fR\fB\fIstyle\fR\fR: Change error/warning reporting style | 207 \fB\-X \fR\fB\fIstyle\fR\fR: Change error/warning reporting style |
200 .RS 4 | 208 .RS 4 |
201 Selects a specific output style for error and warning messages. The default is | 209 Selects a specific output style for error and warning messages\&. The default is |
202 \(lqgnu\(rq | 210 \(lqgnu\(rq |
203 style, which mimics the output of | 211 style, which mimics the output of |
204 \fBgcc\fR. The | 212 \fBgcc\fR\&. The |
205 \(lqvc\(rq | 213 \(lqvc\(rq |
206 style is also available, which mimics the output of Microsoft's Visual C++ compi
ler. | 214 style is also available, which mimics the output of Microsoft\'s Visual C++ comp
iler\&. |
207 .sp | 215 .sp |
208 This option is available so that Yasm integrates more naturally into IDE environ
ments such as | 216 This option is available so that Yasm integrates more naturally into IDE environ
ments such as |
209 Visual Studio | 217 Visual Studio |
210 or | 218 or |
211 Emacs, allowing the IDE to correctly recognize the error/warning message as such
and link back to the offending line of source code. | 219 Emacs, allowing the IDE to correctly recognize the error/warning message as such
and link back to the offending line of source code\&. |
212 .RE | 220 .RE |
213 .SS "Preprocessor Options" | 221 .SS "Preprocessor Options" |
214 .PP | 222 .PP |
215 While these preprocessor options theoretically will affect any preprocessor, the
only preprocessor currently in Yasm is the | 223 While these preprocessor options theoretically will affect any preprocessor, the
only preprocessor currently in Yasm is the |
216 \(lqnasm\(rq | 224 \(lqnasm\(rq |
217 preprocessor. | 225 preprocessor\&. |
218 .PP | 226 .PP |
219 \fB\-D \fR\fB\fImacro[=value]\fR\fR: Pre\-define a macro | 227 \fB\-D \fR\fB\fImacro[=value]\fR\fR: Pre\-define a macro |
220 .RS 4 | 228 .RS 4 |
221 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). | 229 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)\&. |
222 .RE | 230 .RE |
223 .PP | 231 .PP |
224 \fB\-e\fR or \fB\-\-preproc\-only\fR: Only preprocess | 232 \fB\-e\fR or \fB\-\-preproc\-only\fR: Only preprocess |
225 .RS 4 | 233 .RS 4 |
226 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. | 234 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\&. |
227 .RE | 235 .RE |
228 .PP | 236 .PP |
229 \fB\-I \fR\fB\fIpath\fR\fR: Add include file path | 237 \fB\-I \fR\fB\fIpath\fR\fR: Add include file path |
230 .RS 4 | 238 .RS 4 |
231 Adds directory | 239 Adds directory |
232 \fIpath\fR | 240 \fIpath\fR |
233 to the search path for include files. The search path defaults to only including
the directory in which the source file resides. | 241 to the search path for include files\&. The search path defaults to only includi
ng the directory in which the source file resides\&. |
234 .RE | 242 .RE |
235 .PP | 243 .PP |
236 \fB\-P \fR\fB\fIfilename\fR\fR: Pre\-include a file | 244 \fB\-P \fR\fB\fIfilename\fR\fR: Pre\-include a file |
237 .RS 4 | 245 .RS 4 |
238 Pre\-includes file | 246 Pre\-includes file |
239 \fIfilename\fR, making it look as though | 247 \fIfilename\fR, making it look as though |
240 \fIfilename\fR | 248 \fIfilename\fR |
241 was prepended to the input. Can be useful for prepending multi\-line macros that
the | 249 was prepended to the input\&. Can be useful for prepending multi\-line macros th
at the |
242 \fB\-D\fR | 250 \fB\-D\fR |
243 can't support. | 251 can\'t support\&. |
244 .RE | 252 .RE |
245 .PP | 253 .PP |
246 \fB\-U \fR\fB\fImacro\fR\fR: Undefine a macro | 254 \fB\-U \fR\fB\fImacro\fR\fR: Undefine a macro |
247 .RS 4 | 255 .RS 4 |
248 Undefines a single\-line macro (may be either a built\-in macro or one defined e
arlier in the command line with | 256 Undefines a single\-line macro (may be either a built\-in macro or one defined e
arlier in the command line with |
249 \fB\-D\fR. | 257 \fB\-D\fR\&. |
250 .RE | 258 .RE |
251 .SH "EXAMPLES" | 259 .SH "EXAMPLES" |
252 .PP | 260 .PP |
253 To assemble NASM syntax, 32\-bit x86 source | 261 To assemble NASM syntax, 32\-bit x86 source |
254 \fIsource.asm\fR | 262 source\&.asm |
255 into ELF file | 263 into ELF file |
256 \fIsource.o\fR, warning on orphan labels: | 264 source\&.o, warning on orphan labels: |
257 .sp | 265 .sp |
| 266 .if n \{\ |
258 .RS 4 | 267 .RS 4 |
| 268 .\} |
259 .nf | 269 .nf |
260 yasm \-f elf32 \-Worphan\-labels source.asm | 270 yasm \-f elf32 \-Worphan\-labels source\&.asm |
261 .fi | 271 .fi |
| 272 .if n \{\ |
262 .RE | 273 .RE |
| 274 .\} |
263 .PP | 275 .PP |
264 To assemble NASM syntax AMD64 source | 276 To assemble NASM syntax AMD64 source |
265 \fIx.asm\fR | 277 x\&.asm |
266 into Win64 file | 278 into Win64 file |
267 \fIobject.obj\fR: | 279 object\&.obj: |
268 .sp | 280 .sp |
| 281 .if n \{\ |
269 .RS 4 | 282 .RS 4 |
| 283 .\} |
270 .nf | 284 .nf |
271 yasm \-f win64 \-o object.obj x.asm | 285 yasm \-f win64 \-o object\&.obj x\&.asm |
272 .fi | 286 .fi |
| 287 .if n \{\ |
273 .RE | 288 .RE |
| 289 .\} |
274 .PP | 290 .PP |
275 To assemble already preprocessed NASM syntax x86 source | 291 To assemble already preprocessed NASM syntax x86 source |
276 \fIy.asm\fR | 292 y\&.asm |
277 into flat binary file | 293 into flat binary file |
278 \fIy.com\fR: | 294 y\&.com: |
279 .sp | 295 .sp |
| 296 .if n \{\ |
280 .RS 4 | 297 .RS 4 |
| 298 .\} |
281 .nf | 299 .nf |
282 yasm \-f bin \-r raw \-o y.com y.asm | 300 yasm \-f bin \-r raw \-o y\&.com y\&.asm |
283 .fi | 301 .fi |
| 302 .if n \{\ |
284 .RE | 303 .RE |
| 304 .\} |
285 .SH "DIAGNOSTICS" | 305 .SH "DIAGNOSTICS" |
286 .PP | 306 .PP |
287 The | 307 The |
288 \fByasm\fR | 308 \fByasm\fR |
289 command exits 0 on success, and nonzero if an error occurs. | 309 command exits 0 on success, and nonzero if an error occurs\&. |
290 .SH "COMPATIBILITY" | 310 .SH "COMPATIBILITY" |
291 .PP | 311 .PP |
292 Yasm's NASM parser and preprocessor, while they strive to be as compatible as po
ssible with NASM, have a few incompatibilities due to YASM's different internal
structure. | 312 Yasm\'s NASM parser and preprocessor, while they strive to be as compatible as p
ossible with NASM, have a few incompatibilities due to YASM\'s different interna
l structure\&. |
293 .PP | 313 .PP |
294 Yasm's GAS parser and preprocessor are missing a number of features present in G
NU AS. | 314 Yasm\'s GAS parser and preprocessor are missing a number of features present in
GNU AS\&. |
295 .SH "RESTRICTIONS" | 315 .SH "RESTRICTIONS" |
296 .PP | 316 .PP |
297 As object files are often architecture and machine dependent, not all combinatio
ns of object formats, architectures, and machines are legal; trying to use an in
valid combination will result in an error. | 317 As object files are often architecture and machine dependent, not all combinatio
ns of object formats, architectures, and machines are legal; trying to use an in
valid combination will result in an error\&. |
298 .PP | 318 .PP |
299 There is no support for symbol maps. | 319 There is no support for symbol maps\&. |
300 .SH "SEE ALSO" | 320 .SH "SEE ALSO" |
301 .PP | 321 .PP |
302 \fByasm_arch\fR(7), | 322 \fByasm_arch\fR(7), |
303 \fByasm_dbgfmts\fR(7), | 323 \fByasm_dbgfmts\fR(7), |
304 \fByasm_objfmts\fR(7), | 324 \fByasm_objfmts\fR(7), |
305 \fByasm_parsers\fR(7) | 325 \fByasm_parsers\fR(7) |
306 .PP | 326 .PP |
307 Related tools: | 327 Related tools: |
308 \fBas\fR(1), | 328 \fBas\fR(1), |
309 \fBld\fR(1), | 329 \fBld\fR(1), |
310 \fBnasm\fR(1) | 330 \fBnasm\fR(1) |
311 .SH "BUGS" | 331 .SH "BUGS" |
312 .PP | 332 .PP |
313 When using the | 333 When using the |
314 \(lqx86\(rq | 334 \(lqx86\(rq |
315 architecture, it is overly easy to generate AMD64 code (using the | 335 architecture, it is overly easy to generate AMD64 code (using the |
316 \fBBITS 64\fR | 336 \fBBITS 64\fR |
317 directive) and generate a 32\-bit object file (by failing to specify | 337 directive) and generate a 32\-bit object file (by failing to specify |
318 \fB\-m amd64\fR | 338 \fB\-m amd64\fR |
319 or selecting a 64\-bit object format such as ELF64 on the command line). | 339 or selecting a 64\-bit object format such as ELF64 on the command line)\&. |
320 .SH "AUTHOR" | 340 .SH "AUTHOR" |
321 .PP | 341 .PP |
322 \fBPeter Johnson\fR <\&peter@tortall.net\&> | 342 \fBPeter Johnson\fR <\&peter@tortall\&.net\&> |
323 .sp -1n | 343 .RS 4 |
324 .IP "" 4 | |
325 Author. | 344 Author. |
| 345 .RE |
326 .SH "COPYRIGHT" | 346 .SH "COPYRIGHT" |
| 347 .br |
327 Copyright \(co 2004, 2005, 2006, 2007 Peter Johnson | 348 Copyright \(co 2004, 2005, 2006, 2007 Peter Johnson |
328 .br | 349 .br |
329 | |
OLD | NEW |