Subversion Repositories pentevo

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1186 savelij 1
.TH asl 1
2
 
3
.SH NAME
4
.B asl \- cross assembler for microprocessors and -controllers
5
 
6
.SH SYNTAX
7
.B asl 
8
[ option(s) ] file(s) [ option(s) ] file(s) ...
9
 
10
.SH DESCRIPTION
11
 
12
AS is a cross assembler that can be used to write assembler programs
13
for a variety of different microprocessors and -controllers.
14
.B asl
15
is the UNIX/C implementation of AS.  A complete description of AS is
16
far beyond the scope of this manual page, which is only intended as
17
a quick reference for AS's command line interface.  For a more detailed
18
introduction into the usage of AS, see the user's manual.
19
 
20
.SH COMMAND-LINE PARAMETERS
21
 
22
Every argument that starts with a slash (/), plus (+) or minus (-) sign
23
is regarded as a command-line parameter.  Some command-line parameters
24
take an argument as additional parameter.  Every argument that is not
25
recognized as a command-line parameter is regarded as an assembler source
26
file to be assembled.  A source file name that does not have an extension
27
is automatically extended with the default extension '.asm'.
28
Options are turned on with a parameter starting with
29
a slash (/) or minus sign (-), whereas a parameter with a leading plus sign
30
(+) turns an option off.  In the following list, all options will be shown in
31
the form that is needed to change the default behaviour, which might be a 
32
plus or minus sign, depening on wether the option is on or off by default.
33
 
34
.B asl
35
accepts the following command-line parameters:
36
.TP
37
.B -A
38
 
39
Change the data structure that is internally used to store the symbol table.
40
By default, AS uses binary trees to store macro and symbol definitions.  Turning
41
this option on will change this to AVL-balanced trees.  Depending on the ratio
42
of symbol entries and lookups, this might speed up assembly.  Using AVL-balanced
43
trees helps also reducing the stack usage, which is however irrelevant for the C
44
version of AS.
45
.TP
46
.B -a
47
 
48
Instruct AS to write out the shared symbol definitions in a format suitable
49
for including into an AS assembler program.  The file's name is constructed by
50
replacing the source file's extension with '.inc'.  See the user manual for more
51
information about symbol sharing.
52
.TP
53
.B -cpu <name>
54
Set the target processor to <name>.  Use this option if the source file does
55
not contain a CPU statement.
56
.TP
57
.B -alias <new name=old name>
58
Define a CPU alias.  An alias is a name that can be used as an argument to the
59
CPU pseudo-instruction just like an intrinsic CPU type.  Its usage will set
60
the same target as the old name, however the predefined symbols MOMCPU and
61
MOMCPUNAME will be set to the new name.  This option is primarily useful for
62
adding a new member to a processor family that has the same core, but is 
63
different in its internal peripherals, thus allowing to distinguish between
64
them.
65
.TP
66
.B -C
67
 
68
Add a cross reference table to the assembler listing.  A cross reference
69
table lists all symbols that have been referenced at least once during assembly,
70
including the source line number(s) and count of every reference.  This option
71
only makes sense when the generation of an assembly listing has been turned on
72
via the
73
.B -L
74
or
75
.B -l
76
parameters.
77
.TP
78
.B -c
79
 
80
Instruct AS to write out the shared symbol definitions in a format suitable
81
for including into a C program.  The file's name is constructed by replacing
82
the source file's extension with '.h'. See the user manual for more information
83
about symbol sharing.
84
.TP
85
.B -compmode
86
Enable the 'compatibility mode', which aims at making the behaviour of AS more
87
like the respective 'original assembler' in some situations.  See the manual for
88
target-specific details.
89
.TP
90
.B -D <name[=value]>[,...]
91
Pre-define symbols.  Predefined symbols are entered into the global symbol
92
table prior to assembly of the source file(s).  If no value is given for a
93
symbol, it is assigned the integer value 1.  Value expressions may contain
94
arithmetic expressions as described in the user manual, but they may not 
95
reference any other predefined or internal symbols.
96
.TP
97
.B -E [file]
98
Force AS to send warning and error messages to
99
.B file
100
rather than to the standard error output.  The file names !0 to !4 are used
101
to refer to the standard input, output, error, auxilliary, and printer channels
102
predefined by the operating system (on some systems, some of these handles
103
might not exist).  If the [file] specification is omitted, a name is constructed
104
by replacing the source file's extension with '.log'.
105
.TP
106
.B +G
107
Supress code generation, reducing the functionality of AS to macro
108
preprocessing.
109
.TP
110
.B -g [MAP|Atmel|NoICE]
111
 
112
Instruct AS to write an additional file containing debug information. This
113
information covers the symbol table and the relation between source line
114
numbers and machine addresses.  The argument specifies whether debug info
115
shall be written in AS's own MAP format, the object format for Atmel's AVR
116
tools, or a command file suitable for John Hartman's NoICE.  If no argument
117
is given, MAP will be chosen.  The file's name is constructed by replacing
118
the source file's extension with '.map', '.obj', or '.noi' respectively.
119
.TP
120
.B -gnuerrors
121
 
122
Output errors and their location in the source code in a format similar
123
to the GNU C compiler, thus making it easier to integrate AS into
124
environments designed for this format.  Note that in contrast to the
125
standard format used by AS, locations inside macros are not reported!
126
.TP
127
.B -maxerrors <num>
128
 
129
Force AS to terminate assembly after the given number of errors occured.
130
.TP
131
.B -maxinclevel <num>
132
 
133
Limit the maximum nesting level of include statements to the given number.
134
By default, this limit is set to 200.
135
.TP
136
.B -werror
137
 
138
Force AS to treat warnings as errors.
139
.TP
140
.B -h
141
 
142
Force AS to print all hexadecimal constants with lowercase letters, rather
143
than with uppercase letters A..F which is the default.
144
.TP
145
.B -listradix <2..36>
146
Set the number system to be used in the listing.  By default, all integer
147
values are printed in hex, but an arbitrary base between 2 and 36 may be
148
used via this switch.
149
.TP
150
.B -splitbyte [character]
151
 
152
Use split-byte display of numbers in the listing, e.g. to obtain split
153
octal notation.
154
.TP
155
.B -i <path[:path...]>
156
Add new entries to the list of paths that are searched for include files.
157
New entries are prepended to the current include path list, so if multiple
158
paths are given with one command-line parameter, they will be entered into
159
the path list in reverse order.
160
.TP
161
.B -I
162
 
163
Add an include file list to the assembly listing.  An include file list contains
164
all files that have been included while assembling the source files, including
165
multiple and nested inclusion.  Nesting of inclusion is identified by different
166
indention.  This option only makes sense when the generation of an assembly
167
listing has been turned on via the
168
.B -L
169
or
170
.B -l
171
parameters.
172
.TP
173
.B -L
174
 
175
Turn on generation of an assembly listing and send it to a file whose name is
176
constructed by replacing the source file's extension with '.lst'.
177
.TP
178
.B -l
179
 
180
Turn on generation of an assembly listing and send it to the console.
181
.TP
182
.B -olist <file name>
183
Override the default path and file name for the file the listing is written to.
184
.TP
185
.B -M
186
 
187
Turn on generation of a macro definition file.  A macro definition file is
188
a file that contains all macro definitions that have been detected during
189
assembly, in a format suitable for an inclusion into another file.  The macro
190
definition file's name is constructed by replacing the source file's
191
extension with '.mac'.
192
.TP
193
.B -n
194
 
195
Force AS to extend all error and warning messages with their internal error
196
resp. warning number.
197
.TP
198
.B -noicemask [mask]
199
By default, AS will only write symbols to the NoICE debug info that are
200
located in the code segment.  By changing this binary mask, more and/or 
201
different masks may be chosen.  The assignment is bit 1=code, 2=data, 
202
3=idata, 4=xdata, 5=ydata, 6=bitdata, 7=io, 8=reg, 9=romdata .  Negating
203
this option reverts the mask to code-only.
204
.TP
205
.B -o <name>
206
Tell AS to write the code output to a file <name>.  By default, the code
207
output file's name is constructed by replacing the source file's extension
208
with '.p'.  If multiple files are assembled with one command, this parameter
209
may also be given multiply.  If there are less output specifications than
210
source file names, AS will switch back to the default naming convention after 
211
all output specifications have been used up.
212
.TP
213
.B -olist <name>
214
 
215
Tell AS to write the assembly lsting to a file <name>, instead of a file
216
with the standard name in the source file's directory.  This option only
217
makes sense when an assembly listing has been requested via the '-L' option.
218
.TP
219
.B -shareout <name>
220
 
221
Tell AS to write shared symbol definitions to a file <name>, instead of
222
constructing the name from the source file's name. See the user manual for
223
more information about symbol sharing.
224
.TP
225
.B -P
226
 
227
Turn on generation of a macro output file.  A macro output file contains the
228
intermediate source code that remains after macro expansion and conditional assembly.
229
The macro output file's  name is constructed by replacing the source file's
230
extension with '.i'.
231
.TP
232
.B -p
233
 
234
Instruct AS to write out the shared symbol definitions in a format suitable
235
for including into a Pascal or Modula-2 program.  The file's name is
236
constructed by replacing the source file's extension with '.inc'. See the
237
user manual for more information about symbol sharing.
238
.TP
239
.B -q or -quiet
240
Turn on silent assembly mode.  In silent compilation mode, AS will not
241
do any console output except for warning and error messages.
242
.TP
243
.B -r [pass number]
244
Tell AS to output warnings when a situation appears in a source file that
245
forces another pass of assembly.  Such situations either take place when a symbol
246
is undefined in the first pass or a symbol's value has changed compared to the 
247
previous pass.  This option is useful to track down sources of excessive
248
multi-passing, but be aware that it might yield a fairly large number of
249
warnings, especially in the first pass.  Optionally, a pass number may be added
250
to this option to inhibit output until a certain pass is reached.
251
.TP
252
.B -relaxed
253
Enable the relaxed mode by default, which allows all syntax variants
254
for hexadecimal/binary/ocatal constants (Intel, Motorola, Hitachi, C),
255
rahter than only the target-specific one.
256
.TP
257
.B -s
258
 
259
Add a section list to the assembly listing.  A section list contains
260
all sections that have been defined in the source files, marking their
261
nesting level by different levels of indentation.   This option only
262
makes sense when the generation of an assembly listing has been turned
263
on via the
264
.B -L
265
or
266
.B -l
267
parameters.
268
.TP
269
.B -shareout <file>
270
Override the default path and file name for the file containing shared
271
symbols.
272
.TP
273
.B -t <mask>
274
Turn on or off parts of the assembly listing that have no individual
275
command line parameter.  AS internally keeps an integer value whose bits
276
represent certain components of the listing.  A positive command line
277
parameter (-t or /t) sets the bits set in <mask>, whereas a negated
278
parameter (+t) resets the bits set in <mask>.  The individual bits have
279
the following meaning: bit 0 = source lines and generated machine code,
280
bit 1 = symbol table, bit 2 = macro table, bit 3 = function table, bit 4 =
281
line numbering.
282
.TP
283
.B -u
284
 
285
Tell AS to do additional bookkeeping about which address ranges have been
286
used by the assembled program.  This option enables the detection of overlapping
287
memory usage.  If an assembly listing has been turned on via the
288
.B -L
289
or
290
.B -l
291
parameters, it will also contain a list of all used memory areas.
292
.TP
293
.B -U 
294
 
295
Force AS to operate in case-sensitive mode.  By default, names of symbols,
296
macros, user-defined functions and sections are treated in a case-insensitive
297
manner.
298
.TP
299
.B -w
300
 
301
Suppress output of warnings.
302
.TP
303
.B -x
304
 
305
Turn on extended error reporting.  With extended error reporting, several
306
error and warning messages will also print the item that created the message,
307
e.g. the name of an unknown instruction.  When this option is given twice, 
308
the erroneous source line is additionally printed.
309
.TP
310
.B -warnranges
311
 
312
Only warn about integer constants exceedings the given data type's range, instead
313
of issuing an error.
314
 
315
.SH PRESETTING PARAMETERS
316
 
317
Parameters need not neccessarily be given in the command line itself.  Before
318
processing of command line parameters starts, AS will look if the
319
.B ASCMD
320
environment variable is defined.  If it exists, its contents will be
321
treated as additional command line parameters whose syntax is absolutely 
322
equal to normal command line parameters.  An exception is made if the 
323
variable's contents start with a '@' sign; in such a case, the string after
324
the '@' sign is treated as the name of a file that contains the options.
325
Such a file (also called a 'key file') has the advantage that it allows
326
the options to be written in different lines, and it does not have a size
327
limit.  Some operating systems (like MS-DOS) have a length limit on 
328
command lines and environment variable contents, so the key file may be
329
your only option if you have a lot of lengthy parameters for AS.
330
 
331
As parameters given in the
332
.B ASCMD
333
environment variable or a key file are processed prior to the command line
334
itself, and can therefore be overridden by command line parameters.
335
 
336
.SH NATIONAL LANGUAGE SUPPORT
337
 
338
AS supports the needs of different languages and countries in the sense that
339
it will try to adapt to the language and date/time formats valid for the
340
current environment.  Upon startup, the COUNTRY setting made in the
341
CONFIG.SYS file is queried for DOS and OS/2 implementations of AS.  For
342
UNIX systems, AS tries to read the LC_TIME resp. LC_MESSAGES environment
343
variables to find out the correct format for date/time outputs resp. the
344
local language.  If this fails, the LC_ALL and finally LANG variables are
345
probed.  If none of these environment variables points to a specific local
346
environment resp. contains a locale specification unknown to AS, the
347
standard english/C locale is used.
348
 
349
The messages AS can output in different languages are stored in separate
350
files with the extension '.msg' .  AS will search for these files in the
351
following directories:
352
 
353
- The current directory
354
 
355
- The directory the executable of AS was loaded from (only on DOS platforms version >=3.0 or if path was explicitly specified)
356
 
357
- The directory specified in the AS_MSGPATH environment variable resp. the directories listed in the PATH environment variable if AS_MSGPATH does not exist.
358
 
359
- The LIBDIR directory set at compile time from the Makefile.
360
 
361
 
362
.SH RETURN CODES
363
 
364
Depending on the assembly's turnout, 
365
.B asl
366
will generate different return codes:
367
.TP
368
.B 0
369
No errors, warnings might have occured.
370
.TP
371
.B 1
372
No command line parameters were given, AS printed a short list
373
of possible command line parameters and terminated thereafter.
374
.TP
375
.B 2
376
Errors occured during assembly of at least one source file, no 
377
code file was generated for the corresponding source file(s).
378
.TP
379
.B 3
380
A fatal error occured during assembly that forced immediate
381
program termination.  Code files may be generated, but are probably
382
unusuable.
383
.TP
384
.B 4
385
Program termination already occured during initialization.  This
386
might be either due to a incorrect command line parameter or an error
387
during loading the program's overlay file (only possible on MS-DOS).
388
.TP
389
.B 255
390
During initialization, an internal error happened that should not
391
occur.  If the reaction is reproducable, note down the situation and
392
send a bug report to the author.
393
 
394
.SH EXAMPLES
395
 
396
To assemble a source file
397
.B file1.asm
398
without any additional bells and whistles, use:
399
.PP
400
.B asl file1
401
.PP
402
which will create an output file
403
.B file1.p
404
given that there are no errors.  If you additionally want a listing and
405
rename the output file to
406
.B a.out,
407
use
408
.PP
409
.B asl -L file1 -o a.out
410
.PP
411
To make the listing as comprehensive as possible and to get more detailed
412
error messages, use:
413
.PP
414
.B asl -LuCIs -t 16 -nx file1
415
 
416
.SH TIPS
417
 
418
calling AS without any parameters will print a short help containing all
419
command line parameters and implemented target processors, while calling
420
with command line parameters but without any source file name will result
421
in AS asking for a source file name on the console.
422
 
423
.SH SEE ALSO
424
 
425
plist(1), pbind(1), p2hex(1), p2bin(1)
426
 
427
.SH HISTORY
428
 
429
AS originally appeared as a DOS program in 1989, written in
430
Borland-Pascal, and was ported to C and UNIX in 1996.  
431
 
432
.SH BUGS
433
 
434
There are too many options.
435
 
436
Command line interpreters of some operating systems reserve some 
437
characters for their own use, so it might be necessary to give
438
command line parameters with certain tricks (e.g., with the help
439
of escape characters).
440
 
441
.SH AUTHOR(S)
442
 
443
Alfred Arnold (alfred@ccac.rwth-aachen.de), and a few others...