* as.c (use_gnu_debug_info_extensions) : New variable.
[deliverable/binutils-gdb.git] / gas / doc / as.texinfo
1 \input texinfo @c -*-Texinfo-*-
2 @c Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
3 @c 2001, 2002, 2003
4 @c Free Software Foundation, Inc.
5 @c UPDATE!! On future updates--
6 @c (1) check for new machine-dep cmdline options in
7 @c md_parse_option definitions in config/tc-*.c
8 @c (2) for platform-specific directives, examine md_pseudo_op
9 @c in config/tc-*.c
10 @c (3) for object-format specific directives, examine obj_pseudo_op
11 @c in config/obj-*.c
12 @c (4) portable directives in potable[] in read.c
13 @c %**start of header
14 @setfilename as.info
15 @c ---config---
16 @macro gcctabopt{body}
17 @code{\body\}
18 @end macro
19 @c defaults, config file may override:
20 @set have-stabs
21 @c ---
22 @include asconfig.texi
23 @include gasver.texi
24 @c ---
25 @c man begin NAME
26 @ifset man
27 @c Configure for the generation of man pages
28 @set AS as
29 @set TARGET TARGET
30 @set GENERIC
31 @set A29K
32 @set ALPHA
33 @set ARC
34 @set ARM
35 @set CRIS
36 @set D10V
37 @set D30V
38 @set H8/300
39 @set H8/500
40 @set HPPA
41 @set I370
42 @set I80386
43 @set I860
44 @set I960
45 @set IA-64
46 @set IP2K
47 @set M32R
48 @set M68HC11
49 @set M680X0
50 @set M880X0
51 @set MCORE
52 @set MIPS
53 @set MMIX
54 @set PDP11
55 @set PJ
56 @set PPC
57 @set SH
58 @set SPARC
59 @set TIC54X
60 @set V850
61 @set VAX
62 @set XTENSA
63 @end ifset
64 @c man end
65 @c common OR combinations of conditions
66 @ifset COFF
67 @set COFF-ELF
68 @end ifset
69 @ifset ELF
70 @set COFF-ELF
71 @end ifset
72 @ifset AOUT
73 @set aout-bout
74 @end ifset
75 @ifset ARM/Thumb
76 @set ARM
77 @end ifset
78 @ifset BOUT
79 @set aout-bout
80 @end ifset
81 @ifset H8/300
82 @set H8
83 @end ifset
84 @ifset H8/500
85 @set H8
86 @end ifset
87 @ifset SH
88 @set H8
89 @end ifset
90 @ifset HPPA
91 @set abnormal-separator
92 @end ifset
93 @c ------------
94 @ifset GENERIC
95 @settitle Using @value{AS}
96 @end ifset
97 @ifclear GENERIC
98 @settitle Using @value{AS} (@value{TARGET})
99 @end ifclear
100 @setchapternewpage odd
101 @c %**end of header
102
103 @c @smallbook
104 @c @set SMALL
105 @c WARE! Some of the machine-dependent sections contain tables of machine
106 @c instructions. Except in multi-column format, these tables look silly.
107 @c Unfortunately, Texinfo doesn't have a general-purpose multi-col format, so
108 @c the multi-col format is faked within @example sections.
109 @c
110 @c Again unfortunately, the natural size that fits on a page, for these tables,
111 @c is different depending on whether or not smallbook is turned on.
112 @c This matters, because of order: text flow switches columns at each page
113 @c break.
114 @c
115 @c The format faked in this source works reasonably well for smallbook,
116 @c not well for the default large-page format. This manual expects that if you
117 @c turn on @smallbook, you will also uncomment the "@set SMALL" to enable the
118 @c tables in question. You can turn on one without the other at your
119 @c discretion, of course.
120 @ifinfo
121 @set SMALL
122 @c the insn tables look just as silly in info files regardless of smallbook,
123 @c might as well show 'em anyways.
124 @end ifinfo
125
126 @ifinfo
127 @format
128 START-INFO-DIR-ENTRY
129 * As: (as). The GNU assembler.
130 * Gas: (as). The GNU assembler.
131 END-INFO-DIR-ENTRY
132 @end format
133 @end ifinfo
134
135 @finalout
136 @syncodeindex ky cp
137
138 @ifinfo
139 This file documents the GNU Assembler "@value{AS}".
140
141 @c man begin COPYRIGHT
142 Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc.
143
144 Permission is granted to copy, distribute and/or modify this document
145 under the terms of the GNU Free Documentation License, Version 1.1
146 or any later version published by the Free Software Foundation;
147 with no Invariant Sections, with no Front-Cover Texts, and with no
148 Back-Cover Texts. A copy of the license is included in the
149 section entitled ``GNU Free Documentation License''.
150
151 @c man end
152
153 @ignore
154 Permission is granted to process this file through Tex and print the
155 results, provided the printed document carries copying permission
156 notice identical to this one except for the removal of this paragraph
157 (this paragraph not being relevant to the printed manual).
158
159 @end ignore
160 @end ifinfo
161
162 @titlepage
163 @title Using @value{AS}
164 @subtitle The @sc{gnu} Assembler
165 @ifclear GENERIC
166 @subtitle for the @value{TARGET} family
167 @end ifclear
168 @sp 1
169 @subtitle Version @value{VERSION}
170 @sp 1
171 @sp 13
172 The Free Software Foundation Inc. thanks The Nice Computer
173 Company of Australia for loaning Dean Elsner to write the
174 first (Vax) version of @command{as} for Project @sc{gnu}.
175 The proprietors, management and staff of TNCCA thank FSF for
176 distracting the boss while they got some work
177 done.
178 @sp 3
179 @author Dean Elsner, Jay Fenlason & friends
180 @page
181 @tex
182 {\parskip=0pt
183 \hfill {\it Using {\tt @value{AS}}}\par
184 \hfill Edited by Cygnus Support\par
185 }
186 %"boxit" macro for figures:
187 %Modified from Knuth's ``boxit'' macro from TeXbook (answer to exercise 21.3)
188 \gdef\boxit#1#2{\vbox{\hrule\hbox{\vrule\kern3pt
189 \vbox{\parindent=0pt\parskip=0pt\hsize=#1\kern3pt\strut\hfil
190 #2\hfil\strut\kern3pt}\kern3pt\vrule}\hrule}}%box with visible outline
191 \gdef\ibox#1#2{\hbox to #1{#2\hfil}\kern8pt}% invisible box
192 @end tex
193
194 @vskip 0pt plus 1filll
195 Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc.
196
197 Permission is granted to copy, distribute and/or modify this document
198 under the terms of the GNU Free Documentation License, Version 1.1
199 or any later version published by the Free Software Foundation;
200 with no Invariant Sections, with no Front-Cover Texts, and with no
201 Back-Cover Texts. A copy of the license is included in the
202 section entitled ``GNU Free Documentation License''.
203
204 @end titlepage
205
206 @ifnottex
207 @node Top
208 @top Using @value{AS}
209
210 This file is a user guide to the @sc{gnu} assembler @command{@value{AS}} version
211 @value{VERSION}.
212 @ifclear GENERIC
213 This version of the file describes @command{@value{AS}} configured to generate
214 code for @value{TARGET} architectures.
215 @end ifclear
216
217 This document is distributed under the terms of the GNU Free
218 Documentation License. A copy of the license is included in the
219 section entitled ``GNU Free Documentation License''.
220
221 @menu
222 * Overview:: Overview
223 * Invoking:: Command-Line Options
224 * Syntax:: Syntax
225 * Sections:: Sections and Relocation
226 * Symbols:: Symbols
227 * Expressions:: Expressions
228 * Pseudo Ops:: Assembler Directives
229 * Machine Dependencies:: Machine Dependent Features
230 * Reporting Bugs:: Reporting Bugs
231 * Acknowledgements:: Who Did What
232 * GNU Free Documentation License:: GNU Free Documentation License
233 * Index:: Index
234 @end menu
235 @end ifnottex
236
237 @node Overview
238 @chapter Overview
239 @iftex
240 This manual is a user guide to the @sc{gnu} assembler @command{@value{AS}}.
241 @ifclear GENERIC
242 This version of the manual describes @command{@value{AS}} configured to generate
243 code for @value{TARGET} architectures.
244 @end ifclear
245 @end iftex
246
247 @cindex invocation summary
248 @cindex option summary
249 @cindex summary of options
250 Here is a brief summary of how to invoke @command{@value{AS}}. For details,
251 @pxref{Invoking,,Command-Line Options}.
252
253 @c man title AS the portable GNU assembler.
254
255 @ignore
256 @c man begin SEEALSO
257 gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}.
258 @c man end
259 @end ignore
260
261 @c We don't use deffn and friends for the following because they seem
262 @c to be limited to one line for the header.
263 @smallexample
264 @c man begin SYNOPSIS
265 @value{AS} [@b{-a}[@b{cdhlns}][=@var{file}]] [@b{-D}] [@b{--defsym} @var{sym}=@var{val}]
266 [@b{-f}] [@b{--gstabs}] [@b{--gstabs+}] [@b{--gdwarf2}] [@b{--help}]
267 [@b{-I} @var{dir}] [@b{-J}] [@b{-K}] [@b{-L}]
268 [@b{--listing-lhs-width}=@var{NUM}] [@b{--listing-lhs-width2}=@var{NUM}]
269 [@b{--listing-rhs-width}=@var{NUM}] [@b{--listing-cont-lines}=@var{NUM}]
270 [@b{--keep-locals}] [@b{-o} @var{objfile}] [@b{-R}] [@b{--statistics}] [@b{-v}]
271 [@b{-version}] [@b{--version}] [@b{-W}] [@b{--warn}] [@b{--fatal-warnings}]
272 [@b{-w}] [@b{-x}] [@b{-Z}] [@b{--target-help}] [@var{target-options}]
273 [@b{--}|@var{files} @dots{}]
274 @c
275 @c Target dependent options are listed below. Keep the list sorted.
276 @c Add an empty line for separation.
277 @ifset A29K
278 @c am29k has no machine-dependent assembler options
279 @end ifset
280 @ifset ALPHA
281
282 @emph{Target Alpha options:}
283 [@b{-m@var{cpu}}]
284 [@b{-mdebug} | @b{-no-mdebug}]
285 [@b{-relax}] [@b{-g}] [@b{-G@var{size}}]
286 [@b{-F}] [@b{-32addr}]
287 @end ifset
288 @ifset ARC
289
290 @emph{Target ARC options:}
291 [@b{-marc[5|6|7|8]}]
292 [@b{-EB}|@b{-EL}]
293 @end ifset
294 @ifset ARM
295
296 @emph{Target ARM options:}
297 @c Don't document the deprecated options
298 [@b{-mcpu}=@var{processor}[+@var{extension}@dots{}]]
299 [@b{-march}=@var{architecture}[+@var{extension}@dots{}]]
300 [@b{-mfpu}=@var{floating-point-fromat}]
301 [@b{-mthumb}]
302 [@b{-EB}|@b{-EL}]
303 [@b{-mapcs-32}|@b{-mapcs-26}|@b{-mapcs-float}|
304 @b{-mapcs-reentrant}]
305 [@b{-mthumb-interwork}] [@b{-moabi}] [@b{-k}]
306 @end ifset
307 @ifset CRIS
308
309 @emph{Target CRIS options:}
310 [@b{--underscore} | @b{--no-underscore}]
311 [@b{--pic}] [@b{-N}]
312 [@b{--emulation=criself} | @b{--emulation=crisaout}]
313 @c Deprecated -- deliberately not documented.
314 @c [@b{-h}] [@b{-H}]
315 @end ifset
316 @ifset D10V
317
318 @emph{Target D10V options:}
319 [@b{-O}]
320 @end ifset
321 @ifset D30V
322
323 @emph{Target D30V options:}
324 [@b{-O}|@b{-n}|@b{-N}]
325 @end ifset
326 @ifset H8
327 @c Renesas family chips have no machine-dependent assembler options
328 @end ifset
329 @ifset HPPA
330 @c HPPA has no machine-dependent assembler options (yet).
331 @end ifset
332 @ifset I80386
333
334 @emph{Target i386 options:}
335 [@b{--32}|@b{--64}] [@b{-n}]
336 @end ifset
337 @ifset I960
338
339 @emph{Target i960 options:}
340 @c see md_parse_option in tc-i960.c
341 [@b{-ACA}|@b{-ACA_A}|@b{-ACB}|@b{-ACC}|@b{-AKA}|@b{-AKB}|
342 @b{-AKC}|@b{-AMC}]
343 [@b{-b}] [@b{-no-relax}]
344 @end ifset
345 @ifset IA64
346
347 @emph{Target IA-64 options:}
348 [@b{-mconstant-gp}|@b{-mauto-pic}]
349 [@b{-milp32}|@b{-milp64}|@b{-mlp64}|@b{-mp64}]
350 [@b{-mle}|@b{mbe}]
351 [@b{-x}|@b{-xexplicit}] [@b{-xauto}] [@b{-xdebug}]
352 @end ifset
353 @ifset IP2K
354
355 @emph{Target IP2K options:}
356 [@b{-mip2022}|@b{-mip2022ext}]
357 @end ifset
358 @ifset M32R
359
360 @emph{Target M32R options:}
361 [@b{--m32rx}|@b{--[no-]warn-explicit-parallel-conflicts}|
362 @b{--W[n]p}]
363 @end ifset
364 @ifset M680X0
365
366 @emph{Target M680X0 options:}
367 [@b{-l}] [@b{-m68000}|@b{-m68010}|@b{-m68020}|@dots{}]
368 @end ifset
369 @ifset M68HC11
370
371 @emph{Target M68HC11 options:}
372 [@b{-m68hc11}|@b{-m68hc12}|@b{-m68hcs12}]
373 [@b{-mshort}|@b{-mlong}]
374 [@b{-mshort-double}|@b{-mlong-double}]
375 [@b{--force-long-branchs}] [@b{--short-branchs}]
376 [@b{--strict-direct-mode}] [@b{--print-insn-syntax}]
377 [@b{--print-opcodes}] [@b{--generate-example}]
378 @end ifset
379 @ifset MCORE
380
381 @emph{Target MCORE options:}
382 [@b{-jsri2bsr}] [@b{-sifilter}] [@b{-relax}]
383 [@b{-mcpu=[210|340]}]
384 @end ifset
385 @ifset MIPS
386
387 @emph{Target MIPS options:}
388 [@b{-nocpp}] [@b{-EL}] [@b{-EB}] [@b{-n}] [@b{-O}[@var{optimization level}]]
389 [@b{-g}[@var{debug level}]] [@b{-G} @var{num}] [@b{-KPIC}] [@b{-call_shared}]
390 [@b{-non_shared}] [@b{-xgot}] [@b{--membedded-pic}]
391 [@b{-mabi}=@var{ABI}] [@b{-32}] [@b{-n32}] [@b{-64}] [@b{-mfp32}] [@b{-mgp32}]
392 [@b{-march}=@var{CPU}] [@b{-mtune}=@var{CPU}] [@b{-mips1}] [@b{-mips2}]
393 [@b{-mips3}] [@b{-mips4}] [@b{-mips5}] [@b{-mips32}] [@b{-mips32r2}]
394 [@b{-mips64}] [@b{-mips64r2}]
395 [@b{-construct-floats}] [@b{-no-construct-floats}]
396 [@b{-trap}] [@b{-no-break}] [@b{-break}] [@b{-no-trap}]
397 [@b{-mfix7000}] [@b{-mno-fix7000}]
398 [@b{-mips16}] [@b{-no-mips16}]
399 [@b{-mips3d}] [@b{-no-mips3d}]
400 [@b{-mdmx}] [@b{-no-mdmx}]
401 [@b{-mdebug}] [@b{-no-mdebug}]
402 [@b{-mpdr}] [@b{-mno-pdr}]
403 @end ifset
404 @ifset MMIX
405
406 @emph{Target MMIX options:}
407 [@b{--fixed-special-register-names}] [@b{--globalize-symbols}]
408 [@b{--gnu-syntax}] [@b{--relax}] [@b{--no-predefined-symbols}]
409 [@b{--no-expand}] [@b{--no-merge-gregs}] [@b{-x}]
410 [@b{--linker-allocated-gregs}]
411 @end ifset
412 @ifset PDP11
413
414 @emph{Target PDP11 options:}
415 [@b{-mpic}|@b{-mno-pic}] [@b{-mall}] [@b{-mno-extensions}]
416 [@b{-m}@var{extension}|@b{-mno-}@var{extension}]
417 [@b{-m}@var{cpu}] [@b{-m}@var{machine}]
418 @end ifset
419 @ifset PJ
420
421 @emph{Target picoJava options:}
422 [@b{-mb}|@b{-me}]
423 @end ifset
424 @ifset PPC
425
426 @emph{Target PowerPC options:}
427 [@b{-mpwrx}|@b{-mpwr2}|@b{-mpwr}|@b{-m601}|@b{-mppc}|@b{-mppc32}|@b{-m603}|@b{-m604}|
428 @b{-m403}|@b{-m405}|@b{-mppc64}|@b{-m620}|@b{-mppc64bridge}|@b{-mbooke}|
429 @b{-mbooke32}|@b{-mbooke64}]
430 [@b{-mcom}|@b{-many}|@b{-maltivec}] [@b{-memb}]
431 [@b{-mregnames}|@b{-mno-regnames}]
432 [@b{-mrelocatable}|@b{-mrelocatable-lib}]
433 [@b{-mlittle}|@b{-mlittle-endian}|@b{-mbig}|@b{-mbig-endian}]
434 [@b{-msolaris}|@b{-mno-solaris}]
435 @end ifset
436 @ifset SPARC
437
438 @emph{Target SPARC options:}
439 @c The order here is important. See c-sparc.texi.
440 [@b{-Av6}|@b{-Av7}|@b{-Av8}|@b{-Asparclet}|@b{-Asparclite}
441 @b{-Av8plus}|@b{-Av8plusa}|@b{-Av9}|@b{-Av9a}]
442 [@b{-xarch=v8plus}|@b{-xarch=v8plusa}] [@b{-bump}]
443 [@b{-32}|@b{-64}]
444 @end ifset
445 @ifset TIC54X
446
447 @emph{Target TIC54X options:}
448 [@b{-mcpu=54[123589]}|@b{-mcpu=54[56]lp}] [@b{-mfar-mode}|@b{-mf}]
449 [@b{-merrors-to-file} @var{<filename>}|@b{-me} @var{<filename>}]
450 @end ifset
451 @ifset Z8000
452 @c Z8000 has no machine-dependent assembler options
453 @end ifset
454 @ifset XTENSA
455
456 @emph{Target Xtensa options:}
457 [@b{--[no-]density}] [@b{--[no-]relax}] [@b{--[no-]generics}]
458 [@b{--[no-]text-section-literals}]
459 [@b{--[no-]target-align}] [@b{--[no-]longcalls}]
460 @end ifset
461 @c man end
462 @end smallexample
463
464 @c man begin OPTIONS
465
466 @table @gcctabopt
467 @item -a[cdhlmns]
468 Turn on listings, in any of a variety of ways:
469
470 @table @gcctabopt
471 @item -ac
472 omit false conditionals
473
474 @item -ad
475 omit debugging directives
476
477 @item -ah
478 include high-level source
479
480 @item -al
481 include assembly
482
483 @item -am
484 include macro expansions
485
486 @item -an
487 omit forms processing
488
489 @item -as
490 include symbols
491
492 @item =file
493 set the name of the listing file
494 @end table
495
496 You may combine these options; for example, use @samp{-aln} for assembly
497 listing without forms processing. The @samp{=file} option, if used, must be
498 the last one. By itself, @samp{-a} defaults to @samp{-ahls}.
499
500 @item -D
501 Ignored. This option is accepted for script compatibility with calls to
502 other assemblers.
503
504 @item --defsym @var{sym}=@var{value}
505 Define the symbol @var{sym} to be @var{value} before assembling the input file.
506 @var{value} must be an integer constant. As in C, a leading @samp{0x}
507 indicates a hexadecimal value, and a leading @samp{0} indicates an octal value.
508
509 @item -f
510 ``fast''---skip whitespace and comment preprocessing (assume source is
511 compiler output).
512
513 @item --gstabs
514 Generate stabs debugging information for each assembler line. This
515 may help debugging assembler code, if the debugger can handle it.
516
517 @item --gstabs+
518 Generate stabs debugging information for each assembler line, with GNU
519 extensions that probably only gdb can handle, and that could make other
520 debuggers crash or refuse to read your program. This
521 may help debugging assembler code. Currently the only GNU extension is
522 the location of the current working directory at assembling time.
523
524 @item --gdwarf2
525 Generate DWARF2 debugging information for each assembler line. This
526 may help debugging assembler code, if the debugger can handle it. Note---this
527 option is only supported by some targets, not all of them.
528
529 @item --help
530 Print a summary of the command line options and exit.
531
532 @item --target-help
533 Print a summary of all target specific options and exit.
534
535 @item -I @var{dir}
536 Add directory @var{dir} to the search list for @code{.include} directives.
537
538 @item -J
539 Don't warn about signed overflow.
540
541 @item -K
542 @ifclear DIFF-TBL-KLUGE
543 This option is accepted but has no effect on the @value{TARGET} family.
544 @end ifclear
545 @ifset DIFF-TBL-KLUGE
546 Issue warnings when difference tables altered for long displacements.
547 @end ifset
548
549 @item -L
550 @itemx --keep-locals
551 Keep (in the symbol table) local symbols. On traditional a.out systems
552 these start with @samp{L}, but different systems have different local
553 label prefixes.
554
555 @item --listing-lhs-width=@var{number}
556 Set the maximum width, in words, of the output data column for an assembler
557 listing to @var{number}.
558
559 @item --listing-lhs-width2=@var{number}
560 Set the maximum width, in words, of the output data column for continuation
561 lines in an assembler listing to @var{number}.
562
563 @item --listing-rhs-width=@var{number}
564 Set the maximum width of an input source line, as displayed in a listing, to
565 @var{number} bytes.
566
567 @item --listing-cont-lines=@var{number}
568 Set the maximum number of lines printed in a listing for a single line of input
569 to @var{number} + 1.
570
571 @item -o @var{objfile}
572 Name the object-file output from @command{@value{AS}} @var{objfile}.
573
574 @item -R
575 Fold the data section into the text section.
576
577 @item --statistics
578 Print the maximum space (in bytes) and total time (in seconds) used by
579 assembly.
580
581 @item --strip-local-absolute
582 Remove local absolute symbols from the outgoing symbol table.
583
584 @item -v
585 @itemx -version
586 Print the @command{as} version.
587
588 @item --version
589 Print the @command{as} version and exit.
590
591 @item -W
592 @itemx --no-warn
593 Suppress warning messages.
594
595 @item --fatal-warnings
596 Treat warnings as errors.
597
598 @item --warn
599 Don't suppress warning messages or treat them as errors.
600
601 @item -w
602 Ignored.
603
604 @item -x
605 Ignored.
606
607 @item -Z
608 Generate an object file even after errors.
609
610 @item -- | @var{files} @dots{}
611 Standard input, or source files to assemble.
612
613 @end table
614
615 @ifset ARC
616 The following options are available when @value{AS} is configured for
617 an ARC processor.
618
619 @table @gcctabopt
620 @item -marc[5|6|7|8]
621 This option selects the core processor variant.
622 @item -EB | -EL
623 Select either big-endian (-EB) or little-endian (-EL) output.
624 @end table
625 @end ifset
626
627 @ifset ARM
628 The following options are available when @value{AS} is configured for the ARM
629 processor family.
630
631 @table @gcctabopt
632 @item -mcpu=@var{processor}[+@var{extension}@dots{}]
633 Specify which ARM processor variant is the target.
634 @item -march=@var{architecture}[+@var{extension}@dots{}]
635 Specify which ARM architecture variant is used by the target.
636 @item -mfpu=@var{floating-point-format}
637 Select which Floating Point architecture is the target.
638 @item -mthumb
639 Enable Thumb only instruction decoding.
640 @item -mapcs-32 | -mapcs-26 | -mapcs-float | -mapcs-reentrant | -moabi
641 Select which procedure calling convention is in use.
642 @item -EB | -EL
643 Select either big-endian (-EB) or little-endian (-EL) output.
644 @item -mthumb-interwork
645 Specify that the code has been generated with interworking between Thumb and
646 ARM code in mind.
647 @item -k
648 Specify that PIC code has been generated.
649 @end table
650 @end ifset
651
652 @ifset CRIS
653 See the info pages for documentation of the CRIS-specific options.
654 @end ifset
655
656 @ifset D10V
657 The following options are available when @value{AS} is configured for
658 a D10V processor.
659 @table @gcctabopt
660 @cindex D10V optimization
661 @cindex optimization, D10V
662 @item -O
663 Optimize output by parallelizing instructions.
664 @end table
665 @end ifset
666
667 @ifset D30V
668 The following options are available when @value{AS} is configured for a D30V
669 processor.
670 @table @gcctabopt
671 @cindex D30V optimization
672 @cindex optimization, D30V
673 @item -O
674 Optimize output by parallelizing instructions.
675
676 @cindex D30V nops
677 @item -n
678 Warn when nops are generated.
679
680 @cindex D30V nops after 32-bit multiply
681 @item -N
682 Warn when a nop after a 32-bit multiply instruction is generated.
683 @end table
684 @end ifset
685
686 @ifset I960
687 The following options are available when @value{AS} is configured for the
688 Intel 80960 processor.
689
690 @table @gcctabopt
691 @item -ACA | -ACA_A | -ACB | -ACC | -AKA | -AKB | -AKC | -AMC
692 Specify which variant of the 960 architecture is the target.
693
694 @item -b
695 Add code to collect statistics about branches taken.
696
697 @item -no-relax
698 Do not alter compare-and-branch instructions for long displacements;
699 error if necessary.
700
701 @end table
702 @end ifset
703
704 @ifset IP2K
705 The following options are available when @value{AS} is configured for the
706 Ubicom IP2K series.
707
708 @table @gcctabopt
709
710 @item -mip2022ext
711 Specifies that the extended IP2022 instructions are allowed.
712
713 @item -mip2022
714 Restores the default behaviour, which restricts the permitted instructions to
715 just the basic IP2022 ones.
716
717 @end table
718 @end ifset
719
720 @ifset M32R
721 The following options are available when @value{AS} is configured for the
722 Renesas M32R (formerly Mitsubishi M32R) series.
723
724 @table @gcctabopt
725
726 @item --m32rx
727 Specify which processor in the M32R family is the target. The default
728 is normally the M32R, but this option changes it to the M32RX.
729
730 @item --warn-explicit-parallel-conflicts or --Wp
731 Produce warning messages when questionable parallel constructs are
732 encountered.
733
734 @item --no-warn-explicit-parallel-conflicts or --Wnp
735 Do not produce warning messages when questionable parallel constructs are
736 encountered.
737
738 @end table
739 @end ifset
740
741 @ifset M680X0
742 The following options are available when @value{AS} is configured for the
743 Motorola 68000 series.
744
745 @table @gcctabopt
746
747 @item -l
748 Shorten references to undefined symbols, to one word instead of two.
749
750 @item -m68000 | -m68008 | -m68010 | -m68020 | -m68030
751 @itemx | -m68040 | -m68060 | -m68302 | -m68331 | -m68332
752 @itemx | -m68333 | -m68340 | -mcpu32 | -m5200
753 Specify what processor in the 68000 family is the target. The default
754 is normally the 68020, but this can be changed at configuration time.
755
756 @item -m68881 | -m68882 | -mno-68881 | -mno-68882
757 The target machine does (or does not) have a floating-point coprocessor.
758 The default is to assume a coprocessor for 68020, 68030, and cpu32. Although
759 the basic 68000 is not compatible with the 68881, a combination of the
760 two can be specified, since it's possible to do emulation of the
761 coprocessor instructions with the main processor.
762
763 @item -m68851 | -mno-68851
764 The target machine does (or does not) have a memory-management
765 unit coprocessor. The default is to assume an MMU for 68020 and up.
766
767 @end table
768 @end ifset
769
770 @ifset PDP11
771
772 For details about the PDP-11 machine dependent features options,
773 see @ref{PDP-11-Options}.
774
775 @table @gcctabopt
776 @item -mpic | -mno-pic
777 Generate position-independent (or position-dependent) code. The
778 default is @option{-mpic}.
779
780 @item -mall
781 @itemx -mall-extensions
782 Enable all instruction set extensions. This is the default.
783
784 @item -mno-extensions
785 Disable all instruction set extensions.
786
787 @item -m@var{extension} | -mno-@var{extension}
788 Enable (or disable) a particular instruction set extension.
789
790 @item -m@var{cpu}
791 Enable the instruction set extensions supported by a particular CPU, and
792 disable all other extensions.
793
794 @item -m@var{machine}
795 Enable the instruction set extensions supported by a particular machine
796 model, and disable all other extensions.
797 @end table
798
799 @end ifset
800
801 @ifset PJ
802 The following options are available when @value{AS} is configured for
803 a picoJava processor.
804
805 @table @gcctabopt
806
807 @cindex PJ endianness
808 @cindex endianness, PJ
809 @cindex big endian output, PJ
810 @item -mb
811 Generate ``big endian'' format output.
812
813 @cindex little endian output, PJ
814 @item -ml
815 Generate ``little endian'' format output.
816
817 @end table
818 @end ifset
819
820 @ifset M68HC11
821 The following options are available when @value{AS} is configured for the
822 Motorola 68HC11 or 68HC12 series.
823
824 @table @gcctabopt
825
826 @item -m68hc11 | -m68hc12 | -m68hcs12
827 Specify what processor is the target. The default is
828 defined by the configuration option when building the assembler.
829
830 @item -mshort
831 Specify to use the 16-bit integer ABI.
832
833 @item -mlong
834 Specify to use the 32-bit integer ABI.
835
836 @item -mshort-double
837 Specify to use the 32-bit double ABI.
838
839 @item -mlong-double
840 Specify to use the 64-bit double ABI.
841
842 @item --force-long-branchs
843 Relative branches are turned into absolute ones. This concerns
844 conditional branches, unconditional branches and branches to a
845 sub routine.
846
847 @item -S | --short-branchs
848 Do not turn relative branchs into absolute ones
849 when the offset is out of range.
850
851 @item --strict-direct-mode
852 Do not turn the direct addressing mode into extended addressing mode
853 when the instruction does not support direct addressing mode.
854
855 @item --print-insn-syntax
856 Print the syntax of instruction in case of error.
857
858 @item --print-opcodes
859 print the list of instructions with syntax and then exit.
860
861 @item --generate-example
862 print an example of instruction for each possible instruction and then exit.
863 This option is only useful for testing @command{@value{AS}}.
864
865 @end table
866 @end ifset
867
868 @ifset SPARC
869 The following options are available when @command{@value{AS}} is configured
870 for the SPARC architecture:
871
872 @table @gcctabopt
873 @item -Av6 | -Av7 | -Av8 | -Asparclet | -Asparclite
874 @itemx -Av8plus | -Av8plusa | -Av9 | -Av9a
875 Explicitly select a variant of the SPARC architecture.
876
877 @samp{-Av8plus} and @samp{-Av8plusa} select a 32 bit environment.
878 @samp{-Av9} and @samp{-Av9a} select a 64 bit environment.
879
880 @samp{-Av8plusa} and @samp{-Av9a} enable the SPARC V9 instruction set with
881 UltraSPARC extensions.
882
883 @item -xarch=v8plus | -xarch=v8plusa
884 For compatibility with the Solaris v9 assembler. These options are
885 equivalent to -Av8plus and -Av8plusa, respectively.
886
887 @item -bump
888 Warn when the assembler switches to another architecture.
889 @end table
890 @end ifset
891
892 @ifset TIC54X
893 The following options are available when @value{AS} is configured for the 'c54x
894 architecture.
895
896 @table @gcctabopt
897 @item -mfar-mode
898 Enable extended addressing mode. All addresses and relocations will assume
899 extended addressing (usually 23 bits).
900 @item -mcpu=@var{CPU_VERSION}
901 Sets the CPU version being compiled for.
902 @item -merrors-to-file @var{FILENAME}
903 Redirect error output to a file, for broken systems which don't support such
904 behaviour in the shell.
905 @end table
906 @end ifset
907
908 @ifset MIPS
909 The following options are available when @value{AS} is configured for
910 a @sc{mips} processor.
911
912 @table @gcctabopt
913 @item -G @var{num}
914 This option sets the largest size of an object that can be referenced
915 implicitly with the @code{gp} register. It is only accepted for targets that
916 use ECOFF format, such as a DECstation running Ultrix. The default value is 8.
917
918 @cindex MIPS endianness
919 @cindex endianness, MIPS
920 @cindex big endian output, MIPS
921 @item -EB
922 Generate ``big endian'' format output.
923
924 @cindex little endian output, MIPS
925 @item -EL
926 Generate ``little endian'' format output.
927
928 @cindex MIPS ISA
929 @item -mips1
930 @itemx -mips2
931 @itemx -mips3
932 @itemx -mips4
933 @itemx -mips5
934 @itemx -mips32
935 @itemx -mips32r2
936 @itemx -mips64
937 @itemx -mips64r2
938 Generate code for a particular @sc{mips} Instruction Set Architecture level.
939 @samp{-mips1} is an alias for @samp{-march=r3000}, @samp{-mips2} is an
940 alias for @samp{-march=r6000}, @samp{-mips3} is an alias for
941 @samp{-march=r4000} and @samp{-mips4} is an alias for @samp{-march=r8000}.
942 @samp{-mips5}, @samp{-mips32}, @samp{-mips32r2}, @samp{-mips64}, and
943 @samp{-mips64r2}
944 correspond to generic
945 @samp{MIPS V}, @samp{MIPS32}, @samp{MIPS32 Release 2}, @samp{MIPS64},
946 and @samp{MIPS64 Release 2}
947 ISA processors, respectively.
948
949 @item -march=@var{CPU}
950 Generate code for a particular @sc{mips} cpu.
951
952 @item -mtune=@var{cpu}
953 Schedule and tune for a particular @sc{mips} cpu.
954
955 @item -mfix7000
956 @itemx -mno-fix7000
957 Cause nops to be inserted if the read of the destination register
958 of an mfhi or mflo instruction occurs in the following two instructions.
959
960 @item -mdebug
961 @itemx -no-mdebug
962 Cause stabs-style debugging output to go into an ECOFF-style .mdebug
963 section instead of the standard ELF .stabs sections.
964
965 @item -mpdr
966 @itemx -mno-pdr
967 Control generation of @code{.pdr} sections.
968
969 @item -mgp32
970 @itemx -mfp32
971 The register sizes are normally inferred from the ISA and ABI, but these
972 flags force a certain group of registers to be treated as 32 bits wide at
973 all times. @samp{-mgp32} controls the size of general-purpose registers
974 and @samp{-mfp32} controls the size of floating-point registers.
975
976 @item -mips16
977 @itemx -no-mips16
978 Generate code for the MIPS 16 processor. This is equivalent to putting
979 @code{.set mips16} at the start of the assembly file. @samp{-no-mips16}
980 turns off this option.
981
982 @item -mips3d
983 @itemx -no-mips3d
984 Generate code for the MIPS-3D Application Specific Extension.
985 This tells the assembler to accept MIPS-3D instructions.
986 @samp{-no-mips3d} turns off this option.
987
988 @item -mdmx
989 @itemx -no-mdmx
990 Generate code for the MDMX Application Specific Extension.
991 This tells the assembler to accept MDMX instructions.
992 @samp{-no-mdmx} turns off this option.
993
994 @item --construct-floats
995 @itemx --no-construct-floats
996 The @samp{--no-construct-floats} option disables the construction of
997 double width floating point constants by loading the two halves of the
998 value into the two single width floating point registers that make up
999 the double width register. By default @samp{--construct-floats} is
1000 selected, allowing construction of these floating point constants.
1001
1002 @cindex emulation
1003 @item --emulation=@var{name}
1004 This option causes @command{@value{AS}} to emulate @command{@value{AS}} configured
1005 for some other target, in all respects, including output format (choosing
1006 between ELF and ECOFF only), handling of pseudo-opcodes which may generate
1007 debugging information or store symbol table information, and default
1008 endianness. The available configuration names are: @samp{mipsecoff},
1009 @samp{mipself}, @samp{mipslecoff}, @samp{mipsbecoff}, @samp{mipslelf},
1010 @samp{mipsbelf}. The first two do not alter the default endianness from that
1011 of the primary target for which the assembler was configured; the others change
1012 the default to little- or big-endian as indicated by the @samp{b} or @samp{l}
1013 in the name. Using @samp{-EB} or @samp{-EL} will override the endianness
1014 selection in any case.
1015
1016 This option is currently supported only when the primary target
1017 @command{@value{AS}} is configured for is a @sc{mips} ELF or ECOFF target.
1018 Furthermore, the primary target or others specified with
1019 @samp{--enable-targets=@dots{}} at configuration time must include support for
1020 the other format, if both are to be available. For example, the Irix 5
1021 configuration includes support for both.
1022
1023 Eventually, this option will support more configurations, with more
1024 fine-grained control over the assembler's behavior, and will be supported for
1025 more processors.
1026
1027 @item -nocpp
1028 @command{@value{AS}} ignores this option. It is accepted for compatibility with
1029 the native tools.
1030
1031 @item --trap
1032 @itemx --no-trap
1033 @itemx --break
1034 @itemx --no-break
1035 Control how to deal with multiplication overflow and division by zero.
1036 @samp{--trap} or @samp{--no-break} (which are synonyms) take a trap exception
1037 (and only work for Instruction Set Architecture level 2 and higher);
1038 @samp{--break} or @samp{--no-trap} (also synonyms, and the default) take a
1039 break exception.
1040
1041 @item -n
1042 When this option is used, @command{@value{AS}} will issue a warning every
1043 time it generates a nop instruction from a macro.
1044 @end table
1045 @end ifset
1046
1047 @ifset MCORE
1048 The following options are available when @value{AS} is configured for
1049 an MCore processor.
1050
1051 @table @gcctabopt
1052 @item -jsri2bsr
1053 @itemx -nojsri2bsr
1054 Enable or disable the JSRI to BSR transformation. By default this is enabled.
1055 The command line option @samp{-nojsri2bsr} can be used to disable it.
1056
1057 @item -sifilter
1058 @itemx -nosifilter
1059 Enable or disable the silicon filter behaviour. By default this is disabled.
1060 The default can be overridden by the @samp{-sifilter} command line option.
1061
1062 @item -relax
1063 Alter jump instructions for long displacements.
1064
1065 @item -mcpu=[210|340]
1066 Select the cpu type on the target hardware. This controls which instructions
1067 can be assembled.
1068
1069 @item -EB
1070 Assemble for a big endian target.
1071
1072 @item -EL
1073 Assemble for a little endian target.
1074
1075 @end table
1076 @end ifset
1077
1078 @ifset MMIX
1079 See the info pages for documentation of the MMIX-specific options.
1080 @end ifset
1081
1082 @ifset XTENSA
1083 The following options are available when @value{AS} is configured for
1084 an Xtensa processor.
1085
1086 @table @gcctabopt
1087 @item --density | --no-density
1088 Enable or disable use of instructions from the Xtensa code density
1089 option. This is enabled by default when the Xtensa processor supports
1090 the code density option.
1091
1092 @item --relax | --no-relax
1093 Enable or disable instruction relaxation. This is enabled by default.
1094 Note: In the current implementation, these options also control whether
1095 assembler optimizations are performed, making these options equivalent
1096 to @option{--generics} and @option{--no-generics}.
1097
1098 @item --generics | --no-generics
1099 Enable or disable all assembler transformations of Xtensa instructions.
1100 The default is @option{--generics};
1101 @option{--no-generics} should be used only in the rare cases when the
1102 instructions must be exactly as specified in the assembly source.
1103
1104 @item --text-section-literals | --no-text-section-literals
1105 With @option{--text-@-section-@-literals}, literal pools are interspersed
1106 in the text section. The default is
1107 @option{--no-@-text-@-section-@-literals}, which places literals in a
1108 separate section in the output file.
1109
1110 @item --target-align | --no-target-align
1111 Enable or disable automatic alignment to reduce branch penalties at the
1112 expense of some code density. The default is @option{--target-@-align}.
1113
1114 @item --longcalls | --no-longcalls
1115 Enable or disable transformation of call instructions to allow calls
1116 across a greater range of addresses. The default is
1117 @option{--no-@-longcalls}.
1118 @end table
1119 @end ifset
1120
1121 @c man end
1122
1123 @menu
1124 * Manual:: Structure of this Manual
1125 * GNU Assembler:: The GNU Assembler
1126 * Object Formats:: Object File Formats
1127 * Command Line:: Command Line
1128 * Input Files:: Input Files
1129 * Object:: Output (Object) File
1130 * Errors:: Error and Warning Messages
1131 @end menu
1132
1133 @node Manual
1134 @section Structure of this Manual
1135
1136 @cindex manual, structure and purpose
1137 This manual is intended to describe what you need to know to use
1138 @sc{gnu} @command{@value{AS}}. We cover the syntax expected in source files, including
1139 notation for symbols, constants, and expressions; the directives that
1140 @command{@value{AS}} understands; and of course how to invoke @command{@value{AS}}.
1141
1142 @ifclear GENERIC
1143 We also cover special features in the @value{TARGET}
1144 configuration of @command{@value{AS}}, including assembler directives.
1145 @end ifclear
1146 @ifset GENERIC
1147 This manual also describes some of the machine-dependent features of
1148 various flavors of the assembler.
1149 @end ifset
1150
1151 @cindex machine instructions (not covered)
1152 On the other hand, this manual is @emph{not} intended as an introduction
1153 to programming in assembly language---let alone programming in general!
1154 In a similar vein, we make no attempt to introduce the machine
1155 architecture; we do @emph{not} describe the instruction set, standard
1156 mnemonics, registers or addressing modes that are standard to a
1157 particular architecture.
1158 @ifset GENERIC
1159 You may want to consult the manufacturer's
1160 machine architecture manual for this information.
1161 @end ifset
1162 @ifclear GENERIC
1163 @ifset H8/300
1164 For information on the H8/300 machine instruction set, see @cite{H8/300
1165 Series Programming Manual}. For the H8/300H, see @cite{H8/300H Series
1166 Programming Manual} (Renesas).
1167 @end ifset
1168 @ifset H8/500
1169 For information on the H8/500 machine instruction set, see @cite{H8/500
1170 Series Programming Manual} (Renesas M21T001).
1171 @end ifset
1172 @ifset SH
1173 For information on the Renesas (formerly Hitachi) / SuperH SH machine instruction set,
1174 see @cite{SH-Microcomputer User's Manual} (Renesas) or
1175 @cite{SH-4 32-bit CPU Core Architecture} (SuperH) and
1176 @cite{SuperH (SH) 64-Bit RISC Series} (SuperH).
1177 @end ifset
1178 @ifset Z8000
1179 For information on the Z8000 machine instruction set, see @cite{Z8000 CPU Technical Manual}
1180 @end ifset
1181 @end ifclear
1182
1183 @c I think this is premature---doc@cygnus.com, 17jan1991
1184 @ignore
1185 Throughout this manual, we assume that you are running @dfn{GNU},
1186 the portable operating system from the @dfn{Free Software
1187 Foundation, Inc.}. This restricts our attention to certain kinds of
1188 computer (in particular, the kinds of computers that @sc{gnu} can run on);
1189 once this assumption is granted examples and definitions need less
1190 qualification.
1191
1192 @command{@value{AS}} is part of a team of programs that turn a high-level
1193 human-readable series of instructions into a low-level
1194 computer-readable series of instructions. Different versions of
1195 @command{@value{AS}} are used for different kinds of computer.
1196 @end ignore
1197
1198 @c There used to be a section "Terminology" here, which defined
1199 @c "contents", "byte", "word", and "long". Defining "word" to any
1200 @c particular size is confusing when the .word directive may generate 16
1201 @c bits on one machine and 32 bits on another; in general, for the user
1202 @c version of this manual, none of these terms seem essential to define.
1203 @c They were used very little even in the former draft of the manual;
1204 @c this draft makes an effort to avoid them (except in names of
1205 @c directives).
1206
1207 @node GNU Assembler
1208 @section The GNU Assembler
1209
1210 @c man begin DESCRIPTION
1211
1212 @sc{gnu} @command{as} is really a family of assemblers.
1213 @ifclear GENERIC
1214 This manual describes @command{@value{AS}}, a member of that family which is
1215 configured for the @value{TARGET} architectures.
1216 @end ifclear
1217 If you use (or have used) the @sc{gnu} assembler on one architecture, you
1218 should find a fairly similar environment when you use it on another
1219 architecture. Each version has much in common with the others,
1220 including object file formats, most assembler directives (often called
1221 @dfn{pseudo-ops}) and assembler syntax.@refill
1222
1223 @cindex purpose of @sc{gnu} assembler
1224 @command{@value{AS}} is primarily intended to assemble the output of the
1225 @sc{gnu} C compiler @code{@value{GCC}} for use by the linker
1226 @code{@value{LD}}. Nevertheless, we've tried to make @command{@value{AS}}
1227 assemble correctly everything that other assemblers for the same
1228 machine would assemble.
1229 @ifset VAX
1230 Any exceptions are documented explicitly (@pxref{Machine Dependencies}).
1231 @end ifset
1232 @ifset M680X0
1233 @c This remark should appear in generic version of manual; assumption
1234 @c here is that generic version sets M680x0.
1235 This doesn't mean @command{@value{AS}} always uses the same syntax as another
1236 assembler for the same architecture; for example, we know of several
1237 incompatible versions of 680x0 assembly language syntax.
1238 @end ifset
1239
1240 @c man end
1241
1242 Unlike older assemblers, @command{@value{AS}} is designed to assemble a source
1243 program in one pass of the source file. This has a subtle impact on the
1244 @kbd{.org} directive (@pxref{Org,,@code{.org}}).
1245
1246 @node Object Formats
1247 @section Object File Formats
1248
1249 @cindex object file format
1250 The @sc{gnu} assembler can be configured to produce several alternative
1251 object file formats. For the most part, this does not affect how you
1252 write assembly language programs; but directives for debugging symbols
1253 are typically different in different file formats. @xref{Symbol
1254 Attributes,,Symbol Attributes}.
1255 @ifclear GENERIC
1256 @ifclear MULTI-OBJ
1257 For the @value{TARGET} target, @command{@value{AS}} is configured to produce
1258 @value{OBJ-NAME} format object files.
1259 @end ifclear
1260 @c The following should exhaust all configs that set MULTI-OBJ, ideally
1261 @ifset A29K
1262 On the @value{TARGET}, @command{@value{AS}} can be configured to produce either
1263 @code{a.out} or COFF format object files.
1264 @end ifset
1265 @ifset I960
1266 On the @value{TARGET}, @command{@value{AS}} can be configured to produce either
1267 @code{b.out} or COFF format object files.
1268 @end ifset
1269 @ifset HPPA
1270 On the @value{TARGET}, @command{@value{AS}} can be configured to produce either
1271 SOM or ELF format object files.
1272 @end ifset
1273 @end ifclear
1274
1275 @node Command Line
1276 @section Command Line
1277
1278 @cindex command line conventions
1279
1280 After the program name @command{@value{AS}}, the command line may contain
1281 options and file names. Options may appear in any order, and may be
1282 before, after, or between file names. The order of file names is
1283 significant.
1284
1285 @cindex standard input, as input file
1286 @kindex --
1287 @file{--} (two hyphens) by itself names the standard input file
1288 explicitly, as one of the files for @command{@value{AS}} to assemble.
1289
1290 @cindex options, command line
1291 Except for @samp{--} any command line argument that begins with a
1292 hyphen (@samp{-}) is an option. Each option changes the behavior of
1293 @command{@value{AS}}. No option changes the way another option works. An
1294 option is a @samp{-} followed by one or more letters; the case of
1295 the letter is important. All options are optional.
1296
1297 Some options expect exactly one file name to follow them. The file
1298 name may either immediately follow the option's letter (compatible
1299 with older assemblers) or it may be the next command argument (@sc{gnu}
1300 standard). These two command lines are equivalent:
1301
1302 @smallexample
1303 @value{AS} -o my-object-file.o mumble.s
1304 @value{AS} -omy-object-file.o mumble.s
1305 @end smallexample
1306
1307 @node Input Files
1308 @section Input Files
1309
1310 @cindex input
1311 @cindex source program
1312 @cindex files, input
1313 We use the phrase @dfn{source program}, abbreviated @dfn{source}, to
1314 describe the program input to one run of @command{@value{AS}}. The program may
1315 be in one or more files; how the source is partitioned into files
1316 doesn't change the meaning of the source.
1317
1318 @c I added "con" prefix to "catenation" just to prove I can overcome my
1319 @c APL training... doc@cygnus.com
1320 The source program is a concatenation of the text in all the files, in the
1321 order specified.
1322
1323 @c man begin DESCRIPTION
1324 Each time you run @command{@value{AS}} it assembles exactly one source
1325 program. The source program is made up of one or more files.
1326 (The standard input is also a file.)
1327
1328 You give @command{@value{AS}} a command line that has zero or more input file
1329 names. The input files are read (from left file name to right). A
1330 command line argument (in any position) that has no special meaning
1331 is taken to be an input file name.
1332
1333 If you give @command{@value{AS}} no file names it attempts to read one input file
1334 from the @command{@value{AS}} standard input, which is normally your terminal. You
1335 may have to type @key{ctl-D} to tell @command{@value{AS}} there is no more program
1336 to assemble.
1337
1338 Use @samp{--} if you need to explicitly name the standard input file
1339 in your command line.
1340
1341 If the source is empty, @command{@value{AS}} produces a small, empty object
1342 file.
1343
1344 @c man end
1345
1346 @subheading Filenames and Line-numbers
1347
1348 @cindex input file linenumbers
1349 @cindex line numbers, in input files
1350 There are two ways of locating a line in the input file (or files) and
1351 either may be used in reporting error messages. One way refers to a line
1352 number in a physical file; the other refers to a line number in a
1353 ``logical'' file. @xref{Errors, ,Error and Warning Messages}.
1354
1355 @dfn{Physical files} are those files named in the command line given
1356 to @command{@value{AS}}.
1357
1358 @dfn{Logical files} are simply names declared explicitly by assembler
1359 directives; they bear no relation to physical files. Logical file names help
1360 error messages reflect the original source file, when @command{@value{AS}} source
1361 is itself synthesized from other files. @command{@value{AS}} understands the
1362 @samp{#} directives emitted by the @code{@value{GCC}} preprocessor. See also
1363 @ref{File,,@code{.file}}.
1364
1365 @node Object
1366 @section Output (Object) File
1367
1368 @cindex object file
1369 @cindex output file
1370 @kindex a.out
1371 @kindex .o
1372 Every time you run @command{@value{AS}} it produces an output file, which is
1373 your assembly language program translated into numbers. This file
1374 is the object file. Its default name is
1375 @ifclear BOUT
1376 @code{a.out}.
1377 @end ifclear
1378 @ifset BOUT
1379 @ifset GENERIC
1380 @code{a.out}, or
1381 @end ifset
1382 @code{b.out} when @command{@value{AS}} is configured for the Intel 80960.
1383 @end ifset
1384 You can give it another name by using the @option{-o} option. Conventionally,
1385 object file names end with @file{.o}. The default name is used for historical
1386 reasons: older assemblers were capable of assembling self-contained programs
1387 directly into a runnable program. (For some formats, this isn't currently
1388 possible, but it can be done for the @code{a.out} format.)
1389
1390 @cindex linker
1391 @kindex ld
1392 The object file is meant for input to the linker @code{@value{LD}}. It contains
1393 assembled program code, information to help @code{@value{LD}} integrate
1394 the assembled program into a runnable file, and (optionally) symbolic
1395 information for the debugger.
1396
1397 @c link above to some info file(s) like the description of a.out.
1398 @c don't forget to describe @sc{gnu} info as well as Unix lossage.
1399
1400 @node Errors
1401 @section Error and Warning Messages
1402
1403 @c man begin DESCRIPTION
1404
1405 @cindex error messages
1406 @cindex warning messages
1407 @cindex messages from assembler
1408 @command{@value{AS}} may write warnings and error messages to the standard error
1409 file (usually your terminal). This should not happen when a compiler
1410 runs @command{@value{AS}} automatically. Warnings report an assumption made so
1411 that @command{@value{AS}} could keep assembling a flawed program; errors report a
1412 grave problem that stops the assembly.
1413
1414 @c man end
1415
1416 @cindex format of warning messages
1417 Warning messages have the format
1418
1419 @smallexample
1420 file_name:@b{NNN}:Warning Message Text
1421 @end smallexample
1422
1423 @noindent
1424 @cindex line numbers, in warnings/errors
1425 (where @b{NNN} is a line number). If a logical file name has been given
1426 (@pxref{File,,@code{.file}}) it is used for the filename, otherwise the name of
1427 the current input file is used. If a logical line number was given
1428 @ifset GENERIC
1429 (@pxref{Line,,@code{.line}})
1430 @end ifset
1431 @ifclear GENERIC
1432 @ifclear A29K
1433 (@pxref{Line,,@code{.line}})
1434 @end ifclear
1435 @ifset A29K
1436 (@pxref{Ln,,@code{.ln}})
1437 @end ifset
1438 @end ifclear
1439 then it is used to calculate the number printed,
1440 otherwise the actual line in the current source file is printed. The
1441 message text is intended to be self explanatory (in the grand Unix
1442 tradition).
1443
1444 @cindex format of error messages
1445 Error messages have the format
1446 @smallexample
1447 file_name:@b{NNN}:FATAL:Error Message Text
1448 @end smallexample
1449 The file name and line number are derived as for warning
1450 messages. The actual message text may be rather less explanatory
1451 because many of them aren't supposed to happen.
1452
1453 @node Invoking
1454 @chapter Command-Line Options
1455
1456 @cindex options, all versions of assembler
1457 This chapter describes command-line options available in @emph{all}
1458 versions of the @sc{gnu} assembler; @pxref{Machine Dependencies}, for options specific
1459 @ifclear GENERIC
1460 to the @value{TARGET} target.
1461 @end ifclear
1462 @ifset GENERIC
1463 to particular machine architectures.
1464 @end ifset
1465
1466 @c man begin DESCRIPTION
1467
1468 If you are invoking @command{@value{AS}} via the @sc{gnu} C compiler,
1469 you can use the @samp{-Wa} option to pass arguments through to the assembler.
1470 The assembler arguments must be separated from each other (and the @samp{-Wa})
1471 by commas. For example:
1472
1473 @smallexample
1474 gcc -c -g -O -Wa,-alh,-L file.c
1475 @end smallexample
1476
1477 @noindent
1478 This passes two options to the assembler: @samp{-alh} (emit a listing to
1479 standard output with high-level and assembly source) and @samp{-L} (retain
1480 local symbols in the symbol table).
1481
1482 Usually you do not need to use this @samp{-Wa} mechanism, since many compiler
1483 command-line options are automatically passed to the assembler by the compiler.
1484 (You can call the @sc{gnu} compiler driver with the @samp{-v} option to see
1485 precisely what options it passes to each compilation pass, including the
1486 assembler.)
1487
1488 @c man end
1489
1490 @menu
1491 * a:: -a[cdhlns] enable listings
1492 * D:: -D for compatibility
1493 * f:: -f to work faster
1494 * I:: -I for .include search path
1495 @ifclear DIFF-TBL-KLUGE
1496 * K:: -K for compatibility
1497 @end ifclear
1498 @ifset DIFF-TBL-KLUGE
1499 * K:: -K for difference tables
1500 @end ifset
1501
1502 * L:: -L to retain local labels
1503 * listing:: --listing-XXX to configure listing output
1504 * M:: -M or --mri to assemble in MRI compatibility mode
1505 * MD:: --MD for dependency tracking
1506 * o:: -o to name the object file
1507 * R:: -R to join data and text sections
1508 * statistics:: --statistics to see statistics about assembly
1509 * traditional-format:: --traditional-format for compatible output
1510 * v:: -v to announce version
1511 * W:: -W, --no-warn, --warn, --fatal-warnings to control warnings
1512 * Z:: -Z to make object file even after errors
1513 @end menu
1514
1515 @node a
1516 @section Enable Listings: @option{-a[cdhlns]}
1517
1518 @kindex -a
1519 @kindex -ac
1520 @kindex -ad
1521 @kindex -ah
1522 @kindex -al
1523 @kindex -an
1524 @kindex -as
1525 @cindex listings, enabling
1526 @cindex assembly listings, enabling
1527
1528 These options enable listing output from the assembler. By itself,
1529 @samp{-a} requests high-level, assembly, and symbols listing.
1530 You can use other letters to select specific options for the list:
1531 @samp{-ah} requests a high-level language listing,
1532 @samp{-al} requests an output-program assembly listing, and
1533 @samp{-as} requests a symbol table listing.
1534 High-level listings require that a compiler debugging option like
1535 @samp{-g} be used, and that assembly listings (@samp{-al}) be requested
1536 also.
1537
1538 Use the @samp{-ac} option to omit false conditionals from a listing. Any lines
1539 which are not assembled because of a false @code{.if} (or @code{.ifdef}, or any
1540 other conditional), or a true @code{.if} followed by an @code{.else}, will be
1541 omitted from the listing.
1542
1543 Use the @samp{-ad} option to omit debugging directives from the
1544 listing.
1545
1546 Once you have specified one of these options, you can further control
1547 listing output and its appearance using the directives @code{.list},
1548 @code{.nolist}, @code{.psize}, @code{.eject}, @code{.title}, and
1549 @code{.sbttl}.
1550 The @samp{-an} option turns off all forms processing.
1551 If you do not request listing output with one of the @samp{-a} options, the
1552 listing-control directives have no effect.
1553
1554 The letters after @samp{-a} may be combined into one option,
1555 @emph{e.g.}, @samp{-aln}.
1556
1557 Note if the assembler source is coming from the standard input (eg because it
1558 is being created by @code{@value{GCC}} and the @samp{-pipe} command line switch
1559 is being used) then the listing will not contain any comments or preprocessor
1560 directives. This is because the listing code buffers input source lines from
1561 stdin only after they have been preprocessed by the assembler. This reduces
1562 memory usage and makes the code more efficient.
1563
1564 @node D
1565 @section @option{-D}
1566
1567 @kindex -D
1568 This option has no effect whatsoever, but it is accepted to make it more
1569 likely that scripts written for other assemblers also work with
1570 @command{@value{AS}}.
1571
1572 @node f
1573 @section Work Faster: @option{-f}
1574
1575 @kindex -f
1576 @cindex trusted compiler
1577 @cindex faster processing (@option{-f})
1578 @samp{-f} should only be used when assembling programs written by a
1579 (trusted) compiler. @samp{-f} stops the assembler from doing whitespace
1580 and comment preprocessing on
1581 the input file(s) before assembling them. @xref{Preprocessing,
1582 ,Preprocessing}.
1583
1584 @quotation
1585 @emph{Warning:} if you use @samp{-f} when the files actually need to be
1586 preprocessed (if they contain comments, for example), @command{@value{AS}} does
1587 not work correctly.
1588 @end quotation
1589
1590 @node I
1591 @section @code{.include} Search Path: @option{-I} @var{path}
1592
1593 @kindex -I @var{path}
1594 @cindex paths for @code{.include}
1595 @cindex search path for @code{.include}
1596 @cindex @code{include} directive search path
1597 Use this option to add a @var{path} to the list of directories
1598 @command{@value{AS}} searches for files specified in @code{.include}
1599 directives (@pxref{Include,,@code{.include}}). You may use @option{-I} as
1600 many times as necessary to include a variety of paths. The current
1601 working directory is always searched first; after that, @command{@value{AS}}
1602 searches any @samp{-I} directories in the same order as they were
1603 specified (left to right) on the command line.
1604
1605 @node K
1606 @section Difference Tables: @option{-K}
1607
1608 @kindex -K
1609 @ifclear DIFF-TBL-KLUGE
1610 On the @value{TARGET} family, this option is allowed, but has no effect. It is
1611 permitted for compatibility with the @sc{gnu} assembler on other platforms,
1612 where it can be used to warn when the assembler alters the machine code
1613 generated for @samp{.word} directives in difference tables. The @value{TARGET}
1614 family does not have the addressing limitations that sometimes lead to this
1615 alteration on other platforms.
1616 @end ifclear
1617
1618 @ifset DIFF-TBL-KLUGE
1619 @cindex difference tables, warning
1620 @cindex warning for altered difference tables
1621 @command{@value{AS}} sometimes alters the code emitted for directives of the form
1622 @samp{.word @var{sym1}-@var{sym2}}; @pxref{Word,,@code{.word}}.
1623 You can use the @samp{-K} option if you want a warning issued when this
1624 is done.
1625 @end ifset
1626
1627 @node L
1628 @section Include Local Labels: @option{-L}
1629
1630 @kindex -L
1631 @cindex local labels, retaining in output
1632 Labels beginning with @samp{L} (upper case only) are called @dfn{local
1633 labels}. @xref{Symbol Names}. Normally you do not see such labels when
1634 debugging, because they are intended for the use of programs (like
1635 compilers) that compose assembler programs, not for your notice.
1636 Normally both @command{@value{AS}} and @code{@value{LD}} discard such labels, so you do not
1637 normally debug with them.
1638
1639 This option tells @command{@value{AS}} to retain those @samp{L@dots{}} symbols
1640 in the object file. Usually if you do this you also tell the linker
1641 @code{@value{LD}} to preserve symbols whose names begin with @samp{L}.
1642
1643 By default, a local label is any label beginning with @samp{L}, but each
1644 target is allowed to redefine the local label prefix.
1645 @ifset HPPA
1646 On the HPPA local labels begin with @samp{L$}.
1647 @end ifset
1648
1649 @node listing
1650 @section Configuring listing output: @option{--listing}
1651
1652 The listing feature of the assembler can be enabled via the command line switch
1653 @samp{-a} (@pxref{a}). This feature combines the input source file(s) with a
1654 hex dump of the corresponding locations in the output object file, and displays
1655 them as a listing file. The format of this listing can be controlled by pseudo
1656 ops inside the assembler source (@pxref{List} @pxref{Title} @pxref{Sbttl}
1657 @pxref{Psize} @pxref{Eject}) and also by the following switches:
1658
1659 @table @gcctabopt
1660 @item --listing-lhs-width=@samp{number}
1661 @kindex --listing-lhs-width
1662 @cindex Width of first line disassembly output
1663 Sets the maximum width, in words, of the first line of the hex byte dump. This
1664 dump appears on the left hand side of the listing output.
1665
1666 @item --listing-lhs-width2=@samp{number}
1667 @kindex --listing-lhs-width2
1668 @cindex Width of continuation lines of disassembly output
1669 Sets the maximum width, in words, of any further lines of the hex byte dump for
1670 a given input source line. If this value is not specified, it defaults to being
1671 the same as the value specified for @samp{--listing-lhs-width}. If neither
1672 switch is used the default is to one.
1673
1674 @item --listing-rhs-width=@samp{number}
1675 @kindex --listing-rhs-width
1676 @cindex Width of source line output
1677 Sets the maximum width, in characters, of the source line that is displayed
1678 alongside the hex dump. The default value for this parameter is 100. The
1679 source line is displayed on the right hand side of the listing output.
1680
1681 @item --listing-cont-lines=@samp{number}
1682 @kindex --listing-cont-lines
1683 @cindex Maximum number of continuation lines
1684 Sets the maximum number of continuation lines of hex dump that will be
1685 displayed for a given single line of source input. The default value is 4.
1686 @end table
1687
1688 @node M
1689 @section Assemble in MRI Compatibility Mode: @option{-M}
1690
1691 @kindex -M
1692 @cindex MRI compatibility mode
1693 The @option{-M} or @option{--mri} option selects MRI compatibility mode. This
1694 changes the syntax and pseudo-op handling of @command{@value{AS}} to make it
1695 compatible with the @code{ASM68K} or the @code{ASM960} (depending upon the
1696 configured target) assembler from Microtec Research. The exact nature of the
1697 MRI syntax will not be documented here; see the MRI manuals for more
1698 information. Note in particular that the handling of macros and macro
1699 arguments is somewhat different. The purpose of this option is to permit
1700 assembling existing MRI assembler code using @command{@value{AS}}.
1701
1702 The MRI compatibility is not complete. Certain operations of the MRI assembler
1703 depend upon its object file format, and can not be supported using other object
1704 file formats. Supporting these would require enhancing each object file format
1705 individually. These are:
1706
1707 @itemize @bullet
1708 @item global symbols in common section
1709
1710 The m68k MRI assembler supports common sections which are merged by the linker.
1711 Other object file formats do not support this. @command{@value{AS}} handles
1712 common sections by treating them as a single common symbol. It permits local
1713 symbols to be defined within a common section, but it can not support global
1714 symbols, since it has no way to describe them.
1715
1716 @item complex relocations
1717
1718 The MRI assemblers support relocations against a negated section address, and
1719 relocations which combine the start addresses of two or more sections. These
1720 are not support by other object file formats.
1721
1722 @item @code{END} pseudo-op specifying start address
1723
1724 The MRI @code{END} pseudo-op permits the specification of a start address.
1725 This is not supported by other object file formats. The start address may
1726 instead be specified using the @option{-e} option to the linker, or in a linker
1727 script.
1728
1729 @item @code{IDNT}, @code{.ident} and @code{NAME} pseudo-ops
1730
1731 The MRI @code{IDNT}, @code{.ident} and @code{NAME} pseudo-ops assign a module
1732 name to the output file. This is not supported by other object file formats.
1733
1734 @item @code{ORG} pseudo-op
1735
1736 The m68k MRI @code{ORG} pseudo-op begins an absolute section at a given
1737 address. This differs from the usual @command{@value{AS}} @code{.org} pseudo-op,
1738 which changes the location within the current section. Absolute sections are
1739 not supported by other object file formats. The address of a section may be
1740 assigned within a linker script.
1741 @end itemize
1742
1743 There are some other features of the MRI assembler which are not supported by
1744 @command{@value{AS}}, typically either because they are difficult or because they
1745 seem of little consequence. Some of these may be supported in future releases.
1746
1747 @itemize @bullet
1748
1749 @item EBCDIC strings
1750
1751 EBCDIC strings are not supported.
1752
1753 @item packed binary coded decimal
1754
1755 Packed binary coded decimal is not supported. This means that the @code{DC.P}
1756 and @code{DCB.P} pseudo-ops are not supported.
1757
1758 @item @code{FEQU} pseudo-op
1759
1760 The m68k @code{FEQU} pseudo-op is not supported.
1761
1762 @item @code{NOOBJ} pseudo-op
1763
1764 The m68k @code{NOOBJ} pseudo-op is not supported.
1765
1766 @item @code{OPT} branch control options
1767
1768 The m68k @code{OPT} branch control options---@code{B}, @code{BRS}, @code{BRB},
1769 @code{BRL}, and @code{BRW}---are ignored. @command{@value{AS}} automatically
1770 relaxes all branches, whether forward or backward, to an appropriate size, so
1771 these options serve no purpose.
1772
1773 @item @code{OPT} list control options
1774
1775 The following m68k @code{OPT} list control options are ignored: @code{C},
1776 @code{CEX}, @code{CL}, @code{CRE}, @code{E}, @code{G}, @code{I}, @code{M},
1777 @code{MEX}, @code{MC}, @code{MD}, @code{X}.
1778
1779 @item other @code{OPT} options
1780
1781 The following m68k @code{OPT} options are ignored: @code{NEST}, @code{O},
1782 @code{OLD}, @code{OP}, @code{P}, @code{PCO}, @code{PCR}, @code{PCS}, @code{R}.
1783
1784 @item @code{OPT} @code{D} option is default
1785
1786 The m68k @code{OPT} @code{D} option is the default, unlike the MRI assembler.
1787 @code{OPT NOD} may be used to turn it off.
1788
1789 @item @code{XREF} pseudo-op.
1790
1791 The m68k @code{XREF} pseudo-op is ignored.
1792
1793 @item @code{.debug} pseudo-op
1794
1795 The i960 @code{.debug} pseudo-op is not supported.
1796
1797 @item @code{.extended} pseudo-op
1798
1799 The i960 @code{.extended} pseudo-op is not supported.
1800
1801 @item @code{.list} pseudo-op.
1802
1803 The various options of the i960 @code{.list} pseudo-op are not supported.
1804
1805 @item @code{.optimize} pseudo-op
1806
1807 The i960 @code{.optimize} pseudo-op is not supported.
1808
1809 @item @code{.output} pseudo-op
1810
1811 The i960 @code{.output} pseudo-op is not supported.
1812
1813 @item @code{.setreal} pseudo-op
1814
1815 The i960 @code{.setreal} pseudo-op is not supported.
1816
1817 @end itemize
1818
1819 @node MD
1820 @section Dependency Tracking: @option{--MD}
1821
1822 @kindex --MD
1823 @cindex dependency tracking
1824 @cindex make rules
1825
1826 @command{@value{AS}} can generate a dependency file for the file it creates. This
1827 file consists of a single rule suitable for @code{make} describing the
1828 dependencies of the main source file.
1829
1830 The rule is written to the file named in its argument.
1831
1832 This feature is used in the automatic updating of makefiles.
1833
1834 @node o
1835 @section Name the Object File: @option{-o}
1836
1837 @kindex -o
1838 @cindex naming object file
1839 @cindex object file name
1840 There is always one object file output when you run @command{@value{AS}}. By
1841 default it has the name
1842 @ifset GENERIC
1843 @ifset I960
1844 @file{a.out} (or @file{b.out}, for Intel 960 targets only).
1845 @end ifset
1846 @ifclear I960
1847 @file{a.out}.
1848 @end ifclear
1849 @end ifset
1850 @ifclear GENERIC
1851 @ifset I960
1852 @file{b.out}.
1853 @end ifset
1854 @ifclear I960
1855 @file{a.out}.
1856 @end ifclear
1857 @end ifclear
1858 You use this option (which takes exactly one filename) to give the
1859 object file a different name.
1860
1861 Whatever the object file is called, @command{@value{AS}} overwrites any
1862 existing file of the same name.
1863
1864 @node R
1865 @section Join Data and Text Sections: @option{-R}
1866
1867 @kindex -R
1868 @cindex data and text sections, joining
1869 @cindex text and data sections, joining
1870 @cindex joining text and data sections
1871 @cindex merging text and data sections
1872 @option{-R} tells @command{@value{AS}} to write the object file as if all
1873 data-section data lives in the text section. This is only done at
1874 the very last moment: your binary data are the same, but data
1875 section parts are relocated differently. The data section part of
1876 your object file is zero bytes long because all its bytes are
1877 appended to the text section. (@xref{Sections,,Sections and Relocation}.)
1878
1879 When you specify @option{-R} it would be possible to generate shorter
1880 address displacements (because we do not have to cross between text and
1881 data section). We refrain from doing this simply for compatibility with
1882 older versions of @command{@value{AS}}. In future, @option{-R} may work this way.
1883
1884 @ifset COFF-ELF
1885 When @command{@value{AS}} is configured for COFF or ELF output,
1886 this option is only useful if you use sections named @samp{.text} and
1887 @samp{.data}.
1888 @end ifset
1889
1890 @ifset HPPA
1891 @option{-R} is not supported for any of the HPPA targets. Using
1892 @option{-R} generates a warning from @command{@value{AS}}.
1893 @end ifset
1894
1895 @node statistics
1896 @section Display Assembly Statistics: @option{--statistics}
1897
1898 @kindex --statistics
1899 @cindex statistics, about assembly
1900 @cindex time, total for assembly
1901 @cindex space used, maximum for assembly
1902 Use @samp{--statistics} to display two statistics about the resources used by
1903 @command{@value{AS}}: the maximum amount of space allocated during the assembly
1904 (in bytes), and the total execution time taken for the assembly (in @sc{cpu}
1905 seconds).
1906
1907 @node traditional-format
1908 @section Compatible Output: @option{--traditional-format}
1909
1910 @kindex --traditional-format
1911 For some targets, the output of @command{@value{AS}} is different in some ways
1912 from the output of some existing assembler. This switch requests
1913 @command{@value{AS}} to use the traditional format instead.
1914
1915 For example, it disables the exception frame optimizations which
1916 @command{@value{AS}} normally does by default on @code{@value{GCC}} output.
1917
1918 @node v
1919 @section Announce Version: @option{-v}
1920
1921 @kindex -v
1922 @kindex -version
1923 @cindex assembler version
1924 @cindex version of assembler
1925 You can find out what version of as is running by including the
1926 option @samp{-v} (which you can also spell as @samp{-version}) on the
1927 command line.
1928
1929 @node W
1930 @section Control Warnings: @option{-W}, @option{--warn}, @option{--no-warn}, @option{--fatal-warnings}
1931
1932 @command{@value{AS}} should never give a warning or error message when
1933 assembling compiler output. But programs written by people often
1934 cause @command{@value{AS}} to give a warning that a particular assumption was
1935 made. All such warnings are directed to the standard error file.
1936
1937 @kindex -W
1938 @kindex --no-warn
1939 @cindex suppressing warnings
1940 @cindex warnings, suppressing
1941 If you use the @option{-W} and @option{--no-warn} options, no warnings are issued.
1942 This only affects the warning messages: it does not change any particular of
1943 how @command{@value{AS}} assembles your file. Errors, which stop the assembly,
1944 are still reported.
1945
1946 @kindex --fatal-warnings
1947 @cindex errors, caused by warnings
1948 @cindex warnings, causing error
1949 If you use the @option{--fatal-warnings} option, @command{@value{AS}} considers
1950 files that generate warnings to be in error.
1951
1952 @kindex --warn
1953 @cindex warnings, switching on
1954 You can switch these options off again by specifying @option{--warn}, which
1955 causes warnings to be output as usual.
1956
1957 @node Z
1958 @section Generate Object File in Spite of Errors: @option{-Z}
1959 @cindex object file, after errors
1960 @cindex errors, continuing after
1961 After an error message, @command{@value{AS}} normally produces no output. If for
1962 some reason you are interested in object file output even after
1963 @command{@value{AS}} gives an error message on your program, use the @samp{-Z}
1964 option. If there are any errors, @command{@value{AS}} continues anyways, and
1965 writes an object file after a final warning message of the form @samp{@var{n}
1966 errors, @var{m} warnings, generating bad object file.}
1967
1968 @node Syntax
1969 @chapter Syntax
1970
1971 @cindex machine-independent syntax
1972 @cindex syntax, machine-independent
1973 This chapter describes the machine-independent syntax allowed in a
1974 source file. @command{@value{AS}} syntax is similar to what many other
1975 assemblers use; it is inspired by the BSD 4.2
1976 @ifclear VAX
1977 assembler.
1978 @end ifclear
1979 @ifset VAX
1980 assembler, except that @command{@value{AS}} does not assemble Vax bit-fields.
1981 @end ifset
1982
1983 @menu
1984 * Preprocessing:: Preprocessing
1985 * Whitespace:: Whitespace
1986 * Comments:: Comments
1987 * Symbol Intro:: Symbols
1988 * Statements:: Statements
1989 * Constants:: Constants
1990 @end menu
1991
1992 @node Preprocessing
1993 @section Preprocessing
1994
1995 @cindex preprocessing
1996 The @command{@value{AS}} internal preprocessor:
1997 @itemize @bullet
1998 @cindex whitespace, removed by preprocessor
1999 @item
2000 adjusts and removes extra whitespace. It leaves one space or tab before
2001 the keywords on a line, and turns any other whitespace on the line into
2002 a single space.
2003
2004 @cindex comments, removed by preprocessor
2005 @item
2006 removes all comments, replacing them with a single space, or an
2007 appropriate number of newlines.
2008
2009 @cindex constants, converted by preprocessor
2010 @item
2011 converts character constants into the appropriate numeric values.
2012 @end itemize
2013
2014 It does not do macro processing, include file handling, or
2015 anything else you may get from your C compiler's preprocessor. You can
2016 do include file processing with the @code{.include} directive
2017 (@pxref{Include,,@code{.include}}). You can use the @sc{gnu} C compiler driver
2018 to get other ``CPP'' style preprocessing by giving the input file a
2019 @samp{.S} suffix. @xref{Overall Options,, Options Controlling the Kind of
2020 Output, gcc.info, Using GNU CC}.
2021
2022 Excess whitespace, comments, and character constants
2023 cannot be used in the portions of the input text that are not
2024 preprocessed.
2025
2026 @cindex turning preprocessing on and off
2027 @cindex preprocessing, turning on and off
2028 @kindex #NO_APP
2029 @kindex #APP
2030 If the first line of an input file is @code{#NO_APP} or if you use the
2031 @samp{-f} option, whitespace and comments are not removed from the input file.
2032 Within an input file, you can ask for whitespace and comment removal in
2033 specific portions of the by putting a line that says @code{#APP} before the
2034 text that may contain whitespace or comments, and putting a line that says
2035 @code{#NO_APP} after this text. This feature is mainly intend to support
2036 @code{asm} statements in compilers whose output is otherwise free of comments
2037 and whitespace.
2038
2039 @node Whitespace
2040 @section Whitespace
2041
2042 @cindex whitespace
2043 @dfn{Whitespace} is one or more blanks or tabs, in any order.
2044 Whitespace is used to separate symbols, and to make programs neater for
2045 people to read. Unless within character constants
2046 (@pxref{Characters,,Character Constants}), any whitespace means the same
2047 as exactly one space.
2048
2049 @node Comments
2050 @section Comments
2051
2052 @cindex comments
2053 There are two ways of rendering comments to @command{@value{AS}}. In both
2054 cases the comment is equivalent to one space.
2055
2056 Anything from @samp{/*} through the next @samp{*/} is a comment.
2057 This means you may not nest these comments.
2058
2059 @smallexample
2060 /*
2061 The only way to include a newline ('\n') in a comment
2062 is to use this sort of comment.
2063 */
2064
2065 /* This sort of comment does not nest. */
2066 @end smallexample
2067
2068 @cindex line comment character
2069 Anything from the @dfn{line comment} character to the next newline
2070 is considered a comment and is ignored. The line comment character is
2071 @ifset A29K
2072 @samp{;} for the AMD 29K family;
2073 @end ifset
2074 @ifset ARC
2075 @samp{;} on the ARC;
2076 @end ifset
2077 @ifset ARM
2078 @samp{@@} on the ARM;
2079 @end ifset
2080 @ifset H8/300
2081 @samp{;} for the H8/300 family;
2082 @end ifset
2083 @ifset H8/500
2084 @samp{!} for the H8/500 family;
2085 @end ifset
2086 @ifset HPPA
2087 @samp{;} for the HPPA;
2088 @end ifset
2089 @ifset I80386
2090 @samp{#} on the i386 and x86-64;
2091 @end ifset
2092 @ifset I960
2093 @samp{#} on the i960;
2094 @end ifset
2095 @ifset PDP11
2096 @samp{;} for the PDP-11;
2097 @end ifset
2098 @ifset PJ
2099 @samp{;} for picoJava;
2100 @end ifset
2101 @ifset PPC
2102 @samp{#} for Motorola PowerPC;
2103 @end ifset
2104 @ifset SH
2105 @samp{!} for the Renesas / SuperH SH;
2106 @end ifset
2107 @ifset SPARC
2108 @samp{!} on the SPARC;
2109 @end ifset
2110 @ifset IP2K
2111 @samp{#} on the ip2k;
2112 @end ifset
2113 @ifset M32R
2114 @samp{#} on the m32r;
2115 @end ifset
2116 @ifset M680X0
2117 @samp{|} on the 680x0;
2118 @end ifset
2119 @ifset M68HC11
2120 @samp{#} on the 68HC11 and 68HC12;
2121 @end ifset
2122 @ifset M880X0
2123 @samp{;} on the M880x0;
2124 @end ifset
2125 @ifset VAX
2126 @samp{#} on the Vax;
2127 @end ifset
2128 @ifset Z8000
2129 @samp{!} for the Z8000;
2130 @end ifset
2131 @ifset V850
2132 @samp{#} on the V850;
2133 @end ifset
2134 @ifset XTENSA
2135 @samp{#} for Xtensa systems;
2136 @end ifset
2137 see @ref{Machine Dependencies}. @refill
2138 @c FIXME What about i860?
2139
2140 @ifset GENERIC
2141 On some machines there are two different line comment characters. One
2142 character only begins a comment if it is the first non-whitespace character on
2143 a line, while the other always begins a comment.
2144 @end ifset
2145
2146 @ifset V850
2147 The V850 assembler also supports a double dash as starting a comment that
2148 extends to the end of the line.
2149
2150 @samp{--};
2151 @end ifset
2152
2153 @kindex #
2154 @cindex lines starting with @code{#}
2155 @cindex logical line numbers
2156 To be compatible with past assemblers, lines that begin with @samp{#} have a
2157 special interpretation. Following the @samp{#} should be an absolute
2158 expression (@pxref{Expressions}): the logical line number of the @emph{next}
2159 line. Then a string (@pxref{Strings,, Strings}) is allowed: if present it is a
2160 new logical file name. The rest of the line, if any, should be whitespace.
2161
2162 If the first non-whitespace characters on the line are not numeric,
2163 the line is ignored. (Just like a comment.)
2164
2165 @smallexample
2166 # This is an ordinary comment.
2167 # 42-6 "new_file_name" # New logical file name
2168 # This is logical line # 36.
2169 @end smallexample
2170 This feature is deprecated, and may disappear from future versions
2171 of @command{@value{AS}}.
2172
2173 @node Symbol Intro
2174 @section Symbols
2175
2176 @cindex characters used in symbols
2177 @ifclear SPECIAL-SYMS
2178 A @dfn{symbol} is one or more characters chosen from the set of all
2179 letters (both upper and lower case), digits and the three characters
2180 @samp{_.$}.
2181 @end ifclear
2182 @ifset SPECIAL-SYMS
2183 @ifclear GENERIC
2184 @ifset H8
2185 A @dfn{symbol} is one or more characters chosen from the set of all
2186 letters (both upper and lower case), digits and the three characters
2187 @samp{._$}. (Save that, on the H8/300 only, you may not use @samp{$} in
2188 symbol names.)
2189 @end ifset
2190 @end ifclear
2191 @end ifset
2192 @ifset GENERIC
2193 On most machines, you can also use @code{$} in symbol names; exceptions
2194 are noted in @ref{Machine Dependencies}.
2195 @end ifset
2196 No symbol may begin with a digit. Case is significant.
2197 There is no length limit: all characters are significant. Symbols are
2198 delimited by characters not in that set, or by the beginning of a file
2199 (since the source program must end with a newline, the end of a file is
2200 not a possible symbol delimiter). @xref{Symbols}.
2201 @cindex length of symbols
2202
2203 @node Statements
2204 @section Statements
2205
2206 @cindex statements, structure of
2207 @cindex line separator character
2208 @cindex statement separator character
2209 @ifclear GENERIC
2210 @ifclear abnormal-separator
2211 A @dfn{statement} ends at a newline character (@samp{\n}) or at a
2212 semicolon (@samp{;}). The newline or semicolon is considered part of
2213 the preceding statement. Newlines and semicolons within character
2214 constants are an exception: they do not end statements.
2215 @end ifclear
2216 @ifset abnormal-separator
2217 @ifset A29K
2218 A @dfn{statement} ends at a newline character (@samp{\n}) or an ``at''
2219 sign (@samp{@@}). The newline or at sign is considered part of the
2220 preceding statement. Newlines and at signs within character constants
2221 are an exception: they do not end statements.
2222 @end ifset
2223 @ifset HPPA
2224 A @dfn{statement} ends at a newline character (@samp{\n}) or an exclamation
2225 point (@samp{!}). The newline or exclamation point is considered part of the
2226 preceding statement. Newlines and exclamation points within character
2227 constants are an exception: they do not end statements.
2228 @end ifset
2229 @ifset H8
2230 A @dfn{statement} ends at a newline character (@samp{\n}); or (for the
2231 H8/300) a dollar sign (@samp{$}); or (for the
2232 Renesas-SH or the
2233 H8/500) a semicolon
2234 (@samp{;}). The newline or separator character is considered part of
2235 the preceding statement. Newlines and separators within character
2236 constants are an exception: they do not end statements.
2237 @end ifset
2238 @end ifset
2239 @end ifclear
2240 @ifset GENERIC
2241 A @dfn{statement} ends at a newline character (@samp{\n}) or line
2242 separator character. (The line separator is usually @samp{;}, unless
2243 this conflicts with the comment character; @pxref{Machine Dependencies}.) The
2244 newline or separator character is considered part of the preceding
2245 statement. Newlines and separators within character constants are an
2246 exception: they do not end statements.
2247 @end ifset
2248
2249 @cindex newline, required at file end
2250 @cindex EOF, newline must precede
2251 It is an error to end any statement with end-of-file: the last
2252 character of any input file should be a newline.@refill
2253
2254 An empty statement is allowed, and may include whitespace. It is ignored.
2255
2256 @cindex instructions and directives
2257 @cindex directives and instructions
2258 @c "key symbol" is not used elsewhere in the document; seems pedantic to
2259 @c @defn{} it in that case, as was done previously... doc@cygnus.com,
2260 @c 13feb91.
2261 A statement begins with zero or more labels, optionally followed by a
2262 key symbol which determines what kind of statement it is. The key
2263 symbol determines the syntax of the rest of the statement. If the
2264 symbol begins with a dot @samp{.} then the statement is an assembler
2265 directive: typically valid for any computer. If the symbol begins with
2266 a letter the statement is an assembly language @dfn{instruction}: it
2267 assembles into a machine language instruction.
2268 @ifset GENERIC
2269 Different versions of @command{@value{AS}} for different computers
2270 recognize different instructions. In fact, the same symbol may
2271 represent a different instruction in a different computer's assembly
2272 language.@refill
2273 @end ifset
2274
2275 @cindex @code{:} (label)
2276 @cindex label (@code{:})
2277 A label is a symbol immediately followed by a colon (@code{:}).
2278 Whitespace before a label or after a colon is permitted, but you may not
2279 have whitespace between a label's symbol and its colon. @xref{Labels}.
2280
2281 @ifset HPPA
2282 For HPPA targets, labels need not be immediately followed by a colon, but
2283 the definition of a label must begin in column zero. This also implies that
2284 only one label may be defined on each line.
2285 @end ifset
2286
2287 @smallexample
2288 label: .directive followed by something
2289 another_label: # This is an empty statement.
2290 instruction operand_1, operand_2, @dots{}
2291 @end smallexample
2292
2293 @node Constants
2294 @section Constants
2295
2296 @cindex constants
2297 A constant is a number, written so that its value is known by
2298 inspection, without knowing any context. Like this:
2299 @smallexample
2300 @group
2301 .byte 74, 0112, 092, 0x4A, 0X4a, 'J, '\J # All the same value.
2302 .ascii "Ring the bell\7" # A string constant.
2303 .octa 0x123456789abcdef0123456789ABCDEF0 # A bignum.
2304 .float 0f-314159265358979323846264338327\
2305 95028841971.693993751E-40 # - pi, a flonum.
2306 @end group
2307 @end smallexample
2308
2309 @menu
2310 * Characters:: Character Constants
2311 * Numbers:: Number Constants
2312 @end menu
2313
2314 @node Characters
2315 @subsection Character Constants
2316
2317 @cindex character constants
2318 @cindex constants, character
2319 There are two kinds of character constants. A @dfn{character} stands
2320 for one character in one byte and its value may be used in
2321 numeric expressions. String constants (properly called string
2322 @emph{literals}) are potentially many bytes and their values may not be
2323 used in arithmetic expressions.
2324
2325 @menu
2326 * Strings:: Strings
2327 * Chars:: Characters
2328 @end menu
2329
2330 @node Strings
2331 @subsubsection Strings
2332
2333 @cindex string constants
2334 @cindex constants, string
2335 A @dfn{string} is written between double-quotes. It may contain
2336 double-quotes or null characters. The way to get special characters
2337 into a string is to @dfn{escape} these characters: precede them with
2338 a backslash @samp{\} character. For example @samp{\\} represents
2339 one backslash: the first @code{\} is an escape which tells
2340 @command{@value{AS}} to interpret the second character literally as a backslash
2341 (which prevents @command{@value{AS}} from recognizing the second @code{\} as an
2342 escape character). The complete list of escapes follows.
2343
2344 @cindex escape codes, character
2345 @cindex character escape codes
2346 @table @kbd
2347 @c @item \a
2348 @c Mnemonic for ACKnowledge; for ASCII this is octal code 007.
2349 @c
2350 @cindex @code{\b} (backspace character)
2351 @cindex backspace (@code{\b})
2352 @item \b
2353 Mnemonic for backspace; for ASCII this is octal code 010.
2354
2355 @c @item \e
2356 @c Mnemonic for EOText; for ASCII this is octal code 004.
2357 @c
2358 @cindex @code{\f} (formfeed character)
2359 @cindex formfeed (@code{\f})
2360 @item \f
2361 Mnemonic for FormFeed; for ASCII this is octal code 014.
2362
2363 @cindex @code{\n} (newline character)
2364 @cindex newline (@code{\n})
2365 @item \n
2366 Mnemonic for newline; for ASCII this is octal code 012.
2367
2368 @c @item \p
2369 @c Mnemonic for prefix; for ASCII this is octal code 033, usually known as @code{escape}.
2370 @c
2371 @cindex @code{\r} (carriage return character)
2372 @cindex carriage return (@code{\r})
2373 @item \r
2374 Mnemonic for carriage-Return; for ASCII this is octal code 015.
2375
2376 @c @item \s
2377 @c Mnemonic for space; for ASCII this is octal code 040. Included for compliance with
2378 @c other assemblers.
2379 @c
2380 @cindex @code{\t} (tab)
2381 @cindex tab (@code{\t})
2382 @item \t
2383 Mnemonic for horizontal Tab; for ASCII this is octal code 011.
2384
2385 @c @item \v
2386 @c Mnemonic for Vertical tab; for ASCII this is octal code 013.
2387 @c @item \x @var{digit} @var{digit} @var{digit}
2388 @c A hexadecimal character code. The numeric code is 3 hexadecimal digits.
2389 @c
2390 @cindex @code{\@var{ddd}} (octal character code)
2391 @cindex octal character code (@code{\@var{ddd}})
2392 @item \ @var{digit} @var{digit} @var{digit}
2393 An octal character code. The numeric code is 3 octal digits.
2394 For compatibility with other Unix systems, 8 and 9 are accepted as digits:
2395 for example, @code{\008} has the value 010, and @code{\009} the value 011.
2396
2397 @cindex @code{\@var{xd...}} (hex character code)
2398 @cindex hex character code (@code{\@var{xd...}})
2399 @item \@code{x} @var{hex-digits...}
2400 A hex character code. All trailing hex digits are combined. Either upper or
2401 lower case @code{x} works.
2402
2403 @cindex @code{\\} (@samp{\} character)
2404 @cindex backslash (@code{\\})
2405 @item \\
2406 Represents one @samp{\} character.
2407
2408 @c @item \'
2409 @c Represents one @samp{'} (accent acute) character.
2410 @c This is needed in single character literals
2411 @c (@xref{Characters,,Character Constants}.) to represent
2412 @c a @samp{'}.
2413 @c
2414 @cindex @code{\"} (doublequote character)
2415 @cindex doublequote (@code{\"})
2416 @item \"
2417 Represents one @samp{"} character. Needed in strings to represent
2418 this character, because an unescaped @samp{"} would end the string.
2419
2420 @item \ @var{anything-else}
2421 Any other character when escaped by @kbd{\} gives a warning, but
2422 assembles as if the @samp{\} was not present. The idea is that if
2423 you used an escape sequence you clearly didn't want the literal
2424 interpretation of the following character. However @command{@value{AS}} has no
2425 other interpretation, so @command{@value{AS}} knows it is giving you the wrong
2426 code and warns you of the fact.
2427 @end table
2428
2429 Which characters are escapable, and what those escapes represent,
2430 varies widely among assemblers. The current set is what we think
2431 the BSD 4.2 assembler recognizes, and is a subset of what most C
2432 compilers recognize. If you are in doubt, do not use an escape
2433 sequence.
2434
2435 @node Chars
2436 @subsubsection Characters
2437
2438 @cindex single character constant
2439 @cindex character, single
2440 @cindex constant, single character
2441 A single character may be written as a single quote immediately
2442 followed by that character. The same escapes apply to characters as
2443 to strings. So if you want to write the character backslash, you
2444 must write @kbd{'\\} where the first @code{\} escapes the second
2445 @code{\}. As you can see, the quote is an acute accent, not a
2446 grave accent. A newline
2447 @ifclear GENERIC
2448 @ifclear abnormal-separator
2449 (or semicolon @samp{;})
2450 @end ifclear
2451 @ifset abnormal-separator
2452 @ifset A29K
2453 (or at sign @samp{@@})
2454 @end ifset
2455 @ifset H8
2456 (or dollar sign @samp{$}, for the H8/300; or semicolon @samp{;} for the
2457 Renesas SH or H8/500)
2458 @end ifset
2459 @end ifset
2460 @end ifclear
2461 immediately following an acute accent is taken as a literal character
2462 and does not count as the end of a statement. The value of a character
2463 constant in a numeric expression is the machine's byte-wide code for
2464 that character. @command{@value{AS}} assumes your character code is ASCII:
2465 @kbd{'A} means 65, @kbd{'B} means 66, and so on. @refill
2466
2467 @node Numbers
2468 @subsection Number Constants
2469
2470 @cindex constants, number
2471 @cindex number constants
2472 @command{@value{AS}} distinguishes three kinds of numbers according to how they
2473 are stored in the target machine. @emph{Integers} are numbers that
2474 would fit into an @code{int} in the C language. @emph{Bignums} are
2475 integers, but they are stored in more than 32 bits. @emph{Flonums}
2476 are floating point numbers, described below.
2477
2478 @menu
2479 * Integers:: Integers
2480 * Bignums:: Bignums
2481 * Flonums:: Flonums
2482 @ifclear GENERIC
2483 @ifset I960
2484 * Bit Fields:: Bit Fields
2485 @end ifset
2486 @end ifclear
2487 @end menu
2488
2489 @node Integers
2490 @subsubsection Integers
2491 @cindex integers
2492 @cindex constants, integer
2493
2494 @cindex binary integers
2495 @cindex integers, binary
2496 A binary integer is @samp{0b} or @samp{0B} followed by zero or more of
2497 the binary digits @samp{01}.
2498
2499 @cindex octal integers
2500 @cindex integers, octal
2501 An octal integer is @samp{0} followed by zero or more of the octal
2502 digits (@samp{01234567}).
2503
2504 @cindex decimal integers
2505 @cindex integers, decimal
2506 A decimal integer starts with a non-zero digit followed by zero or
2507 more digits (@samp{0123456789}).
2508
2509 @cindex hexadecimal integers
2510 @cindex integers, hexadecimal
2511 A hexadecimal integer is @samp{0x} or @samp{0X} followed by one or
2512 more hexadecimal digits chosen from @samp{0123456789abcdefABCDEF}.
2513
2514 Integers have the usual values. To denote a negative integer, use
2515 the prefix operator @samp{-} discussed under expressions
2516 (@pxref{Prefix Ops,,Prefix Operators}).
2517
2518 @node Bignums
2519 @subsubsection Bignums
2520
2521 @cindex bignums
2522 @cindex constants, bignum
2523 A @dfn{bignum} has the same syntax and semantics as an integer
2524 except that the number (or its negative) takes more than 32 bits to
2525 represent in binary. The distinction is made because in some places
2526 integers are permitted while bignums are not.
2527
2528 @node Flonums
2529 @subsubsection Flonums
2530 @cindex flonums
2531 @cindex floating point numbers
2532 @cindex constants, floating point
2533
2534 @cindex precision, floating point
2535 A @dfn{flonum} represents a floating point number. The translation is
2536 indirect: a decimal floating point number from the text is converted by
2537 @command{@value{AS}} to a generic binary floating point number of more than
2538 sufficient precision. This generic floating point number is converted
2539 to a particular computer's floating point format (or formats) by a
2540 portion of @command{@value{AS}} specialized to that computer.
2541
2542 A flonum is written by writing (in order)
2543 @itemize @bullet
2544 @item
2545 The digit @samp{0}.
2546 @ifset HPPA
2547 (@samp{0} is optional on the HPPA.)
2548 @end ifset
2549
2550 @item
2551 A letter, to tell @command{@value{AS}} the rest of the number is a flonum.
2552 @ifset GENERIC
2553 @kbd{e} is recommended. Case is not important.
2554 @ignore
2555 @c FIXME: verify if flonum syntax really this vague for most cases
2556 (Any otherwise illegal letter works here, but that might be changed. Vax BSD
2557 4.2 assembler seems to allow any of @samp{defghDEFGH}.)
2558 @end ignore
2559
2560 On the H8/300, H8/500,
2561 Renesas / SuperH SH,
2562 and AMD 29K architectures, the letter must be
2563 one of the letters @samp{DFPRSX} (in upper or lower case).
2564
2565 On the ARC, the letter must be one of the letters @samp{DFRS}
2566 (in upper or lower case).
2567
2568 On the Intel 960 architecture, the letter must be
2569 one of the letters @samp{DFT} (in upper or lower case).
2570
2571 On the HPPA architecture, the letter must be @samp{E} (upper case only).
2572 @end ifset
2573 @ifclear GENERIC
2574 @ifset A29K
2575 One of the letters @samp{DFPRSX} (in upper or lower case).
2576 @end ifset
2577 @ifset ARC
2578 One of the letters @samp{DFRS} (in upper or lower case).
2579 @end ifset
2580 @ifset H8
2581 One of the letters @samp{DFPRSX} (in upper or lower case).
2582 @end ifset
2583 @ifset HPPA
2584 The letter @samp{E} (upper case only).
2585 @end ifset
2586 @ifset I960
2587 One of the letters @samp{DFT} (in upper or lower case).
2588 @end ifset
2589 @end ifclear
2590
2591 @item
2592 An optional sign: either @samp{+} or @samp{-}.
2593
2594 @item
2595 An optional @dfn{integer part}: zero or more decimal digits.
2596
2597 @item
2598 An optional @dfn{fractional part}: @samp{.} followed by zero
2599 or more decimal digits.
2600
2601 @item
2602 An optional exponent, consisting of:
2603
2604 @itemize @bullet
2605 @item
2606 An @samp{E} or @samp{e}.
2607 @c I can't find a config where "EXP_CHARS" is other than 'eE', but in
2608 @c principle this can perfectly well be different on different targets.
2609 @item
2610 Optional sign: either @samp{+} or @samp{-}.
2611 @item
2612 One or more decimal digits.
2613 @end itemize
2614
2615 @end itemize
2616
2617 At least one of the integer part or the fractional part must be
2618 present. The floating point number has the usual base-10 value.
2619
2620 @command{@value{AS}} does all processing using integers. Flonums are computed
2621 independently of any floating point hardware in the computer running
2622 @command{@value{AS}}.
2623
2624 @ifclear GENERIC
2625 @ifset I960
2626 @c Bit fields are written as a general facility but are also controlled
2627 @c by a conditional-compilation flag---which is as of now (21mar91)
2628 @c turned on only by the i960 config of GAS.
2629 @node Bit Fields
2630 @subsubsection Bit Fields
2631
2632 @cindex bit fields
2633 @cindex constants, bit field
2634 You can also define numeric constants as @dfn{bit fields}.
2635 specify two numbers separated by a colon---
2636 @example
2637 @var{mask}:@var{value}
2638 @end example
2639 @noindent
2640 @command{@value{AS}} applies a bitwise @sc{and} between @var{mask} and
2641 @var{value}.
2642
2643 The resulting number is then packed
2644 @ifset GENERIC
2645 @c this conditional paren in case bit fields turned on elsewhere than 960
2646 (in host-dependent byte order)
2647 @end ifset
2648 into a field whose width depends on which assembler directive has the
2649 bit-field as its argument. Overflow (a result from the bitwise and
2650 requiring more binary digits to represent) is not an error; instead,
2651 more constants are generated, of the specified width, beginning with the
2652 least significant digits.@refill
2653
2654 The directives @code{.byte}, @code{.hword}, @code{.int}, @code{.long},
2655 @code{.short}, and @code{.word} accept bit-field arguments.
2656 @end ifset
2657 @end ifclear
2658
2659 @node Sections
2660 @chapter Sections and Relocation
2661 @cindex sections
2662 @cindex relocation
2663
2664 @menu
2665 * Secs Background:: Background
2666 * Ld Sections:: Linker Sections
2667 * As Sections:: Assembler Internal Sections
2668 * Sub-Sections:: Sub-Sections
2669 * bss:: bss Section
2670 @end menu
2671
2672 @node Secs Background
2673 @section Background
2674
2675 Roughly, a section is a range of addresses, with no gaps; all data
2676 ``in'' those addresses is treated the same for some particular purpose.
2677 For example there may be a ``read only'' section.
2678
2679 @cindex linker, and assembler
2680 @cindex assembler, and linker
2681 The linker @code{@value{LD}} reads many object files (partial programs) and
2682 combines their contents to form a runnable program. When @command{@value{AS}}
2683 emits an object file, the partial program is assumed to start at address 0.
2684 @code{@value{LD}} assigns the final addresses for the partial program, so that
2685 different partial programs do not overlap. This is actually an
2686 oversimplification, but it suffices to explain how @command{@value{AS}} uses
2687 sections.
2688
2689 @code{@value{LD}} moves blocks of bytes of your program to their run-time
2690 addresses. These blocks slide to their run-time addresses as rigid
2691 units; their length does not change and neither does the order of bytes
2692 within them. Such a rigid unit is called a @emph{section}. Assigning
2693 run-time addresses to sections is called @dfn{relocation}. It includes
2694 the task of adjusting mentions of object-file addresses so they refer to
2695 the proper run-time addresses.
2696 @ifset H8
2697 For the H8/300 and H8/500,
2698 and for the Renesas / SuperH SH,
2699 @command{@value{AS}} pads sections if needed to
2700 ensure they end on a word (sixteen bit) boundary.
2701 @end ifset
2702
2703 @cindex standard assembler sections
2704 An object file written by @command{@value{AS}} has at least three sections, any
2705 of which may be empty. These are named @dfn{text}, @dfn{data} and
2706 @dfn{bss} sections.
2707
2708 @ifset COFF-ELF
2709 @ifset GENERIC
2710 When it generates COFF or ELF output,
2711 @end ifset
2712 @command{@value{AS}} can also generate whatever other named sections you specify
2713 using the @samp{.section} directive (@pxref{Section,,@code{.section}}).
2714 If you do not use any directives that place output in the @samp{.text}
2715 or @samp{.data} sections, these sections still exist, but are empty.
2716 @end ifset
2717
2718 @ifset HPPA
2719 @ifset GENERIC
2720 When @command{@value{AS}} generates SOM or ELF output for the HPPA,
2721 @end ifset
2722 @command{@value{AS}} can also generate whatever other named sections you
2723 specify using the @samp{.space} and @samp{.subspace} directives. See
2724 @cite{HP9000 Series 800 Assembly Language Reference Manual}
2725 (HP 92432-90001) for details on the @samp{.space} and @samp{.subspace}
2726 assembler directives.
2727
2728 @ifset SOM
2729 Additionally, @command{@value{AS}} uses different names for the standard
2730 text, data, and bss sections when generating SOM output. Program text
2731 is placed into the @samp{$CODE$} section, data into @samp{$DATA$}, and
2732 BSS into @samp{$BSS$}.
2733 @end ifset
2734 @end ifset
2735
2736 Within the object file, the text section starts at address @code{0}, the
2737 data section follows, and the bss section follows the data section.
2738
2739 @ifset HPPA
2740 When generating either SOM or ELF output files on the HPPA, the text
2741 section starts at address @code{0}, the data section at address
2742 @code{0x4000000}, and the bss section follows the data section.
2743 @end ifset
2744
2745 To let @code{@value{LD}} know which data changes when the sections are
2746 relocated, and how to change that data, @command{@value{AS}} also writes to the
2747 object file details of the relocation needed. To perform relocation
2748 @code{@value{LD}} must know, each time an address in the object
2749 file is mentioned:
2750 @itemize @bullet
2751 @item
2752 Where in the object file is the beginning of this reference to
2753 an address?
2754 @item
2755 How long (in bytes) is this reference?
2756 @item
2757 Which section does the address refer to? What is the numeric value of
2758 @display
2759 (@var{address}) @minus{} (@var{start-address of section})?
2760 @end display
2761 @item
2762 Is the reference to an address ``Program-Counter relative''?
2763 @end itemize
2764
2765 @cindex addresses, format of
2766 @cindex section-relative addressing
2767 In fact, every address @command{@value{AS}} ever uses is expressed as
2768 @display
2769 (@var{section}) + (@var{offset into section})
2770 @end display
2771 @noindent
2772 Further, most expressions @command{@value{AS}} computes have this section-relative
2773 nature.
2774 @ifset SOM
2775 (For some object formats, such as SOM for the HPPA, some expressions are
2776 symbol-relative instead.)
2777 @end ifset
2778
2779 In this manual we use the notation @{@var{secname} @var{N}@} to mean ``offset
2780 @var{N} into section @var{secname}.''
2781
2782 Apart from text, data and bss sections you need to know about the
2783 @dfn{absolute} section. When @code{@value{LD}} mixes partial programs,
2784 addresses in the absolute section remain unchanged. For example, address
2785 @code{@{absolute 0@}} is ``relocated'' to run-time address 0 by
2786 @code{@value{LD}}. Although the linker never arranges two partial programs'
2787 data sections with overlapping addresses after linking, @emph{by definition}
2788 their absolute sections must overlap. Address @code{@{absolute@ 239@}} in one
2789 part of a program is always the same address when the program is running as
2790 address @code{@{absolute@ 239@}} in any other part of the program.
2791
2792 The idea of sections is extended to the @dfn{undefined} section. Any
2793 address whose section is unknown at assembly time is by definition
2794 rendered @{undefined @var{U}@}---where @var{U} is filled in later.
2795 Since numbers are always defined, the only way to generate an undefined
2796 address is to mention an undefined symbol. A reference to a named
2797 common block would be such a symbol: its value is unknown at assembly
2798 time so it has section @emph{undefined}.
2799
2800 By analogy the word @emph{section} is used to describe groups of sections in
2801 the linked program. @code{@value{LD}} puts all partial programs' text
2802 sections in contiguous addresses in the linked program. It is
2803 customary to refer to the @emph{text section} of a program, meaning all
2804 the addresses of all partial programs' text sections. Likewise for
2805 data and bss sections.
2806
2807 Some sections are manipulated by @code{@value{LD}}; others are invented for
2808 use of @command{@value{AS}} and have no meaning except during assembly.
2809
2810 @node Ld Sections
2811 @section Linker Sections
2812 @code{@value{LD}} deals with just four kinds of sections, summarized below.
2813
2814 @table @strong
2815
2816 @ifset COFF-ELF
2817 @cindex named sections
2818 @cindex sections, named
2819 @item named sections
2820 @end ifset
2821 @ifset aout-bout
2822 @cindex text section
2823 @cindex data section
2824 @itemx text section
2825 @itemx data section
2826 @end ifset
2827 These sections hold your program. @command{@value{AS}} and @code{@value{LD}} treat them as
2828 separate but equal sections. Anything you can say of one section is
2829 true of another.
2830 @c @ifset aout-bout
2831 When the program is running, however, it is
2832 customary for the text section to be unalterable. The
2833 text section is often shared among processes: it contains
2834 instructions, constants and the like. The data section of a running
2835 program is usually alterable: for example, C variables would be stored
2836 in the data section.
2837 @c @end ifset
2838
2839 @cindex bss section
2840 @item bss section
2841 This section contains zeroed bytes when your program begins running. It
2842 is used to hold uninitialized variables or common storage. The length of
2843 each partial program's bss section is important, but because it starts
2844 out containing zeroed bytes there is no need to store explicit zero
2845 bytes in the object file. The bss section was invented to eliminate
2846 those explicit zeros from object files.
2847
2848 @cindex absolute section
2849 @item absolute section
2850 Address 0 of this section is always ``relocated'' to runtime address 0.
2851 This is useful if you want to refer to an address that @code{@value{LD}} must
2852 not change when relocating. In this sense we speak of absolute
2853 addresses being ``unrelocatable'': they do not change during relocation.
2854
2855 @cindex undefined section
2856 @item undefined section
2857 This ``section'' is a catch-all for address references to objects not in
2858 the preceding sections.
2859 @c FIXME: ref to some other doc on obj-file formats could go here.
2860 @end table
2861
2862 @cindex relocation example
2863 An idealized example of three relocatable sections follows.
2864 @ifset COFF-ELF
2865 The example uses the traditional section names @samp{.text} and @samp{.data}.
2866 @end ifset
2867 Memory addresses are on the horizontal axis.
2868
2869 @c TEXI2ROFF-KILL
2870 @ifnottex
2871 @c END TEXI2ROFF-KILL
2872 @smallexample
2873 +-----+----+--+
2874 partial program # 1: |ttttt|dddd|00|
2875 +-----+----+--+
2876
2877 text data bss
2878 seg. seg. seg.
2879
2880 +---+---+---+
2881 partial program # 2: |TTT|DDD|000|
2882 +---+---+---+
2883
2884 +--+---+-----+--+----+---+-----+~~
2885 linked program: | |TTT|ttttt| |dddd|DDD|00000|
2886 +--+---+-----+--+----+---+-----+~~
2887
2888 addresses: 0 @dots{}
2889 @end smallexample
2890 @c TEXI2ROFF-KILL
2891 @end ifnottex
2892 @need 5000
2893 @tex
2894 \bigskip
2895 \line{\it Partial program \#1: \hfil}
2896 \line{\ibox{2.5cm}{\tt text}\ibox{2cm}{\tt data}\ibox{1cm}{\tt bss}\hfil}
2897 \line{\boxit{2.5cm}{\tt ttttt}\boxit{2cm}{\tt dddd}\boxit{1cm}{\tt 00}\hfil}
2898
2899 \line{\it Partial program \#2: \hfil}
2900 \line{\ibox{1cm}{\tt text}\ibox{1.5cm}{\tt data}\ibox{1cm}{\tt bss}\hfil}
2901 \line{\boxit{1cm}{\tt TTT}\boxit{1.5cm}{\tt DDDD}\boxit{1cm}{\tt 000}\hfil}
2902
2903 \line{\it linked program: \hfil}
2904 \line{\ibox{.5cm}{}\ibox{1cm}{\tt text}\ibox{2.5cm}{}\ibox{.75cm}{}\ibox{2cm}{\tt data}\ibox{1.5cm}{}\ibox{2cm}{\tt bss}\hfil}
2905 \line{\boxit{.5cm}{}\boxit{1cm}{\tt TTT}\boxit{2.5cm}{\tt
2906 ttttt}\boxit{.75cm}{}\boxit{2cm}{\tt dddd}\boxit{1.5cm}{\tt
2907 DDDD}\boxit{2cm}{\tt 00000}\ \dots\hfil}
2908
2909 \line{\it addresses: \hfil}
2910 \line{0\dots\hfil}
2911
2912 @end tex
2913 @c END TEXI2ROFF-KILL
2914
2915 @node As Sections
2916 @section Assembler Internal Sections
2917
2918 @cindex internal assembler sections
2919 @cindex sections in messages, internal
2920 These sections are meant only for the internal use of @command{@value{AS}}. They
2921 have no meaning at run-time. You do not really need to know about these
2922 sections for most purposes; but they can be mentioned in @command{@value{AS}}
2923 warning messages, so it might be helpful to have an idea of their
2924 meanings to @command{@value{AS}}. These sections are used to permit the
2925 value of every expression in your assembly language program to be a
2926 section-relative address.
2927
2928 @table @b
2929 @cindex assembler internal logic error
2930 @item ASSEMBLER-INTERNAL-LOGIC-ERROR!
2931 An internal assembler logic error has been found. This means there is a
2932 bug in the assembler.
2933
2934 @cindex expr (internal section)
2935 @item expr section
2936 The assembler stores complex expression internally as combinations of
2937 symbols. When it needs to represent an expression as a symbol, it puts
2938 it in the expr section.
2939 @c FIXME item debug
2940 @c FIXME item transfer[t] vector preload
2941 @c FIXME item transfer[t] vector postload
2942 @c FIXME item register
2943 @end table
2944
2945 @node Sub-Sections
2946 @section Sub-Sections
2947
2948 @cindex numbered subsections
2949 @cindex grouping data
2950 @ifset aout-bout
2951 Assembled bytes
2952 @ifset COFF-ELF
2953 conventionally
2954 @end ifset
2955 fall into two sections: text and data.
2956 @end ifset
2957 You may have separate groups of
2958 @ifset GENERIC
2959 data in named sections
2960 @end ifset
2961 @ifclear GENERIC
2962 @ifclear aout-bout
2963 data in named sections
2964 @end ifclear
2965 @ifset aout-bout
2966 text or data
2967 @end ifset
2968 @end ifclear
2969 that you want to end up near to each other in the object file, even though they
2970 are not contiguous in the assembler source. @command{@value{AS}} allows you to
2971 use @dfn{subsections} for this purpose. Within each section, there can be
2972 numbered subsections with values from 0 to 8192. Objects assembled into the
2973 same subsection go into the object file together with other objects in the same
2974 subsection. For example, a compiler might want to store constants in the text
2975 section, but might not want to have them interspersed with the program being
2976 assembled. In this case, the compiler could issue a @samp{.text 0} before each
2977 section of code being output, and a @samp{.text 1} before each group of
2978 constants being output.
2979
2980 Subsections are optional. If you do not use subsections, everything
2981 goes in subsection number zero.
2982
2983 @ifset GENERIC
2984 Each subsection is zero-padded up to a multiple of four bytes.
2985 (Subsections may be padded a different amount on different flavors
2986 of @command{@value{AS}}.)
2987 @end ifset
2988 @ifclear GENERIC
2989 @ifset H8
2990 On the H8/300 and H8/500 platforms, each subsection is zero-padded to a word
2991 boundary (two bytes).
2992 The same is true on the Renesas SH.
2993 @end ifset
2994 @ifset I960
2995 @c FIXME section padding (alignment)?
2996 @c Rich Pixley says padding here depends on target obj code format; that
2997 @c doesn't seem particularly useful to say without further elaboration,
2998 @c so for now I say nothing about it. If this is a generic BFD issue,
2999 @c these paragraphs might need to vanish from this manual, and be
3000 @c discussed in BFD chapter of binutils (or some such).
3001 @end ifset
3002 @ifset A29K
3003 On the AMD 29K family, no particular padding is added to section or
3004 subsection sizes; @value{AS} forces no alignment on this platform.
3005 @end ifset
3006 @end ifclear
3007
3008 Subsections appear in your object file in numeric order, lowest numbered
3009 to highest. (All this to be compatible with other people's assemblers.)
3010 The object file contains no representation of subsections; @code{@value{LD}} and
3011 other programs that manipulate object files see no trace of them.
3012 They just see all your text subsections as a text section, and all your
3013 data subsections as a data section.
3014
3015 To specify which subsection you want subsequent statements assembled
3016 into, use a numeric argument to specify it, in a @samp{.text
3017 @var{expression}} or a @samp{.data @var{expression}} statement.
3018 @ifset COFF-ELF
3019 @ifset GENERIC
3020 When generating COFF or ELF output, you
3021 @end ifset
3022 @ifclear GENERIC
3023 You
3024 @end ifclear
3025 can also use an extra subsection
3026 argument with arbitrary named sections: @samp{.section @var{name},
3027 @var{expression}}.
3028 @end ifset
3029 @var{Expression} should be an absolute expression.
3030 (@xref{Expressions}.) If you just say @samp{.text} then @samp{.text 0}
3031 is assumed. Likewise @samp{.data} means @samp{.data 0}. Assembly
3032 begins in @code{text 0}. For instance:
3033 @smallexample
3034 .text 0 # The default subsection is text 0 anyway.
3035 .ascii "This lives in the first text subsection. *"
3036 .text 1
3037 .ascii "But this lives in the second text subsection."
3038 .data 0
3039 .ascii "This lives in the data section,"
3040 .ascii "in the first data subsection."
3041 .text 0
3042 .ascii "This lives in the first text section,"
3043 .ascii "immediately following the asterisk (*)."
3044 @end smallexample
3045
3046 Each section has a @dfn{location counter} incremented by one for every byte
3047 assembled into that section. Because subsections are merely a convenience
3048 restricted to @command{@value{AS}} there is no concept of a subsection location
3049 counter. There is no way to directly manipulate a location counter---but the
3050 @code{.align} directive changes it, and any label definition captures its
3051 current value. The location counter of the section where statements are being
3052 assembled is said to be the @dfn{active} location counter.
3053
3054 @node bss
3055 @section bss Section
3056
3057 @cindex bss section
3058 @cindex common variable storage
3059 The bss section is used for local common variable storage.
3060 You may allocate address space in the bss section, but you may
3061 not dictate data to load into it before your program executes. When
3062 your program starts running, all the contents of the bss
3063 section are zeroed bytes.
3064
3065 The @code{.lcomm} pseudo-op defines a symbol in the bss section; see
3066 @ref{Lcomm,,@code{.lcomm}}.
3067
3068 The @code{.comm} pseudo-op may be used to declare a common symbol, which is
3069 another form of uninitialized symbol; see @xref{Comm,,@code{.comm}}.
3070
3071 @ifset GENERIC
3072 When assembling for a target which supports multiple sections, such as ELF or
3073 COFF, you may switch into the @code{.bss} section and define symbols as usual;
3074 see @ref{Section,,@code{.section}}. You may only assemble zero values into the
3075 section. Typically the section will only contain symbol definitions and
3076 @code{.skip} directives (@pxref{Skip,,@code{.skip}}).
3077 @end ifset
3078
3079 @node Symbols
3080 @chapter Symbols
3081
3082 @cindex symbols
3083 Symbols are a central concept: the programmer uses symbols to name
3084 things, the linker uses symbols to link, and the debugger uses symbols
3085 to debug.
3086
3087 @quotation
3088 @cindex debuggers, and symbol order
3089 @emph{Warning:} @command{@value{AS}} does not place symbols in the object file in
3090 the same order they were declared. This may break some debuggers.
3091 @end quotation
3092
3093 @menu
3094 * Labels:: Labels
3095 * Setting Symbols:: Giving Symbols Other Values
3096 * Symbol Names:: Symbol Names
3097 * Dot:: The Special Dot Symbol
3098 * Symbol Attributes:: Symbol Attributes
3099 @end menu
3100
3101 @node Labels
3102 @section Labels
3103
3104 @cindex labels
3105 A @dfn{label} is written as a symbol immediately followed by a colon
3106 @samp{:}. The symbol then represents the current value of the
3107 active location counter, and is, for example, a suitable instruction
3108 operand. You are warned if you use the same symbol to represent two
3109 different locations: the first definition overrides any other
3110 definitions.
3111
3112 @ifset HPPA
3113 On the HPPA, the usual form for a label need not be immediately followed by a
3114 colon, but instead must start in column zero. Only one label may be defined on
3115 a single line. To work around this, the HPPA version of @command{@value{AS}} also
3116 provides a special directive @code{.label} for defining labels more flexibly.
3117 @end ifset
3118
3119 @node Setting Symbols
3120 @section Giving Symbols Other Values
3121
3122 @cindex assigning values to symbols
3123 @cindex symbol values, assigning
3124 A symbol can be given an arbitrary value by writing a symbol, followed
3125 by an equals sign @samp{=}, followed by an expression
3126 (@pxref{Expressions}). This is equivalent to using the @code{.set}
3127 directive. @xref{Set,,@code{.set}}.
3128
3129 @node Symbol Names
3130 @section Symbol Names
3131
3132 @cindex symbol names
3133 @cindex names, symbol
3134 @ifclear SPECIAL-SYMS
3135 Symbol names begin with a letter or with one of @samp{._}. On most
3136 machines, you can also use @code{$} in symbol names; exceptions are
3137 noted in @ref{Machine Dependencies}. That character may be followed by any
3138 string of digits, letters, dollar signs (unless otherwise noted in
3139 @ref{Machine Dependencies}), and underscores.
3140 @end ifclear
3141 @ifset A29K
3142 For the AMD 29K family, @samp{?} is also allowed in the
3143 body of a symbol name, though not at its beginning.
3144 @end ifset
3145
3146 @ifset SPECIAL-SYMS
3147 @ifset H8
3148 Symbol names begin with a letter or with one of @samp{._}. On the
3149 Renesas SH or the H8/500, you can also use @code{$} in symbol names. That
3150 character may be followed by any string of digits, letters, dollar signs (save
3151 on the H8/300), and underscores.
3152 @end ifset
3153 @end ifset
3154
3155 Case of letters is significant: @code{foo} is a different symbol name
3156 than @code{Foo}.
3157
3158 Each symbol has exactly one name. Each name in an assembly language program
3159 refers to exactly one symbol. You may use that symbol name any number of times
3160 in a program.
3161
3162 @subheading Local Symbol Names
3163
3164 @cindex local symbol names
3165 @cindex symbol names, local
3166 @cindex temporary symbol names
3167 @cindex symbol names, temporary
3168 Local symbols help compilers and programmers use names temporarily.
3169 They create symbols which are guaranteed to be unique over the entire scope of
3170 the input source code and which can be referred to by a simple notation.
3171 To define a local symbol, write a label of the form @samp{@b{N}:} (where @b{N}
3172 represents any positive integer). To refer to the most recent previous
3173 definition of that symbol write @samp{@b{N}b}, using the same number as when
3174 you defined the label. To refer to the next definition of a local label, write
3175 @samp{@b{N}f}--- The @samp{b} stands for``backwards'' and the @samp{f} stands
3176 for ``forwards''.
3177
3178 There is no restriction on how you can use these labels, and you can reuse them
3179 too. So that it is possible to repeatedly define the same local label (using
3180 the same number @samp{@b{N}}), although you can only refer to the most recently
3181 defined local label of that number (for a backwards reference) or the next
3182 definition of a specific local label for a forward reference. It is also worth
3183 noting that the first 10 local labels (@samp{@b{0:}}@dots{}@samp{@b{9:}}) are
3184 implemented in a slightly more efficient manner than the others.
3185
3186 Here is an example:
3187
3188 @smallexample
3189 1: branch 1f
3190 2: branch 1b
3191 1: branch 2f
3192 2: branch 1b
3193 @end smallexample
3194
3195 Which is the equivalent of:
3196
3197 @smallexample
3198 label_1: branch label_3
3199 label_2: branch label_1
3200 label_3: branch label_4
3201 label_4: branch label_3
3202 @end smallexample
3203
3204 Local symbol names are only a notational device. They are immediately
3205 transformed into more conventional symbol names before the assembler uses them.
3206 The symbol names stored in the symbol table, appearing in error messages and
3207 optionally emitted to the object file. The names are constructed using these
3208 parts:
3209
3210 @table @code
3211 @item L
3212 All local labels begin with @samp{L}. Normally both @command{@value{AS}} and
3213 @code{@value{LD}} forget symbols that start with @samp{L}. These labels are
3214 used for symbols you are never intended to see. If you use the
3215 @samp{-L} option then @command{@value{AS}} retains these symbols in the
3216 object file. If you also instruct @code{@value{LD}} to retain these symbols,
3217 you may use them in debugging.
3218
3219 @item @var{number}
3220 This is the number that was used in the local label definition. So if the
3221 label is written @samp{55:} then the number is @samp{55}.
3222
3223 @item @kbd{C-B}
3224 This unusual character is included so you do not accidentally invent a symbol
3225 of the same name. The character has ASCII value of @samp{\002} (control-B).
3226
3227 @item @emph{ordinal number}
3228 This is a serial number to keep the labels distinct. The first definition of
3229 @samp{0:} gets the number @samp{1}. The 15th definition of @samp{0:} gets the
3230 number @samp{15}, and so on. Likewise the first definition of @samp{1:} gets
3231 the number @samp{1} and its 15th defintion gets @samp{15} as well.
3232 @end table
3233
3234 So for example, the first @code{1:} is named @code{L1@kbd{C-B}1}, the 44th
3235 @code{3:} is named @code{L3@kbd{C-B}44}.
3236
3237 @subheading Dollar Local Labels
3238 @cindex dollar local symbols
3239
3240 @code{@value{AS}} also supports an even more local form of local labels called
3241 dollar labels. These labels go out of scope (ie they become undefined) as soon
3242 as a non-local label is defined. Thus they remain valid for only a small
3243 region of the input source code. Normal local labels, by contrast, remain in
3244 scope for the entire file, or until they are redefined by another occurrence of
3245 the same local label.
3246
3247 Dollar labels are defined in exactly the same way as ordinary local labels,
3248 except that instead of being terminated by a colon, they are terminated by a
3249 dollar sign. eg @samp{@b{55$}}.
3250
3251 They can also be distinguished from ordinary local labels by their transformed
3252 name which uses ASCII character @samp{\001} (control-A) as the magic character
3253 to distinguish them from ordinary labels. Thus the 5th defintion of @samp{6$}
3254 is named @samp{L6@kbd{C-A}5}.
3255
3256 @node Dot
3257 @section The Special Dot Symbol
3258
3259 @cindex dot (symbol)
3260 @cindex @code{.} (symbol)
3261 @cindex current address
3262 @cindex location counter
3263 The special symbol @samp{.} refers to the current address that
3264 @command{@value{AS}} is assembling into. Thus, the expression @samp{melvin:
3265 .long .} defines @code{melvin} to contain its own address.
3266 Assigning a value to @code{.} is treated the same as a @code{.org}
3267 directive. Thus, the expression @samp{.=.+4} is the same as saying
3268 @ifclear no-space-dir
3269 @samp{.space 4}.
3270 @end ifclear
3271 @ifset no-space-dir
3272 @ifset A29K
3273 @samp{.block 4}.
3274 @end ifset
3275 @end ifset
3276
3277 @node Symbol Attributes
3278 @section Symbol Attributes
3279
3280 @cindex symbol attributes
3281 @cindex attributes, symbol
3282 Every symbol has, as well as its name, the attributes ``Value'' and
3283 ``Type''. Depending on output format, symbols can also have auxiliary
3284 attributes.
3285 @ifset INTERNALS
3286 The detailed definitions are in @file{a.out.h}.
3287 @end ifset
3288
3289 If you use a symbol without defining it, @command{@value{AS}} assumes zero for
3290 all these attributes, and probably won't warn you. This makes the
3291 symbol an externally defined symbol, which is generally what you
3292 would want.
3293
3294 @menu
3295 * Symbol Value:: Value
3296 * Symbol Type:: Type
3297 @ifset aout-bout
3298 @ifset GENERIC
3299 * a.out Symbols:: Symbol Attributes: @code{a.out}
3300 @end ifset
3301 @ifclear GENERIC
3302 @ifclear BOUT
3303 * a.out Symbols:: Symbol Attributes: @code{a.out}
3304 @end ifclear
3305 @ifset BOUT
3306 * a.out Symbols:: Symbol Attributes: @code{a.out}, @code{b.out}
3307 @end ifset
3308 @end ifclear
3309 @end ifset
3310 @ifset COFF
3311 * COFF Symbols:: Symbol Attributes for COFF
3312 @end ifset
3313 @ifset SOM
3314 * SOM Symbols:: Symbol Attributes for SOM
3315 @end ifset
3316 @end menu
3317
3318 @node Symbol Value
3319 @subsection Value
3320
3321 @cindex value of a symbol
3322 @cindex symbol value
3323 The value of a symbol is (usually) 32 bits. For a symbol which labels a
3324 location in the text, data, bss or absolute sections the value is the
3325 number of addresses from the start of that section to the label.
3326 Naturally for text, data and bss sections the value of a symbol changes
3327 as @code{@value{LD}} changes section base addresses during linking. Absolute
3328 symbols' values do not change during linking: that is why they are
3329 called absolute.
3330
3331 The value of an undefined symbol is treated in a special way. If it is
3332 0 then the symbol is not defined in this assembler source file, and
3333 @code{@value{LD}} tries to determine its value from other files linked into the
3334 same program. You make this kind of symbol simply by mentioning a symbol
3335 name without defining it. A non-zero value represents a @code{.comm}
3336 common declaration. The value is how much common storage to reserve, in
3337 bytes (addresses). The symbol refers to the first address of the
3338 allocated storage.
3339
3340 @node Symbol Type
3341 @subsection Type
3342
3343 @cindex type of a symbol
3344 @cindex symbol type
3345 The type attribute of a symbol contains relocation (section)
3346 information, any flag settings indicating that a symbol is external, and
3347 (optionally), other information for linkers and debuggers. The exact
3348 format depends on the object-code output format in use.
3349
3350 @ifset aout-bout
3351 @ifclear GENERIC
3352 @ifset BOUT
3353 @c The following avoids a "widow" subsection title. @group would be
3354 @c better if it were available outside examples.
3355 @need 1000
3356 @node a.out Symbols
3357 @subsection Symbol Attributes: @code{a.out}, @code{b.out}
3358
3359 @cindex @code{b.out} symbol attributes
3360 @cindex symbol attributes, @code{b.out}
3361 These symbol attributes appear only when @command{@value{AS}} is configured for
3362 one of the Berkeley-descended object output formats---@code{a.out} or
3363 @code{b.out}.
3364
3365 @end ifset
3366 @ifclear BOUT
3367 @node a.out Symbols
3368 @subsection Symbol Attributes: @code{a.out}
3369
3370 @cindex @code{a.out} symbol attributes
3371 @cindex symbol attributes, @code{a.out}
3372
3373 @end ifclear
3374 @end ifclear
3375 @ifset GENERIC
3376 @node a.out Symbols
3377 @subsection Symbol Attributes: @code{a.out}
3378
3379 @cindex @code{a.out} symbol attributes
3380 @cindex symbol attributes, @code{a.out}
3381
3382 @end ifset
3383 @menu
3384 * Symbol Desc:: Descriptor
3385 * Symbol Other:: Other
3386 @end menu
3387
3388 @node Symbol Desc
3389 @subsubsection Descriptor
3390
3391 @cindex descriptor, of @code{a.out} symbol
3392 This is an arbitrary 16-bit value. You may establish a symbol's
3393 descriptor value by using a @code{.desc} statement
3394 (@pxref{Desc,,@code{.desc}}). A descriptor value means nothing to
3395 @command{@value{AS}}.
3396
3397 @node Symbol Other
3398 @subsubsection Other
3399
3400 @cindex other attribute, of @code{a.out} symbol
3401 This is an arbitrary 8-bit value. It means nothing to @command{@value{AS}}.
3402 @end ifset
3403
3404 @ifset COFF
3405 @node COFF Symbols
3406 @subsection Symbol Attributes for COFF
3407
3408 @cindex COFF symbol attributes
3409 @cindex symbol attributes, COFF
3410
3411 The COFF format supports a multitude of auxiliary symbol attributes;
3412 like the primary symbol attributes, they are set between @code{.def} and
3413 @code{.endef} directives.
3414
3415 @subsubsection Primary Attributes
3416
3417 @cindex primary attributes, COFF symbols
3418 The symbol name is set with @code{.def}; the value and type,
3419 respectively, with @code{.val} and @code{.type}.
3420
3421 @subsubsection Auxiliary Attributes
3422
3423 @cindex auxiliary attributes, COFF symbols
3424 The @command{@value{AS}} directives @code{.dim}, @code{.line}, @code{.scl},
3425 @code{.size}, and @code{.tag} can generate auxiliary symbol table
3426 information for COFF.
3427 @end ifset
3428
3429 @ifset SOM
3430 @node SOM Symbols
3431 @subsection Symbol Attributes for SOM
3432
3433 @cindex SOM symbol attributes
3434 @cindex symbol attributes, SOM
3435
3436 The SOM format for the HPPA supports a multitude of symbol attributes set with
3437 the @code{.EXPORT} and @code{.IMPORT} directives.
3438
3439 The attributes are described in @cite{HP9000 Series 800 Assembly
3440 Language Reference Manual} (HP 92432-90001) under the @code{IMPORT} and
3441 @code{EXPORT} assembler directive documentation.
3442 @end ifset
3443
3444 @node Expressions
3445 @chapter Expressions
3446
3447 @cindex expressions
3448 @cindex addresses
3449 @cindex numeric values
3450 An @dfn{expression} specifies an address or numeric value.
3451 Whitespace may precede and/or follow an expression.
3452
3453 The result of an expression must be an absolute number, or else an offset into
3454 a particular section. If an expression is not absolute, and there is not
3455 enough information when @command{@value{AS}} sees the expression to know its
3456 section, a second pass over the source program might be necessary to interpret
3457 the expression---but the second pass is currently not implemented.
3458 @command{@value{AS}} aborts with an error message in this situation.
3459
3460 @menu
3461 * Empty Exprs:: Empty Expressions
3462 * Integer Exprs:: Integer Expressions
3463 @end menu
3464
3465 @node Empty Exprs
3466 @section Empty Expressions
3467
3468 @cindex empty expressions
3469 @cindex expressions, empty
3470 An empty expression has no value: it is just whitespace or null.
3471 Wherever an absolute expression is required, you may omit the
3472 expression, and @command{@value{AS}} assumes a value of (absolute) 0. This
3473 is compatible with other assemblers.
3474
3475 @node Integer Exprs
3476 @section Integer Expressions
3477
3478 @cindex integer expressions
3479 @cindex expressions, integer
3480 An @dfn{integer expression} is one or more @emph{arguments} delimited
3481 by @emph{operators}.
3482
3483 @menu
3484 * Arguments:: Arguments
3485 * Operators:: Operators
3486 * Prefix Ops:: Prefix Operators
3487 * Infix Ops:: Infix Operators
3488 @end menu
3489
3490 @node Arguments
3491 @subsection Arguments
3492
3493 @cindex expression arguments
3494 @cindex arguments in expressions
3495 @cindex operands in expressions
3496 @cindex arithmetic operands
3497 @dfn{Arguments} are symbols, numbers or subexpressions. In other
3498 contexts arguments are sometimes called ``arithmetic operands''. In
3499 this manual, to avoid confusing them with the ``instruction operands'' of
3500 the machine language, we use the term ``argument'' to refer to parts of
3501 expressions only, reserving the word ``operand'' to refer only to machine
3502 instruction operands.
3503
3504 Symbols are evaluated to yield @{@var{section} @var{NNN}@} where
3505 @var{section} is one of text, data, bss, absolute,
3506 or undefined. @var{NNN} is a signed, 2's complement 32 bit
3507 integer.
3508
3509 Numbers are usually integers.
3510
3511 A number can be a flonum or bignum. In this case, you are warned
3512 that only the low order 32 bits are used, and @command{@value{AS}} pretends
3513 these 32 bits are an integer. You may write integer-manipulating
3514 instructions that act on exotic constants, compatible with other
3515 assemblers.
3516
3517 @cindex subexpressions
3518 Subexpressions are a left parenthesis @samp{(} followed by an integer
3519 expression, followed by a right parenthesis @samp{)}; or a prefix
3520 operator followed by an argument.
3521
3522 @node Operators
3523 @subsection Operators
3524
3525 @cindex operators, in expressions
3526 @cindex arithmetic functions
3527 @cindex functions, in expressions
3528 @dfn{Operators} are arithmetic functions, like @code{+} or @code{%}. Prefix
3529 operators are followed by an argument. Infix operators appear
3530 between their arguments. Operators may be preceded and/or followed by
3531 whitespace.
3532
3533 @node Prefix Ops
3534 @subsection Prefix Operator
3535
3536 @cindex prefix operators
3537 @command{@value{AS}} has the following @dfn{prefix operators}. They each take
3538 one argument, which must be absolute.
3539
3540 @c the tex/end tex stuff surrounding this small table is meant to make
3541 @c it align, on the printed page, with the similar table in the next
3542 @c section (which is inside an enumerate).
3543 @tex
3544 \global\advance\leftskip by \itemindent
3545 @end tex
3546
3547 @table @code
3548 @item -
3549 @dfn{Negation}. Two's complement negation.
3550 @item ~
3551 @dfn{Complementation}. Bitwise not.
3552 @end table
3553
3554 @tex
3555 \global\advance\leftskip by -\itemindent
3556 @end tex
3557
3558 @node Infix Ops
3559 @subsection Infix Operators
3560
3561 @cindex infix operators
3562 @cindex operators, permitted arguments
3563 @dfn{Infix operators} take two arguments, one on either side. Operators
3564 have precedence, but operations with equal precedence are performed left
3565 to right. Apart from @code{+} or @option{-}, both arguments must be
3566 absolute, and the result is absolute.
3567
3568 @enumerate
3569 @cindex operator precedence
3570 @cindex precedence of operators
3571
3572 @item
3573 Highest Precedence
3574
3575 @table @code
3576 @item *
3577 @dfn{Multiplication}.
3578
3579 @item /
3580 @dfn{Division}. Truncation is the same as the C operator @samp{/}
3581
3582 @item %
3583 @dfn{Remainder}.
3584
3585 @item <
3586 @itemx <<
3587 @dfn{Shift Left}. Same as the C operator @samp{<<}.
3588
3589 @item >
3590 @itemx >>
3591 @dfn{Shift Right}. Same as the C operator @samp{>>}.
3592 @end table
3593
3594 @item
3595 Intermediate precedence
3596
3597 @table @code
3598 @item |
3599
3600 @dfn{Bitwise Inclusive Or}.
3601
3602 @item &
3603 @dfn{Bitwise And}.
3604
3605 @item ^
3606 @dfn{Bitwise Exclusive Or}.
3607
3608 @item !
3609 @dfn{Bitwise Or Not}.
3610 @end table
3611
3612 @item
3613 Low Precedence
3614
3615 @table @code
3616 @cindex addition, permitted arguments
3617 @cindex plus, permitted arguments
3618 @cindex arguments for addition
3619 @item +
3620 @dfn{Addition}. If either argument is absolute, the result has the section of
3621 the other argument. You may not add together arguments from different
3622 sections.
3623
3624 @cindex subtraction, permitted arguments
3625 @cindex minus, permitted arguments
3626 @cindex arguments for subtraction
3627 @item -
3628 @dfn{Subtraction}. If the right argument is absolute, the
3629 result has the section of the left argument.
3630 If both arguments are in the same section, the result is absolute.
3631 You may not subtract arguments from different sections.
3632 @c FIXME is there still something useful to say about undefined - undefined ?
3633
3634 @cindex comparison expressions
3635 @cindex expressions, comparison
3636 @item ==
3637 @dfn{Is Equal To}
3638 @item <>
3639 @dfn{Is Not Equal To}
3640 @item <
3641 @dfn{Is Less Than}
3642 @itemx >
3643 @dfn{Is Greater Than}
3644 @itemx >=
3645 @dfn{Is Greater Than Or Equal To}
3646 @itemx <=
3647 @dfn{Is Less Than Or Equal To}
3648
3649 The comparison operators can be used as infix operators. A true results has a
3650 value of -1 whereas a false result has a value of 0. Note, these operators
3651 perform signed comparisons.
3652 @end table
3653
3654 @item Lowest Precedence
3655
3656 @table @code
3657 @item &&
3658 @dfn{Logical And}.
3659
3660 @item ||
3661 @dfn{Logical Or}.
3662
3663 These two logical operations can be used to combine the results of sub
3664 expressions. Note, unlike the comparison operators a true result returns a
3665 value of 1 but a false results does still return 0. Also note that the logical
3666 or operator has a slightly lower precedence than logical and.
3667
3668 @end table
3669 @end enumerate
3670
3671 In short, it's only meaningful to add or subtract the @emph{offsets} in an
3672 address; you can only have a defined section in one of the two arguments.
3673
3674 @node Pseudo Ops
3675 @chapter Assembler Directives
3676
3677 @cindex directives, machine independent
3678 @cindex pseudo-ops, machine independent
3679 @cindex machine independent directives
3680 All assembler directives have names that begin with a period (@samp{.}).
3681 The rest of the name is letters, usually in lower case.
3682
3683 This chapter discusses directives that are available regardless of the
3684 target machine configuration for the @sc{gnu} assembler.
3685 @ifset GENERIC
3686 Some machine configurations provide additional directives.
3687 @xref{Machine Dependencies}.
3688 @end ifset
3689 @ifclear GENERIC
3690 @ifset machine-directives
3691 @xref{Machine Dependencies} for additional directives.
3692 @end ifset
3693 @end ifclear
3694
3695 @menu
3696 * Abort:: @code{.abort}
3697 @ifset COFF
3698 * ABORT:: @code{.ABORT}
3699 @end ifset
3700
3701 * Align:: @code{.align @var{abs-expr} , @var{abs-expr}}
3702 * Ascii:: @code{.ascii "@var{string}"}@dots{}
3703 * Asciz:: @code{.asciz "@var{string}"}@dots{}
3704 * Balign:: @code{.balign @var{abs-expr} , @var{abs-expr}}
3705 * Byte:: @code{.byte @var{expressions}}
3706 * Comm:: @code{.comm @var{symbol} , @var{length} }
3707
3708 * CFI directives:: @code{.cfi_startproc}, @code{.cfi_endproc}, etc.
3709
3710 * Data:: @code{.data @var{subsection}}
3711 @ifset COFF
3712 * Def:: @code{.def @var{name}}
3713 @end ifset
3714 @ifset aout-bout
3715 * Desc:: @code{.desc @var{symbol}, @var{abs-expression}}
3716 @end ifset
3717 @ifset COFF
3718 * Dim:: @code{.dim}
3719 @end ifset
3720
3721 * Double:: @code{.double @var{flonums}}
3722 * Eject:: @code{.eject}
3723 * Else:: @code{.else}
3724 * Elseif:: @code{.elseif}
3725 * End:: @code{.end}
3726 @ifset COFF
3727 * Endef:: @code{.endef}
3728 @end ifset
3729
3730 * Endfunc:: @code{.endfunc}
3731 * Endif:: @code{.endif}
3732 * Equ:: @code{.equ @var{symbol}, @var{expression}}
3733 * Equiv:: @code{.equiv @var{symbol}, @var{expression}}
3734 * Err:: @code{.err}
3735 * Exitm:: @code{.exitm}
3736 * Extern:: @code{.extern}
3737 * Fail:: @code{.fail}
3738 @ifclear no-file-dir
3739 * File:: @code{.file @var{string}}
3740 @end ifclear
3741
3742 * Fill:: @code{.fill @var{repeat} , @var{size} , @var{value}}
3743 * Float:: @code{.float @var{flonums}}
3744 * Func:: @code{.func}
3745 * Global:: @code{.global @var{symbol}}, @code{.globl @var{symbol}}
3746 @ifset ELF
3747 * Hidden:: @code{.hidden @var{names}}
3748 @end ifset
3749
3750 * hword:: @code{.hword @var{expressions}}
3751 * Ident:: @code{.ident}
3752 * If:: @code{.if @var{absolute expression}}
3753 * Incbin:: @code{.incbin "@var{file}"[,@var{skip}[,@var{count}]]}
3754 * Include:: @code{.include "@var{file}"}
3755 * Int:: @code{.int @var{expressions}}
3756 @ifset ELF
3757 * Internal:: @code{.internal @var{names}}
3758 @end ifset
3759
3760 * Irp:: @code{.irp @var{symbol},@var{values}}@dots{}
3761 * Irpc:: @code{.irpc @var{symbol},@var{values}}@dots{}
3762 * Lcomm:: @code{.lcomm @var{symbol} , @var{length}}
3763 * Lflags:: @code{.lflags}
3764 @ifclear no-line-dir
3765 * Line:: @code{.line @var{line-number}}
3766 @end ifclear
3767
3768 * Ln:: @code{.ln @var{line-number}}
3769 * Linkonce:: @code{.linkonce [@var{type}]}
3770 * List:: @code{.list}
3771 * Long:: @code{.long @var{expressions}}
3772 @ignore
3773 * Lsym:: @code{.lsym @var{symbol}, @var{expression}}
3774 @end ignore
3775
3776 * Macro:: @code{.macro @var{name} @var{args}}@dots{}
3777 * MRI:: @code{.mri @var{val}}
3778 * Nolist:: @code{.nolist}
3779 * Octa:: @code{.octa @var{bignums}}
3780 * Org:: @code{.org @var{new-lc} , @var{fill}}
3781 * P2align:: @code{.p2align @var{abs-expr} , @var{abs-expr}}
3782 @ifset ELF
3783 * PopSection:: @code{.popsection}
3784 * Previous:: @code{.previous}
3785 @end ifset
3786
3787 * Print:: @code{.print @var{string}}
3788 @ifset ELF
3789 * Protected:: @code{.protected @var{names}}
3790 @end ifset
3791
3792 * Psize:: @code{.psize @var{lines}, @var{columns}}
3793 * Purgem:: @code{.purgem @var{name}}
3794 @ifset ELF
3795 * PushSection:: @code{.pushsection @var{name}}
3796 @end ifset
3797
3798 * Quad:: @code{.quad @var{bignums}}
3799 * Rept:: @code{.rept @var{count}}
3800 * Sbttl:: @code{.sbttl "@var{subheading}"}
3801 @ifset COFF
3802 * Scl:: @code{.scl @var{class}}
3803 @end ifset
3804 @ifset COFF-ELF
3805 * Section:: @code{.section @var{name}}
3806 @end ifset
3807
3808 * Set:: @code{.set @var{symbol}, @var{expression}}
3809 * Short:: @code{.short @var{expressions}}
3810 * Single:: @code{.single @var{flonums}}
3811 @ifset COFF-ELF
3812 * Size:: @code{.size [@var{name} , @var{expression}]}
3813 @end ifset
3814
3815 * Skip:: @code{.skip @var{size} , @var{fill}}
3816 * Sleb128:: @code{.sleb128 @var{expressions}}
3817 * Space:: @code{.space @var{size} , @var{fill}}
3818 @ifset have-stabs
3819 * Stab:: @code{.stabd, .stabn, .stabs}
3820 @end ifset
3821
3822 * String:: @code{.string "@var{str}"}
3823 * Struct:: @code{.struct @var{expression}}
3824 @ifset ELF
3825 * SubSection:: @code{.subsection}
3826 * Symver:: @code{.symver @var{name},@var{name2@@nodename}}
3827 @end ifset
3828
3829 @ifset COFF
3830 * Tag:: @code{.tag @var{structname}}
3831 @end ifset
3832
3833 * Text:: @code{.text @var{subsection}}
3834 * Title:: @code{.title "@var{heading}"}
3835 @ifset COFF-ELF
3836 * Type:: @code{.type <@var{int} | @var{name} , @var{type description}>}
3837 @end ifset
3838
3839 * Uleb128:: @code{.uleb128 @var{expressions}}
3840 @ifset COFF
3841 * Val:: @code{.val @var{addr}}
3842 @end ifset
3843
3844 @ifset ELF
3845 * Version:: @code{.version "@var{string}"}
3846 * VTableEntry:: @code{.vtable_entry @var{table}, @var{offset}}
3847 * VTableInherit:: @code{.vtable_inherit @var{child}, @var{parent}}
3848 * Weak:: @code{.weak @var{names}}
3849 @end ifset
3850
3851 * Word:: @code{.word @var{expressions}}
3852 * Deprecated:: Deprecated Directives
3853 @end menu
3854
3855 @node Abort
3856 @section @code{.abort}
3857
3858 @cindex @code{abort} directive
3859 @cindex stopping the assembly
3860 This directive stops the assembly immediately. It is for
3861 compatibility with other assemblers. The original idea was that the
3862 assembly language source would be piped into the assembler. If the sender
3863 of the source quit, it could use this directive tells @command{@value{AS}} to
3864 quit also. One day @code{.abort} will not be supported.
3865
3866 @ifset COFF
3867 @node ABORT
3868 @section @code{.ABORT}
3869
3870 @cindex @code{ABORT} directive
3871 When producing COFF output, @command{@value{AS}} accepts this directive as a
3872 synonym for @samp{.abort}.
3873
3874 @ifset BOUT
3875 When producing @code{b.out} output, @command{@value{AS}} accepts this directive,
3876 but ignores it.
3877 @end ifset
3878 @end ifset
3879
3880 @node Align
3881 @section @code{.align @var{abs-expr}, @var{abs-expr}, @var{abs-expr}}
3882
3883 @cindex padding the location counter
3884 @cindex @code{align} directive
3885 Pad the location counter (in the current subsection) to a particular storage
3886 boundary. The first expression (which must be absolute) is the alignment
3887 required, as described below.
3888
3889 The second expression (also absolute) gives the fill value to be stored in the
3890 padding bytes. It (and the comma) may be omitted. If it is omitted, the
3891 padding bytes are normally zero. However, on some systems, if the section is
3892 marked as containing code and the fill value is omitted, the space is filled
3893 with no-op instructions.
3894
3895 The third expression is also absolute, and is also optional. If it is present,
3896 it is the maximum number of bytes that should be skipped by this alignment
3897 directive. If doing the alignment would require skipping more bytes than the
3898 specified maximum, then the alignment is not done at all. You can omit the
3899 fill value (the second argument) entirely by simply using two commas after the
3900 required alignment; this can be useful if you want the alignment to be filled
3901 with no-op instructions when appropriate.
3902
3903 The way the required alignment is specified varies from system to system.
3904 For the a29k, hppa, m68k, m88k, w65, sparc, Xtensa, and Renesas / SuperH SH,
3905 and i386 using ELF format,
3906 the first expression is the
3907 alignment request in bytes. For example @samp{.align 8} advances
3908 the location counter until it is a multiple of 8. If the location counter
3909 is already a multiple of 8, no change is needed.
3910
3911 For other systems, including the i386 using a.out format, and the arm and
3912 strongarm, it is the
3913 number of low-order zero bits the location counter must have after
3914 advancement. For example @samp{.align 3} advances the location
3915 counter until it a multiple of 8. If the location counter is already a
3916 multiple of 8, no change is needed.
3917
3918 This inconsistency is due to the different behaviors of the various
3919 native assemblers for these systems which GAS must emulate.
3920 GAS also provides @code{.balign} and @code{.p2align} directives,
3921 described later, which have a consistent behavior across all
3922 architectures (but are specific to GAS).
3923
3924 @node Ascii
3925 @section @code{.ascii "@var{string}"}@dots{}
3926
3927 @cindex @code{ascii} directive
3928 @cindex string literals
3929 @code{.ascii} expects zero or more string literals (@pxref{Strings})
3930 separated by commas. It assembles each string (with no automatic
3931 trailing zero byte) into consecutive addresses.
3932
3933 @node Asciz
3934 @section @code{.asciz "@var{string}"}@dots{}
3935
3936 @cindex @code{asciz} directive
3937 @cindex zero-terminated strings
3938 @cindex null-terminated strings
3939 @code{.asciz} is just like @code{.ascii}, but each string is followed by
3940 a zero byte. The ``z'' in @samp{.asciz} stands for ``zero''.
3941
3942 @node Balign
3943 @section @code{.balign[wl] @var{abs-expr}, @var{abs-expr}, @var{abs-expr}}
3944
3945 @cindex padding the location counter given number of bytes
3946 @cindex @code{balign} directive
3947 Pad the location counter (in the current subsection) to a particular
3948 storage boundary. The first expression (which must be absolute) is the
3949 alignment request in bytes. For example @samp{.balign 8} advances
3950 the location counter until it is a multiple of 8. If the location counter
3951 is already a multiple of 8, no change is needed.
3952
3953 The second expression (also absolute) gives the fill value to be stored in the
3954 padding bytes. It (and the comma) may be omitted. If it is omitted, the
3955 padding bytes are normally zero. However, on some systems, if the section is
3956 marked as containing code and the fill value is omitted, the space is filled
3957 with no-op instructions.
3958
3959 The third expression is also absolute, and is also optional. If it is present,
3960 it is the maximum number of bytes that should be skipped by this alignment
3961 directive. If doing the alignment would require skipping more bytes than the
3962 specified maximum, then the alignment is not done at all. You can omit the
3963 fill value (the second argument) entirely by simply using two commas after the
3964 required alignment; this can be useful if you want the alignment to be filled
3965 with no-op instructions when appropriate.
3966
3967 @cindex @code{balignw} directive
3968 @cindex @code{balignl} directive
3969 The @code{.balignw} and @code{.balignl} directives are variants of the
3970 @code{.balign} directive. The @code{.balignw} directive treats the fill
3971 pattern as a two byte word value. The @code{.balignl} directives treats the
3972 fill pattern as a four byte longword value. For example, @code{.balignw
3973 4,0x368d} will align to a multiple of 4. If it skips two bytes, they will be
3974 filled in with the value 0x368d (the exact placement of the bytes depends upon
3975 the endianness of the processor). If it skips 1 or 3 bytes, the fill value is
3976 undefined.
3977
3978 @node Byte
3979 @section @code{.byte @var{expressions}}
3980
3981 @cindex @code{byte} directive
3982 @cindex integers, one byte
3983 @code{.byte} expects zero or more expressions, separated by commas.
3984 Each expression is assembled into the next byte.
3985
3986 @node Comm
3987 @section @code{.comm @var{symbol} , @var{length} }
3988
3989 @cindex @code{comm} directive
3990 @cindex symbol, common
3991 @code{.comm} declares a common symbol named @var{symbol}. When linking, a
3992 common symbol in one object file may be merged with a defined or common symbol
3993 of the same name in another object file. If @code{@value{LD}} does not see a
3994 definition for the symbol--just one or more common symbols--then it will
3995 allocate @var{length} bytes of uninitialized memory. @var{length} must be an
3996 absolute expression. If @code{@value{LD}} sees multiple common symbols with
3997 the same name, and they do not all have the same size, it will allocate space
3998 using the largest size.
3999
4000 @ifset ELF
4001 When using ELF, the @code{.comm} directive takes an optional third argument.
4002 This is the desired alignment of the symbol, specified as a byte boundary (for
4003 example, an alignment of 16 means that the least significant 4 bits of the
4004 address should be zero). The alignment must be an absolute expression, and it
4005 must be a power of two. If @code{@value{LD}} allocates uninitialized memory
4006 for the common symbol, it will use the alignment when placing the symbol. If
4007 no alignment is specified, @command{@value{AS}} will set the alignment to the
4008 largest power of two less than or equal to the size of the symbol, up to a
4009 maximum of 16.
4010 @end ifset
4011
4012 @ifset HPPA
4013 The syntax for @code{.comm} differs slightly on the HPPA. The syntax is
4014 @samp{@var{symbol} .comm, @var{length}}; @var{symbol} is optional.
4015 @end ifset
4016
4017 @node CFI directives
4018 @section @code{.cfi_startproc}
4019 @cindex @code{cfi_startproc} directive
4020 @code{.cfi_startproc} is used at the beginning of each function that
4021 should have an entry in @code{.eh_frame}. It initializes some internal
4022 data structures and emits architecture dependent initial CFI instructions.
4023 Don't forget to close the function by
4024 @code{.cfi_endproc}.
4025
4026 @section @code{.cfi_endproc}
4027 @cindex @code{cfi_endproc} directive
4028 @code{.cfi_endproc} is used at the end of a function where it closes its
4029 unwind entry previously opened by
4030 @code{.cfi_startproc}. and emits it to @code{.eh_frame}.
4031
4032 @section @code{.cfi_def_cfa @var{register}, @var{offset}}
4033 @code{.cfi_def_cfa} defines a rule for computing CFA as: @i{take
4034 address from @var{register} and add @var{offset} to it}.
4035
4036 @section @code{.cfi_def_cfa_register @var{register}}
4037 @code{.cfi_def_cfa_register} modifies a rule for computing CFA. From
4038 now on @var{register} will be used instead of the old one. Offset
4039 remains the same.
4040
4041 @section @code{.cfi_def_cfa_offset @var{offset}}
4042 @code{.cfi_def_cfa_offset} modifies a rule for computing CFA. Register
4043 remains the same, but @var{offset} is new. Note that it is the
4044 absolute offset that will be added to a defined register to compute
4045 CFA address.
4046
4047 @section @code{.cfi_adjust_cfa_offset @var{offset}}
4048 Same as @code{.cfi_def_cfa_offset} but @var{offset} is a relative
4049 value that is added/substracted from the previous offset.
4050
4051 @section @code{.cfi_offset @var{register}, @var{offset}}
4052 Previous value of @var{register} is saved at offset @var{offset} from
4053 CFA.
4054
4055 @section @code{.cfi_rel_offset @var{register}, @var{offset}}
4056 Previous value of @var{register} is saved at offset @var{offset} from
4057 the current CFA register. This is transformed to @code{.cfi_offset}
4058 using the known displacement of the CFA register from the CFA.
4059 This is often easier to use, because the number will match the
4060 code it's annotating.
4061
4062 @section @code{.cfi_window_save}
4063 SPARC register window has been saved.
4064
4065 @section @code{.cfi_escape} @var{expression}[, @dots{}]
4066 Allows the user to add arbitrary bytes to the unwind info. One
4067 might use this to add OS-specific CFI opcodes, or generic CFI
4068 opcodes that GAS does not yet support.
4069
4070 @node Data
4071 @section @code{.data @var{subsection}}
4072
4073 @cindex @code{data} directive
4074 @code{.data} tells @command{@value{AS}} to assemble the following statements onto the
4075 end of the data subsection numbered @var{subsection} (which is an
4076 absolute expression). If @var{subsection} is omitted, it defaults
4077 to zero.
4078
4079 @ifset COFF
4080 @node Def
4081 @section @code{.def @var{name}}
4082
4083 @cindex @code{def} directive
4084 @cindex COFF symbols, debugging
4085 @cindex debugging COFF symbols
4086 Begin defining debugging information for a symbol @var{name}; the
4087 definition extends until the @code{.endef} directive is encountered.
4088 @ifset BOUT
4089
4090 This directive is only observed when @command{@value{AS}} is configured for COFF
4091 format output; when producing @code{b.out}, @samp{.def} is recognized,
4092 but ignored.
4093 @end ifset
4094 @end ifset
4095
4096 @ifset aout-bout
4097 @node Desc
4098 @section @code{.desc @var{symbol}, @var{abs-expression}}
4099
4100 @cindex @code{desc} directive
4101 @cindex COFF symbol descriptor
4102 @cindex symbol descriptor, COFF
4103 This directive sets the descriptor of the symbol (@pxref{Symbol Attributes})
4104 to the low 16 bits of an absolute expression.
4105
4106 @ifset COFF
4107 The @samp{.desc} directive is not available when @command{@value{AS}} is
4108 configured for COFF output; it is only for @code{a.out} or @code{b.out}
4109 object format. For the sake of compatibility, @command{@value{AS}} accepts
4110 it, but produces no output, when configured for COFF.
4111 @end ifset
4112 @end ifset
4113
4114 @ifset COFF
4115 @node Dim
4116 @section @code{.dim}
4117
4118 @cindex @code{dim} directive
4119 @cindex COFF auxiliary symbol information
4120 @cindex auxiliary symbol information, COFF
4121 This directive is generated by compilers to include auxiliary debugging
4122 information in the symbol table. It is only permitted inside
4123 @code{.def}/@code{.endef} pairs.
4124 @ifset BOUT
4125
4126 @samp{.dim} is only meaningful when generating COFF format output; when
4127 @command{@value{AS}} is generating @code{b.out}, it accepts this directive but
4128 ignores it.
4129 @end ifset
4130 @end ifset
4131
4132 @node Double
4133 @section @code{.double @var{flonums}}
4134
4135 @cindex @code{double} directive
4136 @cindex floating point numbers (double)
4137 @code{.double} expects zero or more flonums, separated by commas. It
4138 assembles floating point numbers.
4139 @ifset GENERIC
4140 The exact kind of floating point numbers emitted depends on how
4141 @command{@value{AS}} is configured. @xref{Machine Dependencies}.
4142 @end ifset
4143 @ifclear GENERIC
4144 @ifset IEEEFLOAT
4145 On the @value{TARGET} family @samp{.double} emits 64-bit floating-point numbers
4146 in @sc{ieee} format.
4147 @end ifset
4148 @end ifclear
4149
4150 @node Eject
4151 @section @code{.eject}
4152
4153 @cindex @code{eject} directive
4154 @cindex new page, in listings
4155 @cindex page, in listings
4156 @cindex listing control: new page
4157 Force a page break at this point, when generating assembly listings.
4158
4159 @node Else
4160 @section @code{.else}
4161
4162 @cindex @code{else} directive
4163 @code{.else} is part of the @command{@value{AS}} support for conditional
4164 assembly; @pxref{If,,@code{.if}}. It marks the beginning of a section
4165 of code to be assembled if the condition for the preceding @code{.if}
4166 was false.
4167
4168 @node Elseif
4169 @section @code{.elseif}
4170
4171 @cindex @code{elseif} directive
4172 @code{.elseif} is part of the @command{@value{AS}} support for conditional
4173 assembly; @pxref{If,,@code{.if}}. It is shorthand for beginning a new
4174 @code{.if} block that would otherwise fill the entire @code{.else} section.
4175
4176 @node End
4177 @section @code{.end}
4178
4179 @cindex @code{end} directive
4180 @code{.end} marks the end of the assembly file. @command{@value{AS}} does not
4181 process anything in the file past the @code{.end} directive.
4182
4183 @ifset COFF
4184 @node Endef
4185 @section @code{.endef}
4186
4187 @cindex @code{endef} directive
4188 This directive flags the end of a symbol definition begun with
4189 @code{.def}.
4190 @ifset BOUT
4191
4192 @samp{.endef} is only meaningful when generating COFF format output; if
4193 @command{@value{AS}} is configured to generate @code{b.out}, it accepts this
4194 directive but ignores it.
4195 @end ifset
4196 @end ifset
4197
4198 @node Endfunc
4199 @section @code{.endfunc}
4200 @cindex @code{endfunc} directive
4201 @code{.endfunc} marks the end of a function specified with @code{.func}.
4202
4203 @node Endif
4204 @section @code{.endif}
4205
4206 @cindex @code{endif} directive
4207 @code{.endif} is part of the @command{@value{AS}} support for conditional assembly;
4208 it marks the end of a block of code that is only assembled
4209 conditionally. @xref{If,,@code{.if}}.
4210
4211 @node Equ
4212 @section @code{.equ @var{symbol}, @var{expression}}
4213
4214 @cindex @code{equ} directive
4215 @cindex assigning values to symbols
4216 @cindex symbols, assigning values to
4217 This directive sets the value of @var{symbol} to @var{expression}.
4218 It is synonymous with @samp{.set}; @pxref{Set,,@code{.set}}.
4219
4220 @ifset HPPA
4221 The syntax for @code{equ} on the HPPA is
4222 @samp{@var{symbol} .equ @var{expression}}.
4223 @end ifset
4224
4225 @node Equiv
4226 @section @code{.equiv @var{symbol}, @var{expression}}
4227 @cindex @code{equiv} directive
4228 The @code{.equiv} directive is like @code{.equ} and @code{.set}, except that
4229 the assembler will signal an error if @var{symbol} is already defined. Note a
4230 symbol which has been referenced but not actually defined is considered to be
4231 undefined.
4232
4233 Except for the contents of the error message, this is roughly equivalent to
4234 @smallexample
4235 .ifdef SYM
4236 .err
4237 .endif
4238 .equ SYM,VAL
4239 @end smallexample
4240
4241 @node Err
4242 @section @code{.err}
4243 @cindex @code{err} directive
4244 If @command{@value{AS}} assembles a @code{.err} directive, it will print an error
4245 message and, unless the @option{-Z} option was used, it will not generate an
4246 object file. This can be used to signal error an conditionally compiled code.
4247
4248 @node Exitm
4249 @section @code{.exitm}
4250 Exit early from the current macro definition. @xref{Macro}.
4251
4252 @node Extern
4253 @section @code{.extern}
4254
4255 @cindex @code{extern} directive
4256 @code{.extern} is accepted in the source program---for compatibility
4257 with other assemblers---but it is ignored. @command{@value{AS}} treats
4258 all undefined symbols as external.
4259
4260 @node Fail
4261 @section @code{.fail @var{expression}}
4262
4263 @cindex @code{fail} directive
4264 Generates an error or a warning. If the value of the @var{expression} is 500
4265 or more, @command{@value{AS}} will print a warning message. If the value is less
4266 than 500, @command{@value{AS}} will print an error message. The message will
4267 include the value of @var{expression}. This can occasionally be useful inside
4268 complex nested macros or conditional assembly.
4269
4270 @ifclear no-file-dir
4271 @node File
4272 @section @code{.file @var{string}}
4273
4274 @cindex @code{file} directive
4275 @cindex logical file name
4276 @cindex file name, logical
4277 @code{.file} tells @command{@value{AS}} that we are about to start a new logical
4278 file. @var{string} is the new file name. In general, the filename is
4279 recognized whether or not it is surrounded by quotes @samp{"}; but if you wish
4280 to specify an empty file name, you must give the quotes--@code{""}. This
4281 statement may go away in future: it is only recognized to be compatible with
4282 old @command{@value{AS}} programs.
4283 @ifset A29K
4284 In some configurations of @command{@value{AS}}, @code{.file} has already been
4285 removed to avoid conflicts with other assemblers. @xref{Machine Dependencies}.
4286 @end ifset
4287 @end ifclear
4288
4289 @node Fill
4290 @section @code{.fill @var{repeat} , @var{size} , @var{value}}
4291
4292 @cindex @code{fill} directive
4293 @cindex writing patterns in memory
4294 @cindex patterns, writing in memory
4295 @var{repeat}, @var{size} and @var{value} are absolute expressions.
4296 This emits @var{repeat} copies of @var{size} bytes. @var{Repeat}
4297 may be zero or more. @var{Size} may be zero or more, but if it is
4298 more than 8, then it is deemed to have the value 8, compatible with
4299 other people's assemblers. The contents of each @var{repeat} bytes
4300 is taken from an 8-byte number. The highest order 4 bytes are
4301 zero. The lowest order 4 bytes are @var{value} rendered in the
4302 byte-order of an integer on the computer @command{@value{AS}} is assembling for.
4303 Each @var{size} bytes in a repetition is taken from the lowest order
4304 @var{size} bytes of this number. Again, this bizarre behavior is
4305 compatible with other people's assemblers.
4306
4307 @var{size} and @var{value} are optional.
4308 If the second comma and @var{value} are absent, @var{value} is
4309 assumed zero. If the first comma and following tokens are absent,
4310 @var{size} is assumed to be 1.
4311
4312 @node Float
4313 @section @code{.float @var{flonums}}
4314
4315 @cindex floating point numbers (single)
4316 @cindex @code{float} directive
4317 This directive assembles zero or more flonums, separated by commas. It
4318 has the same effect as @code{.single}.
4319 @ifset GENERIC
4320 The exact kind of floating point numbers emitted depends on how
4321 @command{@value{AS}} is configured.
4322 @xref{Machine Dependencies}.
4323 @end ifset
4324 @ifclear GENERIC
4325 @ifset IEEEFLOAT
4326 On the @value{TARGET} family, @code{.float} emits 32-bit floating point numbers
4327 in @sc{ieee} format.
4328 @end ifset
4329 @end ifclear
4330
4331 @node Func
4332 @section @code{.func @var{name}[,@var{label}]}
4333 @cindex @code{func} directive
4334 @code{.func} emits debugging information to denote function @var{name}, and
4335 is ignored unless the file is assembled with debugging enabled.
4336 Only @samp{--gstabs[+]} is currently supported.
4337 @var{label} is the entry point of the function and if omitted @var{name}
4338 prepended with the @samp{leading char} is used.
4339 @samp{leading char} is usually @code{_} or nothing, depending on the target.
4340 All functions are currently defined to have @code{void} return type.
4341 The function must be terminated with @code{.endfunc}.
4342
4343 @node Global
4344 @section @code{.global @var{symbol}}, @code{.globl @var{symbol}}
4345
4346 @cindex @code{global} directive
4347 @cindex symbol, making visible to linker
4348 @code{.global} makes the symbol visible to @code{@value{LD}}. If you define
4349 @var{symbol} in your partial program, its value is made available to
4350 other partial programs that are linked with it. Otherwise,
4351 @var{symbol} takes its attributes from a symbol of the same name
4352 from another file linked into the same program.
4353
4354 Both spellings (@samp{.globl} and @samp{.global}) are accepted, for
4355 compatibility with other assemblers.
4356
4357 @ifset HPPA
4358 On the HPPA, @code{.global} is not always enough to make it accessible to other
4359 partial programs. You may need the HPPA-only @code{.EXPORT} directive as well.
4360 @xref{HPPA Directives,, HPPA Assembler Directives}.
4361 @end ifset
4362
4363 @ifset ELF
4364 @node Hidden
4365 @section @code{.hidden @var{names}}
4366
4367 @cindex @code{hidden} directive
4368 @cindex visibility
4369 This one of the ELF visibility directives. The other two are
4370 @code{.internal} (@pxref{Internal,,@code{.internal}}) and
4371 @code{.protected} (@pxref{Protected,,@code{.protected}}).
4372
4373 This directive overrides the named symbols default visibility (which is set by
4374 their binding: local, global or weak). The directive sets the visibility to
4375 @code{hidden} which means that the symbols are not visible to other components.
4376 Such symbols are always considered to be @code{protected} as well.
4377 @end ifset
4378
4379 @node hword
4380 @section @code{.hword @var{expressions}}
4381
4382 @cindex @code{hword} directive
4383 @cindex integers, 16-bit
4384 @cindex numbers, 16-bit
4385 @cindex sixteen bit integers
4386 This expects zero or more @var{expressions}, and emits
4387 a 16 bit number for each.
4388
4389 @ifset GENERIC
4390 This directive is a synonym for @samp{.short}; depending on the target
4391 architecture, it may also be a synonym for @samp{.word}.
4392 @end ifset
4393 @ifclear GENERIC
4394 @ifset W32
4395 This directive is a synonym for @samp{.short}.
4396 @end ifset
4397 @ifset W16
4398 This directive is a synonym for both @samp{.short} and @samp{.word}.
4399 @end ifset
4400 @end ifclear
4401
4402 @node Ident
4403 @section @code{.ident}
4404
4405 @cindex @code{ident} directive
4406 This directive is used by some assemblers to place tags in object files.
4407 @command{@value{AS}} simply accepts the directive for source-file
4408 compatibility with such assemblers, but does not actually emit anything
4409 for it.
4410
4411 @node If
4412 @section @code{.if @var{absolute expression}}
4413
4414 @cindex conditional assembly
4415 @cindex @code{if} directive
4416 @code{.if} marks the beginning of a section of code which is only
4417 considered part of the source program being assembled if the argument
4418 (which must be an @var{absolute expression}) is non-zero. The end of
4419 the conditional section of code must be marked by @code{.endif}
4420 (@pxref{Endif,,@code{.endif}}); optionally, you may include code for the
4421 alternative condition, flagged by @code{.else} (@pxref{Else,,@code{.else}}).
4422 If you have several conditions to check, @code{.elseif} may be used to avoid
4423 nesting blocks if/else within each subsequent @code{.else} block.
4424
4425 The following variants of @code{.if} are also supported:
4426 @table @code
4427 @cindex @code{ifdef} directive
4428 @item .ifdef @var{symbol}
4429 Assembles the following section of code if the specified @var{symbol}
4430 has been defined. Note a symbol which has been referenced but not yet defined
4431 is considered to be undefined.
4432
4433 @cindex @code{ifc} directive
4434 @item .ifc @var{string1},@var{string2}
4435 Assembles the following section of code if the two strings are the same. The
4436 strings may be optionally quoted with single quotes. If they are not quoted,
4437 the first string stops at the first comma, and the second string stops at the
4438 end of the line. Strings which contain whitespace should be quoted. The
4439 string comparison is case sensitive.
4440
4441 @cindex @code{ifeq} directive
4442 @item .ifeq @var{absolute expression}
4443 Assembles the following section of code if the argument is zero.
4444
4445 @cindex @code{ifeqs} directive
4446 @item .ifeqs @var{string1},@var{string2}
4447 Another form of @code{.ifc}. The strings must be quoted using double quotes.
4448
4449 @cindex @code{ifge} directive
4450 @item .ifge @var{absolute expression}
4451 Assembles the following section of code if the argument is greater than or
4452 equal to zero.
4453
4454 @cindex @code{ifgt} directive
4455 @item .ifgt @var{absolute expression}
4456 Assembles the following section of code if the argument is greater than zero.
4457
4458 @cindex @code{ifle} directive
4459 @item .ifle @var{absolute expression}
4460 Assembles the following section of code if the argument is less than or equal
4461 to zero.
4462
4463 @cindex @code{iflt} directive
4464 @item .iflt @var{absolute expression}
4465 Assembles the following section of code if the argument is less than zero.
4466
4467 @cindex @code{ifnc} directive
4468 @item .ifnc @var{string1},@var{string2}.
4469 Like @code{.ifc}, but the sense of the test is reversed: this assembles the
4470 following section of code if the two strings are not the same.
4471
4472 @cindex @code{ifndef} directive
4473 @cindex @code{ifnotdef} directive
4474 @item .ifndef @var{symbol}
4475 @itemx .ifnotdef @var{symbol}
4476 Assembles the following section of code if the specified @var{symbol}
4477 has not been defined. Both spelling variants are equivalent. Note a symbol
4478 which has been referenced but not yet defined is considered to be undefined.
4479
4480 @cindex @code{ifne} directive
4481 @item .ifne @var{absolute expression}
4482 Assembles the following section of code if the argument is not equal to zero
4483 (in other words, this is equivalent to @code{.if}).
4484
4485 @cindex @code{ifnes} directive
4486 @item .ifnes @var{string1},@var{string2}
4487 Like @code{.ifeqs}, but the sense of the test is reversed: this assembles the
4488 following section of code if the two strings are not the same.
4489 @end table
4490
4491 @node Incbin
4492 @section @code{.incbin "@var{file}"[,@var{skip}[,@var{count}]]}
4493
4494 @cindex @code{incbin} directive
4495 @cindex binary files, including
4496 The @code{incbin} directive includes @var{file} verbatim at the current
4497 location. You can control the search paths used with the @samp{-I} command-line
4498 option (@pxref{Invoking,,Command-Line Options}). Quotation marks are required
4499 around @var{file}.
4500
4501 The @var{skip} argument skips a number of bytes from the start of the
4502 @var{file}. The @var{count} argument indicates the maximum number of bytes to
4503 read. Note that the data is not aligned in any way, so it is the user's
4504 responsibility to make sure that proper alignment is provided both before and
4505 after the @code{incbin} directive.
4506
4507 @node Include
4508 @section @code{.include "@var{file}"}
4509
4510 @cindex @code{include} directive
4511 @cindex supporting files, including
4512 @cindex files, including
4513 This directive provides a way to include supporting files at specified
4514 points in your source program. The code from @var{file} is assembled as
4515 if it followed the point of the @code{.include}; when the end of the
4516 included file is reached, assembly of the original file continues. You
4517 can control the search paths used with the @samp{-I} command-line option
4518 (@pxref{Invoking,,Command-Line Options}). Quotation marks are required
4519 around @var{file}.
4520
4521 @node Int
4522 @section @code{.int @var{expressions}}
4523
4524 @cindex @code{int} directive
4525 @cindex integers, 32-bit
4526 Expect zero or more @var{expressions}, of any section, separated by commas.
4527 For each expression, emit a number that, at run time, is the value of that
4528 expression. The byte order and bit size of the number depends on what kind
4529 of target the assembly is for.
4530
4531 @ifclear GENERIC
4532 @ifset H8
4533 On the H8/500 and most forms of the H8/300, @code{.int} emits 16-bit
4534 integers. On the H8/300H and the Renesas SH, however, @code{.int} emits
4535 32-bit integers.
4536 @end ifset
4537 @end ifclear
4538
4539 @ifset ELF
4540 @node Internal
4541 @section @code{.internal @var{names}}
4542
4543 @cindex @code{internal} directive
4544 @cindex visibility
4545 This one of the ELF visibility directives. The other two are
4546 @code{.hidden} (@pxref{Hidden,,@code{.hidden}}) and
4547 @code{.protected} (@pxref{Protected,,@code{.protected}}).
4548
4549 This directive overrides the named symbols default visibility (which is set by
4550 their binding: local, global or weak). The directive sets the visibility to
4551 @code{internal} which means that the symbols are considered to be @code{hidden}
4552 (i.e., not visible to other components), and that some extra, processor specific
4553 processing must also be performed upon the symbols as well.
4554 @end ifset
4555
4556 @node Irp
4557 @section @code{.irp @var{symbol},@var{values}}@dots{}
4558
4559 @cindex @code{irp} directive
4560 Evaluate a sequence of statements assigning different values to @var{symbol}.
4561 The sequence of statements starts at the @code{.irp} directive, and is
4562 terminated by an @code{.endr} directive. For each @var{value}, @var{symbol} is
4563 set to @var{value}, and the sequence of statements is assembled. If no
4564 @var{value} is listed, the sequence of statements is assembled once, with
4565 @var{symbol} set to the null string. To refer to @var{symbol} within the
4566 sequence of statements, use @var{\symbol}.
4567
4568 For example, assembling
4569
4570 @example
4571 .irp param,1,2,3
4572 move d\param,sp@@-
4573 .endr
4574 @end example
4575
4576 is equivalent to assembling
4577
4578 @example
4579 move d1,sp@@-
4580 move d2,sp@@-
4581 move d3,sp@@-
4582 @end example
4583
4584 @node Irpc
4585 @section @code{.irpc @var{symbol},@var{values}}@dots{}
4586
4587 @cindex @code{irpc} directive
4588 Evaluate a sequence of statements assigning different values to @var{symbol}.
4589 The sequence of statements starts at the @code{.irpc} directive, and is
4590 terminated by an @code{.endr} directive. For each character in @var{value},
4591 @var{symbol} is set to the character, and the sequence of statements is
4592 assembled. If no @var{value} is listed, the sequence of statements is
4593 assembled once, with @var{symbol} set to the null string. To refer to
4594 @var{symbol} within the sequence of statements, use @var{\symbol}.
4595
4596 For example, assembling
4597
4598 @example
4599 .irpc param,123
4600 move d\param,sp@@-
4601 .endr
4602 @end example
4603
4604 is equivalent to assembling
4605
4606 @example
4607 move d1,sp@@-
4608 move d2,sp@@-
4609 move d3,sp@@-
4610 @end example
4611
4612 @node Lcomm
4613 @section @code{.lcomm @var{symbol} , @var{length}}
4614
4615 @cindex @code{lcomm} directive
4616 @cindex local common symbols
4617 @cindex symbols, local common
4618 Reserve @var{length} (an absolute expression) bytes for a local common
4619 denoted by @var{symbol}. The section and value of @var{symbol} are
4620 those of the new local common. The addresses are allocated in the bss
4621 section, so that at run-time the bytes start off zeroed. @var{Symbol}
4622 is not declared global (@pxref{Global,,@code{.global}}), so is normally
4623 not visible to @code{@value{LD}}.
4624
4625 @ifset GENERIC
4626 Some targets permit a third argument to be used with @code{.lcomm}. This
4627 argument specifies the desired alignment of the symbol in the bss section.
4628 @end ifset
4629
4630 @ifset HPPA
4631 The syntax for @code{.lcomm} differs slightly on the HPPA. The syntax is
4632 @samp{@var{symbol} .lcomm, @var{length}}; @var{symbol} is optional.
4633 @end ifset
4634
4635 @node Lflags
4636 @section @code{.lflags}
4637
4638 @cindex @code{lflags} directive (ignored)
4639 @command{@value{AS}} accepts this directive, for compatibility with other
4640 assemblers, but ignores it.
4641
4642 @ifclear no-line-dir
4643 @node Line
4644 @section @code{.line @var{line-number}}
4645
4646 @cindex @code{line} directive
4647 @end ifclear
4648 @ifset no-line-dir
4649 @node Ln
4650 @section @code{.ln @var{line-number}}
4651
4652 @cindex @code{ln} directive
4653 @end ifset
4654 @cindex logical line number
4655 @ifset aout-bout
4656 Change the logical line number. @var{line-number} must be an absolute
4657 expression. The next line has that logical line number. Therefore any other
4658 statements on the current line (after a statement separator character) are
4659 reported as on logical line number @var{line-number} @minus{} 1. One day
4660 @command{@value{AS}} will no longer support this directive: it is recognized only
4661 for compatibility with existing assembler programs.
4662
4663 @ifset GENERIC
4664 @ifset A29K
4665 @emph{Warning:} In the AMD29K configuration of @value{AS}, this command is
4666 not available; use the synonym @code{.ln} in that context.
4667 @end ifset
4668 @end ifset
4669 @end ifset
4670
4671 @ifclear no-line-dir
4672 Even though this is a directive associated with the @code{a.out} or
4673 @code{b.out} object-code formats, @command{@value{AS}} still recognizes it
4674 when producing COFF output, and treats @samp{.line} as though it
4675 were the COFF @samp{.ln} @emph{if} it is found outside a
4676 @code{.def}/@code{.endef} pair.
4677
4678 Inside a @code{.def}, @samp{.line} is, instead, one of the directives
4679 used by compilers to generate auxiliary symbol information for
4680 debugging.
4681 @end ifclear
4682
4683 @node Linkonce
4684 @section @code{.linkonce [@var{type}]}
4685 @cindex COMDAT
4686 @cindex @code{linkonce} directive
4687 @cindex common sections
4688 Mark the current section so that the linker only includes a single copy of it.
4689 This may be used to include the same section in several different object files,
4690 but ensure that the linker will only include it once in the final output file.
4691 The @code{.linkonce} pseudo-op must be used for each instance of the section.
4692 Duplicate sections are detected based on the section name, so it should be
4693 unique.
4694
4695 This directive is only supported by a few object file formats; as of this
4696 writing, the only object file format which supports it is the Portable
4697 Executable format used on Windows NT.
4698
4699 The @var{type} argument is optional. If specified, it must be one of the
4700 following strings. For example:
4701 @smallexample
4702 .linkonce same_size
4703 @end smallexample
4704 Not all types may be supported on all object file formats.
4705
4706 @table @code
4707 @item discard
4708 Silently discard duplicate sections. This is the default.
4709
4710 @item one_only
4711 Warn if there are duplicate sections, but still keep only one copy.
4712
4713 @item same_size
4714 Warn if any of the duplicates have different sizes.
4715
4716 @item same_contents
4717 Warn if any of the duplicates do not have exactly the same contents.
4718 @end table
4719
4720 @node Ln
4721 @section @code{.ln @var{line-number}}
4722
4723 @cindex @code{ln} directive
4724 @ifclear no-line-dir
4725 @samp{.ln} is a synonym for @samp{.line}.
4726 @end ifclear
4727 @ifset no-line-dir
4728 Tell @command{@value{AS}} to change the logical line number. @var{line-number}
4729 must be an absolute expression. The next line has that logical
4730 line number, so any other statements on the current line (after a
4731 statement separator character @code{;}) are reported as on logical
4732 line number @var{line-number} @minus{} 1.
4733 @ifset BOUT
4734
4735 This directive is accepted, but ignored, when @command{@value{AS}} is
4736 configured for @code{b.out}; its effect is only associated with COFF
4737 output format.
4738 @end ifset
4739 @end ifset
4740
4741 @node MRI
4742 @section @code{.mri @var{val}}
4743
4744 @cindex @code{mri} directive
4745 @cindex MRI mode, temporarily
4746 If @var{val} is non-zero, this tells @command{@value{AS}} to enter MRI mode. If
4747 @var{val} is zero, this tells @command{@value{AS}} to exit MRI mode. This change
4748 affects code assembled until the next @code{.mri} directive, or until the end
4749 of the file. @xref{M, MRI mode, MRI mode}.
4750
4751 @node List
4752 @section @code{.list}
4753
4754 @cindex @code{list} directive
4755 @cindex listing control, turning on
4756 Control (in conjunction with the @code{.nolist} directive) whether or
4757 not assembly listings are generated. These two directives maintain an
4758 internal counter (which is zero initially). @code{.list} increments the
4759 counter, and @code{.nolist} decrements it. Assembly listings are
4760 generated whenever the counter is greater than zero.
4761
4762 By default, listings are disabled. When you enable them (with the
4763 @samp{-a} command line option; @pxref{Invoking,,Command-Line Options}),
4764 the initial value of the listing counter is one.
4765
4766 @node Long
4767 @section @code{.long @var{expressions}}
4768
4769 @cindex @code{long} directive
4770 @code{.long} is the same as @samp{.int}, @pxref{Int,,@code{.int}}.
4771
4772 @ignore
4773 @c no one seems to know what this is for or whether this description is
4774 @c what it really ought to do
4775 @node Lsym
4776 @section @code{.lsym @var{symbol}, @var{expression}}
4777
4778 @cindex @code{lsym} directive
4779 @cindex symbol, not referenced in assembly
4780 @code{.lsym} creates a new symbol named @var{symbol}, but does not put it in
4781 the hash table, ensuring it cannot be referenced by name during the
4782 rest of the assembly. This sets the attributes of the symbol to be
4783 the same as the expression value:
4784 @smallexample
4785 @var{other} = @var{descriptor} = 0
4786 @var{type} = @r{(section of @var{expression})}
4787 @var{value} = @var{expression}
4788 @end smallexample
4789 @noindent
4790 The new symbol is not flagged as external.
4791 @end ignore
4792
4793 @node Macro
4794 @section @code{.macro}
4795
4796 @cindex macros
4797 The commands @code{.macro} and @code{.endm} allow you to define macros that
4798 generate assembly output. For example, this definition specifies a macro
4799 @code{sum} that puts a sequence of numbers into memory:
4800
4801 @example
4802 .macro sum from=0, to=5
4803 .long \from
4804 .if \to-\from
4805 sum "(\from+1)",\to
4806 .endif
4807 .endm
4808 @end example
4809
4810 @noindent
4811 With that definition, @samp{SUM 0,5} is equivalent to this assembly input:
4812
4813 @example
4814 .long 0
4815 .long 1
4816 .long 2
4817 .long 3
4818 .long 4
4819 .long 5
4820 @end example
4821
4822 @ftable @code
4823 @item .macro @var{macname}
4824 @itemx .macro @var{macname} @var{macargs} @dots{}
4825 @cindex @code{macro} directive
4826 Begin the definition of a macro called @var{macname}. If your macro
4827 definition requires arguments, specify their names after the macro name,
4828 separated by commas or spaces. You can supply a default value for any
4829 macro argument by following the name with @samp{=@var{deflt}}. For
4830 example, these are all valid @code{.macro} statements:
4831
4832 @table @code
4833 @item .macro comm
4834 Begin the definition of a macro called @code{comm}, which takes no
4835 arguments.
4836
4837 @item .macro plus1 p, p1
4838 @itemx .macro plus1 p p1
4839 Either statement begins the definition of a macro called @code{plus1},
4840 which takes two arguments; within the macro definition, write
4841 @samp{\p} or @samp{\p1} to evaluate the arguments.
4842
4843 @item .macro reserve_str p1=0 p2
4844 Begin the definition of a macro called @code{reserve_str}, with two
4845 arguments. The first argument has a default value, but not the second.
4846 After the definition is complete, you can call the macro either as
4847 @samp{reserve_str @var{a},@var{b}} (with @samp{\p1} evaluating to
4848 @var{a} and @samp{\p2} evaluating to @var{b}), or as @samp{reserve_str
4849 ,@var{b}} (with @samp{\p1} evaluating as the default, in this case
4850 @samp{0}, and @samp{\p2} evaluating to @var{b}).
4851 @end table
4852
4853 When you call a macro, you can specify the argument values either by
4854 position, or by keyword. For example, @samp{sum 9,17} is equivalent to
4855 @samp{sum to=17, from=9}.
4856
4857 @item .endm
4858 @cindex @code{endm} directive
4859 Mark the end of a macro definition.
4860
4861 @item .exitm
4862 @cindex @code{exitm} directive
4863 Exit early from the current macro definition.
4864
4865 @cindex number of macros executed
4866 @cindex macros, count executed
4867 @item \@@
4868 @command{@value{AS}} maintains a counter of how many macros it has
4869 executed in this pseudo-variable; you can copy that number to your
4870 output with @samp{\@@}, but @emph{only within a macro definition}.
4871
4872 @ignore
4873 @item LOCAL @var{name} [ , @dots{} ]
4874 @emph{Warning: @code{LOCAL} is only available if you select ``alternate
4875 macro syntax'' with @samp{-a} or @samp{--alternate}.} @xref{Alternate,,
4876 Alternate macro syntax}.
4877
4878 Generate a string replacement for each of the @var{name} arguments, and
4879 replace any instances of @var{name} in each macro expansion. The
4880 replacement string is unique in the assembly, and different for each
4881 separate macro expansion. @code{LOCAL} allows you to write macros that
4882 define symbols, without fear of conflict between separate macro expansions.
4883 @end ignore
4884 @end ftable
4885
4886 @node Nolist
4887 @section @code{.nolist}
4888
4889 @cindex @code{nolist} directive
4890 @cindex listing control, turning off
4891 Control (in conjunction with the @code{.list} directive) whether or
4892 not assembly listings are generated. These two directives maintain an
4893 internal counter (which is zero initially). @code{.list} increments the
4894 counter, and @code{.nolist} decrements it. Assembly listings are
4895 generated whenever the counter is greater than zero.
4896
4897 @node Octa
4898 @section @code{.octa @var{bignums}}
4899
4900 @c FIXME: double size emitted for "octa" on i960, others? Or warn?
4901 @cindex @code{octa} directive
4902 @cindex integer, 16-byte
4903 @cindex sixteen byte integer
4904 This directive expects zero or more bignums, separated by commas. For each
4905 bignum, it emits a 16-byte integer.
4906
4907 The term ``octa'' comes from contexts in which a ``word'' is two bytes;
4908 hence @emph{octa}-word for 16 bytes.
4909
4910 @node Org
4911 @section @code{.org @var{new-lc} , @var{fill}}
4912
4913 @cindex @code{org} directive
4914 @cindex location counter, advancing
4915 @cindex advancing location counter
4916 @cindex current address, advancing
4917 Advance the location counter of the current section to
4918 @var{new-lc}. @var{new-lc} is either an absolute expression or an
4919 expression with the same section as the current subsection. That is,
4920 you can't use @code{.org} to cross sections: if @var{new-lc} has the
4921 wrong section, the @code{.org} directive is ignored. To be compatible
4922 with former assemblers, if the section of @var{new-lc} is absolute,
4923 @command{@value{AS}} issues a warning, then pretends the section of @var{new-lc}
4924 is the same as the current subsection.
4925
4926 @code{.org} may only increase the location counter, or leave it
4927 unchanged; you cannot use @code{.org} to move the location counter
4928 backwards.
4929
4930 @c double negative used below "not undefined" because this is a specific
4931 @c reference to "undefined" (as SEG_UNKNOWN is called in this manual)
4932 @c section. doc@cygnus.com 18feb91
4933 Because @command{@value{AS}} tries to assemble programs in one pass, @var{new-lc}
4934 may not be undefined. If you really detest this restriction we eagerly await
4935 a chance to share your improved assembler.
4936
4937 Beware that the origin is relative to the start of the section, not
4938 to the start of the subsection. This is compatible with other
4939 people's assemblers.
4940
4941 When the location counter (of the current subsection) is advanced, the
4942 intervening bytes are filled with @var{fill} which should be an
4943 absolute expression. If the comma and @var{fill} are omitted,
4944 @var{fill} defaults to zero.
4945
4946 @node P2align
4947 @section @code{.p2align[wl] @var{abs-expr}, @var{abs-expr}, @var{abs-expr}}
4948
4949 @cindex padding the location counter given a power of two
4950 @cindex @code{p2align} directive
4951 Pad the location counter (in the current subsection) to a particular
4952 storage boundary. The first expression (which must be absolute) is the
4953 number of low-order zero bits the location counter must have after
4954 advancement. For example @samp{.p2align 3} advances the location
4955 counter until it a multiple of 8. If the location counter is already a
4956 multiple of 8, no change is needed.
4957
4958 The second expression (also absolute) gives the fill value to be stored in the
4959 padding bytes. It (and the comma) may be omitted. If it is omitted, the
4960 padding bytes are normally zero. However, on some systems, if the section is
4961 marked as containing code and the fill value is omitted, the space is filled
4962 with no-op instructions.
4963
4964 The third expression is also absolute, and is also optional. If it is present,
4965 it is the maximum number of bytes that should be skipped by this alignment
4966 directive. If doing the alignment would require skipping more bytes than the
4967 specified maximum, then the alignment is not done at all. You can omit the
4968 fill value (the second argument) entirely by simply using two commas after the
4969 required alignment; this can be useful if you want the alignment to be filled
4970 with no-op instructions when appropriate.
4971
4972 @cindex @code{p2alignw} directive
4973 @cindex @code{p2alignl} directive
4974 The @code{.p2alignw} and @code{.p2alignl} directives are variants of the
4975 @code{.p2align} directive. The @code{.p2alignw} directive treats the fill
4976 pattern as a two byte word value. The @code{.p2alignl} directives treats the
4977 fill pattern as a four byte longword value. For example, @code{.p2alignw
4978 2,0x368d} will align to a multiple of 4. If it skips two bytes, they will be
4979 filled in with the value 0x368d (the exact placement of the bytes depends upon
4980 the endianness of the processor). If it skips 1 or 3 bytes, the fill value is
4981 undefined.
4982
4983 @ifset ELF
4984 @node Previous
4985 @section @code{.previous}
4986
4987 @cindex @code{previous} directive
4988 @cindex Section Stack
4989 This is one of the ELF section stack manipulation directives. The others are
4990 @code{.section} (@pxref{Section}), @code{.subsection} (@pxref{SubSection}),
4991 @code{.pushsection} (@pxref{PushSection}), and @code{.popsection}
4992 (@pxref{PopSection}).
4993
4994 This directive swaps the current section (and subsection) with most recently
4995 referenced section (and subsection) prior to this one. Multiple
4996 @code{.previous} directives in a row will flip between two sections (and their
4997 subsections).
4998
4999 In terms of the section stack, this directive swaps the current section with
5000 the top section on the section stack.
5001 @end ifset
5002
5003 @ifset ELF
5004 @node PopSection
5005 @section @code{.popsection}
5006
5007 @cindex @code{popsection} directive
5008 @cindex Section Stack
5009 This is one of the ELF section stack manipulation directives. The others are
5010 @code{.section} (@pxref{Section}), @code{.subsection} (@pxref{SubSection}),
5011 @code{.pushsection} (@pxref{PushSection}), and @code{.previous}
5012 (@pxref{Previous}).
5013
5014 This directive replaces the current section (and subsection) with the top
5015 section (and subsection) on the section stack. This section is popped off the
5016 stack.
5017 @end ifset
5018
5019 @node Print
5020 @section @code{.print @var{string}}
5021
5022 @cindex @code{print} directive
5023 @command{@value{AS}} will print @var{string} on the standard output during
5024 assembly. You must put @var{string} in double quotes.
5025
5026 @ifset ELF
5027 @node Protected
5028 @section @code{.protected @var{names}}
5029
5030 @cindex @code{protected} directive
5031 @cindex visibility
5032 This one of the ELF visibility directives. The other two are
5033 @code{.hidden} (@pxref{Hidden}) and @code{.internal} (@pxref{Internal}).
5034
5035 This directive overrides the named symbols default visibility (which is set by
5036 their binding: local, global or weak). The directive sets the visibility to
5037 @code{protected} which means that any references to the symbols from within the
5038 components that defines them must be resolved to the definition in that
5039 component, even if a definition in another component would normally preempt
5040 this.
5041 @end ifset
5042
5043 @node Psize
5044 @section @code{.psize @var{lines} , @var{columns}}
5045
5046 @cindex @code{psize} directive
5047 @cindex listing control: paper size
5048 @cindex paper size, for listings
5049 Use this directive to declare the number of lines---and, optionally, the
5050 number of columns---to use for each page, when generating listings.
5051
5052 If you do not use @code{.psize}, listings use a default line-count
5053 of 60. You may omit the comma and @var{columns} specification; the
5054 default width is 200 columns.
5055
5056 @command{@value{AS}} generates formfeeds whenever the specified number of
5057 lines is exceeded (or whenever you explicitly request one, using
5058 @code{.eject}).
5059
5060 If you specify @var{lines} as @code{0}, no formfeeds are generated save
5061 those explicitly specified with @code{.eject}.
5062
5063 @node Purgem
5064 @section @code{.purgem @var{name}}
5065
5066 @cindex @code{purgem} directive
5067 Undefine the macro @var{name}, so that later uses of the string will not be
5068 expanded. @xref{Macro}.
5069
5070 @ifset ELF
5071 @node PushSection
5072 @section @code{.pushsection @var{name} , @var{subsection}}
5073
5074 @cindex @code{pushsection} directive
5075 @cindex Section Stack
5076 This is one of the ELF section stack manipulation directives. The others are
5077 @code{.section} (@pxref{Section}), @code{.subsection} (@pxref{SubSection}),
5078 @code{.popsection} (@pxref{PopSection}), and @code{.previous}
5079 (@pxref{Previous}).
5080
5081 This directive is a synonym for @code{.section}. It pushes the current section
5082 (and subsection) onto the top of the section stack, and then replaces the
5083 current section and subsection with @code{name} and @code{subsection}.
5084 @end ifset
5085
5086 @node Quad
5087 @section @code{.quad @var{bignums}}
5088
5089 @cindex @code{quad} directive
5090 @code{.quad} expects zero or more bignums, separated by commas. For
5091 each bignum, it emits
5092 @ifclear bignum-16
5093 an 8-byte integer. If the bignum won't fit in 8 bytes, it prints a
5094 warning message; and just takes the lowest order 8 bytes of the bignum.
5095 @cindex eight-byte integer
5096 @cindex integer, 8-byte
5097
5098 The term ``quad'' comes from contexts in which a ``word'' is two bytes;
5099 hence @emph{quad}-word for 8 bytes.
5100 @end ifclear
5101 @ifset bignum-16
5102 a 16-byte integer. If the bignum won't fit in 16 bytes, it prints a
5103 warning message; and just takes the lowest order 16 bytes of the bignum.
5104 @cindex sixteen-byte integer
5105 @cindex integer, 16-byte
5106 @end ifset
5107
5108 @node Rept
5109 @section @code{.rept @var{count}}
5110
5111 @cindex @code{rept} directive
5112 Repeat the sequence of lines between the @code{.rept} directive and the next
5113 @code{.endr} directive @var{count} times.
5114
5115 For example, assembling
5116
5117 @example
5118 .rept 3
5119 .long 0
5120 .endr
5121 @end example
5122
5123 is equivalent to assembling
5124
5125 @example
5126 .long 0
5127 .long 0
5128 .long 0
5129 @end example
5130
5131 @node Sbttl
5132 @section @code{.sbttl "@var{subheading}"}
5133
5134 @cindex @code{sbttl} directive
5135 @cindex subtitles for listings
5136 @cindex listing control: subtitle
5137 Use @var{subheading} as the title (third line, immediately after the
5138 title line) when generating assembly listings.
5139
5140 This directive affects subsequent pages, as well as the current page if
5141 it appears within ten lines of the top of a page.
5142
5143 @ifset COFF
5144 @node Scl
5145 @section @code{.scl @var{class}}
5146
5147 @cindex @code{scl} directive
5148 @cindex symbol storage class (COFF)
5149 @cindex COFF symbol storage class
5150 Set the storage-class value for a symbol. This directive may only be
5151 used inside a @code{.def}/@code{.endef} pair. Storage class may flag
5152 whether a symbol is static or external, or it may record further
5153 symbolic debugging information.
5154 @ifset BOUT
5155
5156 The @samp{.scl} directive is primarily associated with COFF output; when
5157 configured to generate @code{b.out} output format, @command{@value{AS}}
5158 accepts this directive but ignores it.
5159 @end ifset
5160 @end ifset
5161
5162 @ifset COFF-ELF
5163 @node Section
5164 @section @code{.section @var{name}}
5165
5166 @cindex named section
5167 Use the @code{.section} directive to assemble the following code into a section
5168 named @var{name}.
5169
5170 This directive is only supported for targets that actually support arbitrarily
5171 named sections; on @code{a.out} targets, for example, it is not accepted, even
5172 with a standard @code{a.out} section name.
5173
5174 @ifset COFF
5175 @ifset ELF
5176 @c only print the extra heading if both COFF and ELF are set
5177 @subheading COFF Version
5178 @end ifset
5179
5180 @cindex @code{section} directive (COFF version)
5181 For COFF targets, the @code{.section} directive is used in one of the following
5182 ways:
5183
5184 @smallexample
5185 .section @var{name}[, "@var{flags}"]
5186 .section @var{name}[, @var{subsegment}]
5187 @end smallexample
5188
5189 If the optional argument is quoted, it is taken as flags to use for the
5190 section. Each flag is a single character. The following flags are recognized:
5191 @table @code
5192 @item b
5193 bss section (uninitialized data)
5194 @item n
5195 section is not loaded
5196 @item w
5197 writable section
5198 @item d
5199 data section
5200 @item r
5201 read-only section
5202 @item x
5203 executable section
5204 @item s
5205 shared section (meaningful for PE targets)
5206 @item a
5207 ignored. (For compatibility with the ELF version)
5208 @end table
5209
5210 If no flags are specified, the default flags depend upon the section name. If
5211 the section name is not recognized, the default will be for the section to be
5212 loaded and writable. Note the @code{n} and @code{w} flags remove attributes
5213 from the section, rather than adding them, so if they are used on their own it
5214 will be as if no flags had been specified at all.
5215
5216 If the optional argument to the @code{.section} directive is not quoted, it is
5217 taken as a subsegment number (@pxref{Sub-Sections}).
5218 @end ifset
5219
5220 @ifset ELF
5221 @ifset COFF
5222 @c only print the extra heading if both COFF and ELF are set
5223 @subheading ELF Version
5224 @end ifset
5225
5226 @cindex Section Stack
5227 This is one of the ELF section stack manipulation directives. The others are
5228 @code{.subsection} (@pxref{SubSection}), @code{.pushsection}
5229 (@pxref{PushSection}), @code{.popsection} (@pxref{PopSection}), and
5230 @code{.previous} (@pxref{Previous}).
5231
5232 @cindex @code{section} directive (ELF version)
5233 For ELF targets, the @code{.section} directive is used like this:
5234
5235 @smallexample
5236 .section @var{name} [, "@var{flags}"[, @@@var{type}[, @@@var{entsize}]]]
5237 @end smallexample
5238
5239 The optional @var{flags} argument is a quoted string which may contain any
5240 combination of the following characters:
5241 @table @code
5242 @item a
5243 section is allocatable
5244 @item w
5245 section is writable
5246 @item x
5247 section is executable
5248 @item M
5249 section is mergeable
5250 @item S
5251 section contains zero terminated strings
5252 @end table
5253
5254 The optional @var{type} argument may contain one of the following constants:
5255 @table @code
5256 @item @@progbits
5257 section contains data
5258 @item @@nobits
5259 section does not contain data (i.e., section only occupies space)
5260 @end table
5261
5262 Note on targets where the @code{@@} character is the start of a comment (eg
5263 ARM) then another character is used instead. For example the ARM port uses the
5264 @code{%} character.
5265
5266 If @var{flags} contains @code{M} flag, @var{type} argument must be specified
5267 as well as @var{entsize} argument. Sections with @code{M} flag but not
5268 @code{S} flag must contain fixed size constants, each @var{entsize} octets
5269 long. Sections with both @code{M} and @code{S} must contain zero terminated
5270 strings where each character is @var{entsize} bytes long. The linker may remove
5271 duplicates within sections with the same name, same entity size and same flags.
5272
5273 If no flags are specified, the default flags depend upon the section name. If
5274 the section name is not recognized, the default will be for the section to have
5275 none of the above flags: it will not be allocated in memory, nor writable, nor
5276 executable. The section will contain data.
5277
5278 For ELF targets, the assembler supports another type of @code{.section}
5279 directive for compatibility with the Solaris assembler:
5280
5281 @smallexample
5282 .section "@var{name}"[, @var{flags}...]
5283 @end smallexample
5284
5285 Note that the section name is quoted. There may be a sequence of comma
5286 separated flags:
5287 @table @code
5288 @item #alloc
5289 section is allocatable
5290 @item #write
5291 section is writable
5292 @item #execinstr
5293 section is executable
5294 @end table
5295
5296 This directive replaces the current section and subsection. The replaced
5297 section and subsection are pushed onto the section stack. See the contents of
5298 the gas testsuite directory @code{gas/testsuite/gas/elf} for some examples of
5299 how this directive and the other section stack directives work.
5300 @end ifset
5301 @end ifset
5302
5303 @node Set
5304 @section @code{.set @var{symbol}, @var{expression}}
5305
5306 @cindex @code{set} directive
5307 @cindex symbol value, setting
5308 Set the value of @var{symbol} to @var{expression}. This
5309 changes @var{symbol}'s value and type to conform to
5310 @var{expression}. If @var{symbol} was flagged as external, it remains
5311 flagged (@pxref{Symbol Attributes}).
5312
5313 You may @code{.set} a symbol many times in the same assembly.
5314
5315 If you @code{.set} a global symbol, the value stored in the object
5316 file is the last value stored into it.
5317
5318 @ifset HPPA
5319 The syntax for @code{set} on the HPPA is
5320 @samp{@var{symbol} .set @var{expression}}.
5321 @end ifset
5322
5323 @node Short
5324 @section @code{.short @var{expressions}}
5325
5326 @cindex @code{short} directive
5327 @ifset GENERIC
5328 @code{.short} is normally the same as @samp{.word}.
5329 @xref{Word,,@code{.word}}.
5330
5331 In some configurations, however, @code{.short} and @code{.word} generate
5332 numbers of different lengths; @pxref{Machine Dependencies}.
5333 @end ifset
5334 @ifclear GENERIC
5335 @ifset W16
5336 @code{.short} is the same as @samp{.word}. @xref{Word,,@code{.word}}.
5337 @end ifset
5338 @ifset W32
5339 This expects zero or more @var{expressions}, and emits
5340 a 16 bit number for each.
5341 @end ifset
5342 @end ifclear
5343
5344 @node Single
5345 @section @code{.single @var{flonums}}
5346
5347 @cindex @code{single} directive
5348 @cindex floating point numbers (single)
5349 This directive assembles zero or more flonums, separated by commas. It
5350 has the same effect as @code{.float}.
5351 @ifset GENERIC
5352 The exact kind of floating point numbers emitted depends on how
5353 @command{@value{AS}} is configured. @xref{Machine Dependencies}.
5354 @end ifset
5355 @ifclear GENERIC
5356 @ifset IEEEFLOAT
5357 On the @value{TARGET} family, @code{.single} emits 32-bit floating point
5358 numbers in @sc{ieee} format.
5359 @end ifset
5360 @end ifclear
5361
5362 @ifset COFF-ELF
5363 @node Size
5364 @section @code{.size}
5365
5366 This directive is used to set the size associated with a symbol.
5367
5368 @ifset COFF
5369 @ifset ELF
5370 @c only print the extra heading if both COFF and ELF are set
5371 @subheading COFF Version
5372 @end ifset
5373
5374 @cindex @code{size} directive (COFF version)
5375 For COFF targets, the @code{.size} directive is only permitted inside
5376 @code{.def}/@code{.endef} pairs. It is used like this:
5377
5378 @smallexample
5379 .size @var{expression}
5380 @end smallexample
5381
5382 @ifset BOUT
5383 @samp{.size} is only meaningful when generating COFF format output; when
5384 @command{@value{AS}} is generating @code{b.out}, it accepts this directive but
5385 ignores it.
5386 @end ifset
5387 @end ifset
5388
5389 @ifset ELF
5390 @ifset COFF
5391 @c only print the extra heading if both COFF and ELF are set
5392 @subheading ELF Version
5393 @end ifset
5394
5395 @cindex @code{size} directive (ELF version)
5396 For ELF targets, the @code{.size} directive is used like this:
5397
5398 @smallexample
5399 .size @var{name} , @var{expression}
5400 @end smallexample
5401
5402 This directive sets the size associated with a symbol @var{name}.
5403 The size in bytes is computed from @var{expression} which can make use of label
5404 arithmetic. This directive is typically used to set the size of function
5405 symbols.
5406 @end ifset
5407 @end ifset
5408
5409 @node Sleb128
5410 @section @code{.sleb128 @var{expressions}}
5411
5412 @cindex @code{sleb128} directive
5413 @var{sleb128} stands for ``signed little endian base 128.'' This is a
5414 compact, variable length representation of numbers used by the DWARF
5415 symbolic debugging format. @xref{Uleb128,@code{.uleb128}}.
5416
5417 @ifclear no-space-dir
5418 @node Skip
5419 @section @code{.skip @var{size} , @var{fill}}
5420
5421 @cindex @code{skip} directive
5422 @cindex filling memory
5423 This directive emits @var{size} bytes, each of value @var{fill}. Both
5424 @var{size} and @var{fill} are absolute expressions. If the comma and
5425 @var{fill} are omitted, @var{fill} is assumed to be zero. This is the same as
5426 @samp{.space}.
5427
5428 @node Space
5429 @section @code{.space @var{size} , @var{fill}}
5430
5431 @cindex @code{space} directive
5432 @cindex filling memory
5433 This directive emits @var{size} bytes, each of value @var{fill}. Both
5434 @var{size} and @var{fill} are absolute expressions. If the comma
5435 and @var{fill} are omitted, @var{fill} is assumed to be zero. This is the same
5436 as @samp{.skip}.
5437
5438 @ifset HPPA
5439 @quotation
5440 @emph{Warning:} @code{.space} has a completely different meaning for HPPA
5441 targets; use @code{.block} as a substitute. See @cite{HP9000 Series 800
5442 Assembly Language Reference Manual} (HP 92432-90001) for the meaning of the
5443 @code{.space} directive. @xref{HPPA Directives,,HPPA Assembler Directives},
5444 for a summary.
5445 @end quotation
5446 @end ifset
5447 @end ifclear
5448
5449 @ifset A29K
5450 @ifclear GENERIC
5451 @node Space
5452 @section @code{.space}
5453 @cindex @code{space} directive
5454 @end ifclear
5455 On the AMD 29K, this directive is ignored; it is accepted for
5456 compatibility with other AMD 29K assemblers.
5457
5458 @quotation
5459 @emph{Warning:} In most versions of the @sc{gnu} assembler, the directive
5460 @code{.space} has the effect of @code{.block} @xref{Machine Dependencies}.
5461 @end quotation
5462 @end ifset
5463
5464 @ifset have-stabs
5465 @node Stab
5466 @section @code{.stabd, .stabn, .stabs}
5467
5468 @cindex symbolic debuggers, information for
5469 @cindex @code{stab@var{x}} directives
5470 There are three directives that begin @samp{.stab}.
5471 All emit symbols (@pxref{Symbols}), for use by symbolic debuggers.
5472 The symbols are not entered in the @command{@value{AS}} hash table: they
5473 cannot be referenced elsewhere in the source file.
5474 Up to five fields are required:
5475
5476 @table @var
5477 @item string
5478 This is the symbol's name. It may contain any character except
5479 @samp{\000}, so is more general than ordinary symbol names. Some
5480 debuggers used to code arbitrarily complex structures into symbol names
5481 using this field.
5482
5483 @item type
5484 An absolute expression. The symbol's type is set to the low 8 bits of
5485 this expression. Any bit pattern is permitted, but @code{@value{LD}}
5486 and debuggers choke on silly bit patterns.
5487
5488 @item other
5489 An absolute expression. The symbol's ``other'' attribute is set to the
5490 low 8 bits of this expression.
5491
5492 @item desc
5493 An absolute expression. The symbol's descriptor is set to the low 16
5494 bits of this expression.
5495
5496 @item value
5497 An absolute expression which becomes the symbol's value.
5498 @end table
5499
5500 If a warning is detected while reading a @code{.stabd}, @code{.stabn},
5501 or @code{.stabs} statement, the symbol has probably already been created;
5502 you get a half-formed symbol in your object file. This is
5503 compatible with earlier assemblers!
5504
5505 @table @code
5506 @cindex @code{stabd} directive
5507 @item .stabd @var{type} , @var{other} , @var{desc}
5508
5509 The ``name'' of the symbol generated is not even an empty string.
5510 It is a null pointer, for compatibility. Older assemblers used a
5511 null pointer so they didn't waste space in object files with empty
5512 strings.
5513
5514 The symbol's value is set to the location counter,
5515 relocatably. When your program is linked, the value of this symbol
5516 is the address of the location counter when the @code{.stabd} was
5517 assembled.
5518
5519 @cindex @code{stabn} directive
5520 @item .stabn @var{type} , @var{other} , @var{desc} , @var{value}
5521 The name of the symbol is set to the empty string @code{""}.
5522
5523 @cindex @code{stabs} directive
5524 @item .stabs @var{string} , @var{type} , @var{other} , @var{desc} , @var{value}
5525 All five fields are specified.
5526 @end table
5527 @end ifset
5528 @c end have-stabs
5529
5530 @node String
5531 @section @code{.string} "@var{str}"
5532
5533 @cindex string, copying to object file
5534 @cindex @code{string} directive
5535
5536 Copy the characters in @var{str} to the object file. You may specify more than
5537 one string to copy, separated by commas. Unless otherwise specified for a
5538 particular machine, the assembler marks the end of each string with a 0 byte.
5539 You can use any of the escape sequences described in @ref{Strings,,Strings}.
5540
5541 @node Struct
5542 @section @code{.struct @var{expression}}
5543
5544 @cindex @code{struct} directive
5545 Switch to the absolute section, and set the section offset to @var{expression},
5546 which must be an absolute expression. You might use this as follows:
5547 @smallexample
5548 .struct 0
5549 field1:
5550 .struct field1 + 4
5551 field2:
5552 .struct field2 + 4
5553 field3:
5554 @end smallexample
5555 This would define the symbol @code{field1} to have the value 0, the symbol
5556 @code{field2} to have the value 4, and the symbol @code{field3} to have the
5557 value 8. Assembly would be left in the absolute section, and you would need to
5558 use a @code{.section} directive of some sort to change to some other section
5559 before further assembly.
5560
5561 @ifset ELF
5562 @node SubSection
5563 @section @code{.subsection @var{name}}
5564
5565 @cindex @code{subsection} directive
5566 @cindex Section Stack
5567 This is one of the ELF section stack manipulation directives. The others are
5568 @code{.section} (@pxref{Section}), @code{.pushsection} (@pxref{PushSection}),
5569 @code{.popsection} (@pxref{PopSection}), and @code{.previous}
5570 (@pxref{Previous}).
5571
5572 This directive replaces the current subsection with @code{name}. The current
5573 section is not changed. The replaced subsection is put onto the section stack
5574 in place of the then current top of stack subsection.
5575 @end ifset
5576
5577 @ifset ELF
5578 @node Symver
5579 @section @code{.symver}
5580 @cindex @code{symver} directive
5581 @cindex symbol versioning
5582 @cindex versions of symbols
5583 Use the @code{.symver} directive to bind symbols to specific version nodes
5584 within a source file. This is only supported on ELF platforms, and is
5585 typically used when assembling files to be linked into a shared library.
5586 There are cases where it may make sense to use this in objects to be bound
5587 into an application itself so as to override a versioned symbol from a
5588 shared library.
5589
5590 For ELF targets, the @code{.symver} directive can be used like this:
5591 @smallexample
5592 .symver @var{name}, @var{name2@@nodename}
5593 @end smallexample
5594 If the symbol @var{name} is defined within the file
5595 being assembled, the @code{.symver} directive effectively creates a symbol
5596 alias with the name @var{name2@@nodename}, and in fact the main reason that we
5597 just don't try and create a regular alias is that the @var{@@} character isn't
5598 permitted in symbol names. The @var{name2} part of the name is the actual name
5599 of the symbol by which it will be externally referenced. The name @var{name}
5600 itself is merely a name of convenience that is used so that it is possible to
5601 have definitions for multiple versions of a function within a single source
5602 file, and so that the compiler can unambiguously know which version of a
5603 function is being mentioned. The @var{nodename} portion of the alias should be
5604 the name of a node specified in the version script supplied to the linker when
5605 building a shared library. If you are attempting to override a versioned
5606 symbol from a shared library, then @var{nodename} should correspond to the
5607 nodename of the symbol you are trying to override.
5608
5609 If the symbol @var{name} is not defined within the file being assembled, all
5610 references to @var{name} will be changed to @var{name2@@nodename}. If no
5611 reference to @var{name} is made, @var{name2@@nodename} will be removed from the
5612 symbol table.
5613
5614 Another usage of the @code{.symver} directive is:
5615 @smallexample
5616 .symver @var{name}, @var{name2@@@@nodename}
5617 @end smallexample
5618 In this case, the symbol @var{name} must exist and be defined within
5619 the file being assembled. It is similar to @var{name2@@nodename}. The
5620 difference is @var{name2@@@@nodename} will also be used to resolve
5621 references to @var{name2} by the linker.
5622
5623 The third usage of the @code{.symver} directive is:
5624 @smallexample
5625 .symver @var{name}, @var{name2@@@@@@nodename}
5626 @end smallexample
5627 When @var{name} is not defined within the
5628 file being assembled, it is treated as @var{name2@@nodename}. When
5629 @var{name} is defined within the file being assembled, the symbol
5630 name, @var{name}, will be changed to @var{name2@@@@nodename}.
5631 @end ifset
5632
5633 @ifset COFF
5634 @node Tag
5635 @section @code{.tag @var{structname}}
5636
5637 @cindex COFF structure debugging
5638 @cindex structure debugging, COFF
5639 @cindex @code{tag} directive
5640 This directive is generated by compilers to include auxiliary debugging
5641 information in the symbol table. It is only permitted inside
5642 @code{.def}/@code{.endef} pairs. Tags are used to link structure
5643 definitions in the symbol table with instances of those structures.
5644 @ifset BOUT
5645
5646 @samp{.tag} is only used when generating COFF format output; when
5647 @command{@value{AS}} is generating @code{b.out}, it accepts this directive but
5648 ignores it.
5649 @end ifset
5650 @end ifset
5651
5652 @node Text
5653 @section @code{.text @var{subsection}}
5654
5655 @cindex @code{text} directive
5656 Tells @command{@value{AS}} to assemble the following statements onto the end of
5657 the text subsection numbered @var{subsection}, which is an absolute
5658 expression. If @var{subsection} is omitted, subsection number zero
5659 is used.
5660
5661 @node Title
5662 @section @code{.title "@var{heading}"}
5663
5664 @cindex @code{title} directive
5665 @cindex listing control: title line
5666 Use @var{heading} as the title (second line, immediately after the
5667 source file name and pagenumber) when generating assembly listings.
5668
5669 This directive affects subsequent pages, as well as the current page if
5670 it appears within ten lines of the top of a page.
5671
5672 @ifset COFF-ELF
5673 @node Type
5674 @section @code{.type}
5675
5676 This directive is used to set the type of a symbol.
5677
5678 @ifset COFF
5679 @ifset ELF
5680 @c only print the extra heading if both COFF and ELF are set
5681 @subheading COFF Version
5682 @end ifset
5683
5684 @cindex COFF symbol type
5685 @cindex symbol type, COFF
5686 @cindex @code{type} directive (COFF version)
5687 For COFF targets, this directive is permitted only within
5688 @code{.def}/@code{.endef} pairs. It is used like this:
5689
5690 @smallexample
5691 .type @var{int}
5692 @end smallexample
5693
5694 This records the integer @var{int} as the type attribute of a symbol table
5695 entry.
5696
5697 @ifset BOUT
5698 @samp{.type} is associated only with COFF format output; when
5699 @command{@value{AS}} is configured for @code{b.out} output, it accepts this
5700 directive but ignores it.
5701 @end ifset
5702 @end ifset
5703
5704 @ifset ELF
5705 @ifset COFF
5706 @c only print the extra heading if both COFF and ELF are set
5707 @subheading ELF Version
5708 @end ifset
5709
5710 @cindex ELF symbol type
5711 @cindex symbol type, ELF
5712 @cindex @code{type} directive (ELF version)
5713 For ELF targets, the @code{.type} directive is used like this:
5714
5715 @smallexample
5716 .type @var{name} , @var{type description}
5717 @end smallexample
5718
5719 This sets the type of symbol @var{name} to be either a
5720 function symbol or an object symbol. There are five different syntaxes
5721 supported for the @var{type description} field, in order to provide
5722 compatibility with various other assemblers. The syntaxes supported are:
5723
5724 @smallexample
5725 .type <name>,#function
5726 .type <name>,#object
5727
5728 .type <name>,@@function
5729 .type <name>,@@object
5730
5731 .type <name>,%function
5732 .type <name>,%object
5733
5734 .type <name>,"function"
5735 .type <name>,"object"
5736
5737 .type <name> STT_FUNCTION
5738 .type <name> STT_OBJECT
5739 @end smallexample
5740 @end ifset
5741 @end ifset
5742
5743 @node Uleb128
5744 @section @code{.uleb128 @var{expressions}}
5745
5746 @cindex @code{uleb128} directive
5747 @var{uleb128} stands for ``unsigned little endian base 128.'' This is a
5748 compact, variable length representation of numbers used by the DWARF
5749 symbolic debugging format. @xref{Sleb128,@code{.sleb128}}.
5750
5751 @ifset COFF
5752 @node Val
5753 @section @code{.val @var{addr}}
5754
5755 @cindex @code{val} directive
5756 @cindex COFF value attribute
5757 @cindex value attribute, COFF
5758 This directive, permitted only within @code{.def}/@code{.endef} pairs,
5759 records the address @var{addr} as the value attribute of a symbol table
5760 entry.
5761 @ifset BOUT
5762
5763 @samp{.val} is used only for COFF output; when @command{@value{AS}} is
5764 configured for @code{b.out}, it accepts this directive but ignores it.
5765 @end ifset
5766 @end ifset
5767
5768 @ifset ELF
5769 @node Version
5770 @section @code{.version "@var{string}"}
5771
5772 @cindex @code{version} directive
5773 This directive creates a @code{.note} section and places into it an ELF
5774 formatted note of type NT_VERSION. The note's name is set to @code{string}.
5775 @end ifset
5776
5777 @ifset ELF
5778 @node VTableEntry
5779 @section @code{.vtable_entry @var{table}, @var{offset}}
5780
5781 @cindex @code{vtable_entry}
5782 This directive finds or creates a symbol @code{table} and creates a
5783 @code{VTABLE_ENTRY} relocation for it with an addend of @code{offset}.
5784
5785 @node VTableInherit
5786 @section @code{.vtable_inherit @var{child}, @var{parent}}
5787
5788 @cindex @code{vtable_inherit}
5789 This directive finds the symbol @code{child} and finds or creates the symbol
5790 @code{parent} and then creates a @code{VTABLE_INHERIT} relocation for the
5791 parent whose addend is the value of the child symbol. As a special case the
5792 parent name of @code{0} is treated as refering the @code{*ABS*} section.
5793 @end ifset
5794
5795 @ifset ELF
5796 @node Weak
5797 @section @code{.weak @var{names}}
5798
5799 @cindex @code{weak} directive
5800 This directive sets the weak attribute on the comma separated list of symbol
5801 @code{names}. If the symbols do not already exist, they will be created.
5802 @end ifset
5803
5804 @node Word
5805 @section @code{.word @var{expressions}}
5806
5807 @cindex @code{word} directive
5808 This directive expects zero or more @var{expressions}, of any section,
5809 separated by commas.
5810 @ifclear GENERIC
5811 @ifset W32
5812 For each expression, @command{@value{AS}} emits a 32-bit number.
5813 @end ifset
5814 @ifset W16
5815 For each expression, @command{@value{AS}} emits a 16-bit number.
5816 @end ifset
5817 @end ifclear
5818 @ifset GENERIC
5819
5820 The size of the number emitted, and its byte order,
5821 depend on what target computer the assembly is for.
5822 @end ifset
5823
5824 @c on amd29k, i960, sparc the "special treatment to support compilers" doesn't
5825 @c happen---32-bit addressability, period; no long/short jumps.
5826 @ifset DIFF-TBL-KLUGE
5827 @cindex difference tables altered
5828 @cindex altered difference tables
5829 @quotation
5830 @emph{Warning: Special Treatment to support Compilers}
5831 @end quotation
5832
5833 @ifset GENERIC
5834 Machines with a 32-bit address space, but that do less than 32-bit
5835 addressing, require the following special treatment. If the machine of
5836 interest to you does 32-bit addressing (or doesn't require it;
5837 @pxref{Machine Dependencies}), you can ignore this issue.
5838
5839 @end ifset
5840 In order to assemble compiler output into something that works,
5841 @command{@value{AS}} occasionally does strange things to @samp{.word} directives.
5842 Directives of the form @samp{.word sym1-sym2} are often emitted by
5843 compilers as part of jump tables. Therefore, when @command{@value{AS}} assembles a
5844 directive of the form @samp{.word sym1-sym2}, and the difference between
5845 @code{sym1} and @code{sym2} does not fit in 16 bits, @command{@value{AS}}
5846 creates a @dfn{secondary jump table}, immediately before the next label.
5847 This secondary jump table is preceded by a short-jump to the
5848 first byte after the secondary table. This short-jump prevents the flow
5849 of control from accidentally falling into the new table. Inside the
5850 table is a long-jump to @code{sym2}. The original @samp{.word}
5851 contains @code{sym1} minus the address of the long-jump to
5852 @code{sym2}.
5853
5854 If there were several occurrences of @samp{.word sym1-sym2} before the
5855 secondary jump table, all of them are adjusted. If there was a
5856 @samp{.word sym3-sym4}, that also did not fit in sixteen bits, a
5857 long-jump to @code{sym4} is included in the secondary jump table,
5858 and the @code{.word} directives are adjusted to contain @code{sym3}
5859 minus the address of the long-jump to @code{sym4}; and so on, for as many
5860 entries in the original jump table as necessary.
5861
5862 @ifset INTERNALS
5863 @emph{This feature may be disabled by compiling @command{@value{AS}} with the
5864 @samp{-DWORKING_DOT_WORD} option.} This feature is likely to confuse
5865 assembly language programmers.
5866 @end ifset
5867 @end ifset
5868 @c end DIFF-TBL-KLUGE
5869
5870 @node Deprecated
5871 @section Deprecated Directives
5872
5873 @cindex deprecated directives
5874 @cindex obsolescent directives
5875 One day these directives won't work.
5876 They are included for compatibility with older assemblers.
5877 @table @t
5878 @item .abort
5879 @item .line
5880 @end table
5881
5882 @ifset GENERIC
5883 @node Machine Dependencies
5884 @chapter Machine Dependent Features
5885
5886 @cindex machine dependencies
5887 The machine instruction sets are (almost by definition) different on
5888 each machine where @command{@value{AS}} runs. Floating point representations
5889 vary as well, and @command{@value{AS}} often supports a few additional
5890 directives or command-line options for compatibility with other
5891 assemblers on a particular platform. Finally, some versions of
5892 @command{@value{AS}} support special pseudo-instructions for branch
5893 optimization.
5894
5895 This chapter discusses most of these differences, though it does not
5896 include details on any machine's instruction set. For details on that
5897 subject, see the hardware manufacturer's manual.
5898
5899 @menu
5900 @ifset A29K
5901 * AMD29K-Dependent:: AMD 29K Dependent Features
5902 @end ifset
5903 @ifset ALPHA
5904 * Alpha-Dependent:: Alpha Dependent Features
5905 @end ifset
5906 @ifset ARC
5907 * ARC-Dependent:: ARC Dependent Features
5908 @end ifset
5909 @ifset ARM
5910 * ARM-Dependent:: ARM Dependent Features
5911 @end ifset
5912 @ifset CRIS
5913 * CRIS-Dependent:: CRIS Dependent Features
5914 @end ifset
5915 @ifset D10V
5916 * D10V-Dependent:: D10V Dependent Features
5917 @end ifset
5918 @ifset D30V
5919 * D30V-Dependent:: D30V Dependent Features
5920 @end ifset
5921 @ifset H8/300
5922 * H8/300-Dependent:: Renesas H8/300 Dependent Features
5923 @end ifset
5924 @ifset H8/500
5925 * H8/500-Dependent:: Renesas H8/500 Dependent Features
5926 @end ifset
5927 @ifset HPPA
5928 * HPPA-Dependent:: HPPA Dependent Features
5929 @end ifset
5930 @ifset I370
5931 * ESA/390-Dependent:: IBM ESA/390 Dependent Features
5932 @end ifset
5933 @ifset I80386
5934 * i386-Dependent:: Intel 80386 and AMD x86-64 Dependent Features
5935 @end ifset
5936 @ifset I860
5937 * i860-Dependent:: Intel 80860 Dependent Features
5938 @end ifset
5939 @ifset I960
5940 * i960-Dependent:: Intel 80960 Dependent Features
5941 @end ifset
5942 @ifset IP2K
5943 * IP2K-Dependent:: IP2K Dependent Features
5944 @end ifset
5945 @ifset M32R
5946 * M32R-Dependent:: M32R Dependent Features
5947 @end ifset
5948 @ifset M680X0
5949 * M68K-Dependent:: M680x0 Dependent Features
5950 @end ifset
5951 @ifset M68HC11
5952 * M68HC11-Dependent:: M68HC11 and 68HC12 Dependent Features
5953 @end ifset
5954 @ifset M880X0
5955 * M88K-Dependent:: M880x0 Dependent Features
5956 @end ifset
5957 @ifset MIPS
5958 * MIPS-Dependent:: MIPS Dependent Features
5959 @end ifset
5960 @ifset MMIX
5961 * MMIX-Dependent:: MMIX Dependent Features
5962 @end ifset
5963 @ifset MSP430
5964 * MSP430-Dependent:: MSP430 Dependent Features
5965 @end ifset
5966 @ifset SH
5967 * SH-Dependent:: Renesas / SuperH SH Dependent Features
5968 * SH64-Dependent:: SuperH SH64 Dependent Features
5969 @end ifset
5970 @ifset PDP11
5971 * PDP-11-Dependent:: PDP-11 Dependent Features
5972 @end ifset
5973 @ifset PJ
5974 * PJ-Dependent:: picoJava Dependent Features
5975 @end ifset
5976 @ifset PPC
5977 * PPC-Dependent:: PowerPC Dependent Features
5978 @end ifset
5979 @ifset SPARC
5980 * Sparc-Dependent:: SPARC Dependent Features
5981 @end ifset
5982 @ifset TIC54X
5983 * TIC54X-Dependent:: TI TMS320C54x Dependent Features
5984 @end ifset
5985 @ifset V850
5986 * V850-Dependent:: V850 Dependent Features
5987 @end ifset
5988 @ifset XTENSA
5989 * Xtensa-Dependent:: Xtensa Dependent Features
5990 @end ifset
5991 @ifset Z8000
5992 * Z8000-Dependent:: Z8000 Dependent Features
5993 @end ifset
5994 @ifset VAX
5995 * Vax-Dependent:: VAX Dependent Features
5996 @end ifset
5997 @end menu
5998
5999 @lowersections
6000 @end ifset
6001
6002 @c The following major nodes are *sections* in the GENERIC version, *chapters*
6003 @c in single-cpu versions. This is mainly achieved by @lowersections. There is a
6004 @c peculiarity: to preserve cross-references, there must be a node called
6005 @c "Machine Dependencies". Hence the conditional nodenames in each
6006 @c major node below. Node defaulting in makeinfo requires adjacency of
6007 @c node and sectioning commands; hence the repetition of @chapter BLAH
6008 @c in both conditional blocks.
6009
6010 @ifset A29K
6011 @include c-a29k.texi
6012 @end ifset
6013
6014 @ifset ALPHA
6015 @include c-alpha.texi
6016 @end ifset
6017
6018 @ifset ARC
6019 @include c-arc.texi
6020 @end ifset
6021
6022 @ifset ARM
6023 @include c-arm.texi
6024 @end ifset
6025
6026 @ifset CRIS
6027 @include c-cris.texi
6028 @end ifset
6029
6030 @ifset Renesas-all
6031 @ifclear GENERIC
6032 @node Machine Dependencies
6033 @chapter Machine Dependent Features
6034
6035 The machine instruction sets are different on each Renesas chip family,
6036 and there are also some syntax differences among the families. This
6037 chapter describes the specific @command{@value{AS}} features for each
6038 family.
6039
6040 @menu
6041 * H8/300-Dependent:: Renesas H8/300 Dependent Features
6042 * H8/500-Dependent:: Renesas H8/500 Dependent Features
6043 * SH-Dependent:: Renesas SH Dependent Features
6044 @end menu
6045 @lowersections
6046 @end ifclear
6047 @end ifset
6048
6049 @ifset D10V
6050 @include c-d10v.texi
6051 @end ifset
6052
6053 @ifset D30V
6054 @include c-d30v.texi
6055 @end ifset
6056
6057 @ifset H8/300
6058 @include c-h8300.texi
6059 @end ifset
6060
6061 @ifset H8/500
6062 @include c-h8500.texi
6063 @end ifset
6064
6065 @ifset HPPA
6066 @include c-hppa.texi
6067 @end ifset
6068
6069 @ifset I370
6070 @include c-i370.texi
6071 @end ifset
6072
6073 @ifset I80386
6074 @include c-i386.texi
6075 @end ifset
6076
6077 @ifset I860
6078 @include c-i860.texi
6079 @end ifset
6080
6081 @ifset I960
6082 @include c-i960.texi
6083 @end ifset
6084
6085 @ifset IA64
6086 @include c-ia64.texi
6087 @end ifset
6088
6089 @ifset IP2K
6090 @include c-ip2k.texi
6091 @end ifset
6092
6093 @ifset M32R
6094 @include c-m32r.texi
6095 @end ifset
6096
6097 @ifset M680X0
6098 @include c-m68k.texi
6099 @end ifset
6100
6101 @ifset M68HC11
6102 @include c-m68hc11.texi
6103 @end ifset
6104
6105 @ifset M880X0
6106 @include c-m88k.texi
6107 @end ifset
6108
6109 @ifset MIPS
6110 @include c-mips.texi
6111 @end ifset
6112
6113 @ifset MMIX
6114 @include c-mmix.texi
6115 @end ifset
6116
6117 @ifset MSP430
6118 @include c-msp430.texi
6119 @end ifset
6120
6121 @ifset NS32K
6122 @include c-ns32k.texi
6123 @end ifset
6124
6125 @ifset PDP11
6126 @include c-pdp11.texi
6127 @end ifset
6128
6129 @ifset PJ
6130 @include c-pj.texi
6131 @end ifset
6132
6133 @ifset PPC
6134 @include c-ppc.texi
6135 @end ifset
6136
6137 @ifset SH
6138 @include c-sh.texi
6139 @include c-sh64.texi
6140 @end ifset
6141
6142 @ifset SPARC
6143 @include c-sparc.texi
6144 @end ifset
6145
6146 @ifset TIC54X
6147 @include c-tic54x.texi
6148 @end ifset
6149
6150 @ifset Z8000
6151 @include c-z8k.texi
6152 @end ifset
6153
6154 @ifset VAX
6155 @include c-vax.texi
6156 @end ifset
6157
6158 @ifset V850
6159 @include c-v850.texi
6160 @end ifset
6161
6162 @ifset XTENSA
6163 @include c-xtensa.texi
6164 @end ifset
6165
6166 @ifset GENERIC
6167 @c reverse effect of @down at top of generic Machine-Dep chapter
6168 @raisesections
6169 @end ifset
6170
6171 @node Reporting Bugs
6172 @chapter Reporting Bugs
6173 @cindex bugs in assembler
6174 @cindex reporting bugs in assembler
6175
6176 Your bug reports play an essential role in making @command{@value{AS}} reliable.
6177
6178 Reporting a bug may help you by bringing a solution to your problem, or it may
6179 not. But in any case the principal function of a bug report is to help the
6180 entire community by making the next version of @command{@value{AS}} work better.
6181 Bug reports are your contribution to the maintenance of @command{@value{AS}}.
6182
6183 In order for a bug report to serve its purpose, you must include the
6184 information that enables us to fix the bug.
6185
6186 @menu
6187 * Bug Criteria:: Have you found a bug?
6188 * Bug Reporting:: How to report bugs
6189 @end menu
6190
6191 @node Bug Criteria
6192 @section Have You Found a Bug?
6193 @cindex bug criteria
6194
6195 If you are not sure whether you have found a bug, here are some guidelines:
6196
6197 @itemize @bullet
6198 @cindex fatal signal
6199 @cindex assembler crash
6200 @cindex crash of assembler
6201 @item
6202 If the assembler gets a fatal signal, for any input whatever, that is a
6203 @command{@value{AS}} bug. Reliable assemblers never crash.
6204
6205 @cindex error on valid input
6206 @item
6207 If @command{@value{AS}} produces an error message for valid input, that is a bug.
6208
6209 @cindex invalid input
6210 @item
6211 If @command{@value{AS}} does not produce an error message for invalid input, that
6212 is a bug. However, you should note that your idea of ``invalid input'' might
6213 be our idea of ``an extension'' or ``support for traditional practice''.
6214
6215 @item
6216 If you are an experienced user of assemblers, your suggestions for improvement
6217 of @command{@value{AS}} are welcome in any case.
6218 @end itemize
6219
6220 @node Bug Reporting
6221 @section How to Report Bugs
6222 @cindex bug reports
6223 @cindex assembler bugs, reporting
6224
6225 A number of companies and individuals offer support for @sc{gnu} products. If
6226 you obtained @command{@value{AS}} from a support organization, we recommend you
6227 contact that organization first.
6228
6229 You can find contact information for many support companies and
6230 individuals in the file @file{etc/SERVICE} in the @sc{gnu} Emacs
6231 distribution.
6232
6233 In any event, we also recommend that you send bug reports for @command{@value{AS}}
6234 to @samp{bug-binutils@@gnu.org}.
6235
6236 The fundamental principle of reporting bugs usefully is this:
6237 @strong{report all the facts}. If you are not sure whether to state a
6238 fact or leave it out, state it!
6239
6240 Often people omit facts because they think they know what causes the problem
6241 and assume that some details do not matter. Thus, you might assume that the
6242 name of a symbol you use in an example does not matter. Well, probably it does
6243 not, but one cannot be sure. Perhaps the bug is a stray memory reference which
6244 happens to fetch from the location where that name is stored in memory;
6245 perhaps, if the name were different, the contents of that location would fool
6246 the assembler into doing the right thing despite the bug. Play it safe and
6247 give a specific, complete example. That is the easiest thing for you to do,
6248 and the most helpful.
6249
6250 Keep in mind that the purpose of a bug report is to enable us to fix the bug if
6251 it is new to us. Therefore, always write your bug reports on the assumption
6252 that the bug has not been reported previously.
6253
6254 Sometimes people give a few sketchy facts and ask, ``Does this ring a
6255 bell?'' This cannot help us fix a bug, so it is basically useless. We
6256 respond by asking for enough details to enable us to investigate.
6257 You might as well expedite matters by sending them to begin with.
6258
6259 To enable us to fix the bug, you should include all these things:
6260
6261 @itemize @bullet
6262 @item
6263 The version of @command{@value{AS}}. @command{@value{AS}} announces it if you start
6264 it with the @samp{--version} argument.
6265
6266 Without this, we will not know whether there is any point in looking for
6267 the bug in the current version of @command{@value{AS}}.
6268
6269 @item
6270 Any patches you may have applied to the @command{@value{AS}} source.
6271
6272 @item
6273 The type of machine you are using, and the operating system name and
6274 version number.
6275
6276 @item
6277 What compiler (and its version) was used to compile @command{@value{AS}}---e.g.
6278 ``@code{gcc-2.7}''.
6279
6280 @item
6281 The command arguments you gave the assembler to assemble your example and
6282 observe the bug. To guarantee you will not omit something important, list them
6283 all. A copy of the Makefile (or the output from make) is sufficient.
6284
6285 If we were to try to guess the arguments, we would probably guess wrong
6286 and then we might not encounter the bug.
6287
6288 @item
6289 A complete input file that will reproduce the bug. If the bug is observed when
6290 the assembler is invoked via a compiler, send the assembler source, not the
6291 high level language source. Most compilers will produce the assembler source
6292 when run with the @samp{-S} option. If you are using @code{@value{GCC}}, use
6293 the options @samp{-v --save-temps}; this will save the assembler source in a
6294 file with an extension of @file{.s}, and also show you exactly how
6295 @command{@value{AS}} is being run.
6296
6297 @item
6298 A description of what behavior you observe that you believe is
6299 incorrect. For example, ``It gets a fatal signal.''
6300
6301 Of course, if the bug is that @command{@value{AS}} gets a fatal signal, then we
6302 will certainly notice it. But if the bug is incorrect output, we might not
6303 notice unless it is glaringly wrong. You might as well not give us a chance to
6304 make a mistake.
6305
6306 Even if the problem you experience is a fatal signal, you should still say so
6307 explicitly. Suppose something strange is going on, such as, your copy of
6308 @command{@value{AS}} is out of synch, or you have encountered a bug in the C
6309 library on your system. (This has happened!) Your copy might crash and ours
6310 would not. If you told us to expect a crash, then when ours fails to crash, we
6311 would know that the bug was not happening for us. If you had not told us to
6312 expect a crash, then we would not be able to draw any conclusion from our
6313 observations.
6314
6315 @item
6316 If you wish to suggest changes to the @command{@value{AS}} source, send us context
6317 diffs, as generated by @code{diff} with the @samp{-u}, @samp{-c}, or @samp{-p}
6318 option. Always send diffs from the old file to the new file. If you even
6319 discuss something in the @command{@value{AS}} source, refer to it by context, not
6320 by line number.
6321
6322 The line numbers in our development sources will not match those in your
6323 sources. Your line numbers would convey no useful information to us.
6324 @end itemize
6325
6326 Here are some things that are not necessary:
6327
6328 @itemize @bullet
6329 @item
6330 A description of the envelope of the bug.
6331
6332 Often people who encounter a bug spend a lot of time investigating
6333 which changes to the input file will make the bug go away and which
6334 changes will not affect it.
6335
6336 This is often time consuming and not very useful, because the way we
6337 will find the bug is by running a single example under the debugger
6338 with breakpoints, not by pure deduction from a series of examples.
6339 We recommend that you save your time for something else.
6340
6341 Of course, if you can find a simpler example to report @emph{instead}
6342 of the original one, that is a convenience for us. Errors in the
6343 output will be easier to spot, running under the debugger will take
6344 less time, and so on.
6345
6346 However, simplification is not vital; if you do not want to do this,
6347 report the bug anyway and send us the entire test case you used.
6348
6349 @item
6350 A patch for the bug.
6351
6352 A patch for the bug does help us if it is a good one. But do not omit
6353 the necessary information, such as the test case, on the assumption that
6354 a patch is all we need. We might see problems with your patch and decide
6355 to fix the problem another way, or we might not understand it at all.
6356
6357 Sometimes with a program as complicated as @command{@value{AS}} it is very hard to
6358 construct an example that will make the program follow a certain path through
6359 the code. If you do not send us the example, we will not be able to construct
6360 one, so we will not be able to verify that the bug is fixed.
6361
6362 And if we cannot understand what bug you are trying to fix, or why your
6363 patch should be an improvement, we will not install it. A test case will
6364 help us to understand.
6365
6366 @item
6367 A guess about what the bug is or what it depends on.
6368
6369 Such guesses are usually wrong. Even we cannot guess right about such
6370 things without first using the debugger to find the facts.
6371 @end itemize
6372
6373 @node Acknowledgements
6374 @chapter Acknowledgements
6375
6376 If you have contributed to @command{@value{AS}} and your name isn't listed here,
6377 it is not meant as a slight. We just don't know about it. Send mail to the
6378 maintainer, and we'll correct the situation. Currently
6379 @c (January 1994),
6380 the maintainer is Ken Raeburn (email address @code{raeburn@@cygnus.com}).
6381
6382 Dean Elsner wrote the original @sc{gnu} assembler for the VAX.@footnote{Any
6383 more details?}
6384
6385 Jay Fenlason maintained GAS for a while, adding support for GDB-specific debug
6386 information and the 68k series machines, most of the preprocessing pass, and
6387 extensive changes in @file{messages.c}, @file{input-file.c}, @file{write.c}.
6388
6389 K. Richard Pixley maintained GAS for a while, adding various enhancements and
6390 many bug fixes, including merging support for several processors, breaking GAS
6391 up to handle multiple object file format back ends (including heavy rewrite,
6392 testing, an integration of the coff and b.out back ends), adding configuration
6393 including heavy testing and verification of cross assemblers and file splits
6394 and renaming, converted GAS to strictly ANSI C including full prototypes, added
6395 support for m680[34]0 and cpu32, did considerable work on i960 including a COFF
6396 port (including considerable amounts of reverse engineering), a SPARC opcode
6397 file rewrite, DECstation, rs6000, and hp300hpux host ports, updated ``know''
6398 assertions and made them work, much other reorganization, cleanup, and lint.
6399
6400 Ken Raeburn wrote the high-level BFD interface code to replace most of the code
6401 in format-specific I/O modules.
6402
6403 The original VMS support was contributed by David L. Kashtan. Eric Youngdale
6404 has done much work with it since.
6405
6406 The Intel 80386 machine description was written by Eliot Dresselhaus.
6407
6408 Minh Tran-Le at IntelliCorp contributed some AIX 386 support.
6409
6410 The Motorola 88k machine description was contributed by Devon Bowen of Buffalo
6411 University and Torbjorn Granlund of the Swedish Institute of Computer Science.
6412
6413 Keith Knowles at the Open Software Foundation wrote the original MIPS back end
6414 (@file{tc-mips.c}, @file{tc-mips.h}), and contributed Rose format support
6415 (which hasn't been merged in yet). Ralph Campbell worked with the MIPS code to
6416 support a.out format.
6417
6418 Support for the Zilog Z8k and Renesas H8/300 and H8/500 processors (tc-z8k,
6419 tc-h8300, tc-h8500), and IEEE 695 object file format (obj-ieee), was written by
6420 Steve Chamberlain of Cygnus Support. Steve also modified the COFF back end to
6421 use BFD for some low-level operations, for use with the H8/300 and AMD 29k
6422 targets.
6423
6424 John Gilmore built the AMD 29000 support, added @code{.include} support, and
6425 simplified the configuration of which versions accept which directives. He
6426 updated the 68k machine description so that Motorola's opcodes always produced
6427 fixed-size instructions (e.g., @code{jsr}), while synthetic instructions
6428 remained shrinkable (@code{jbsr}). John fixed many bugs, including true tested
6429 cross-compilation support, and one bug in relaxation that took a week and
6430 required the proverbial one-bit fix.
6431
6432 Ian Lance Taylor of Cygnus Support merged the Motorola and MIT syntax for the
6433 68k, completed support for some COFF targets (68k, i386 SVR3, and SCO Unix),
6434 added support for MIPS ECOFF and ELF targets, wrote the initial RS/6000 and
6435 PowerPC assembler, and made a few other minor patches.
6436
6437 Steve Chamberlain made @command{@value{AS}} able to generate listings.
6438
6439 Hewlett-Packard contributed support for the HP9000/300.
6440
6441 Jeff Law wrote GAS and BFD support for the native HPPA object format (SOM)
6442 along with a fairly extensive HPPA testsuite (for both SOM and ELF object
6443 formats). This work was supported by both the Center for Software Science at
6444 the University of Utah and Cygnus Support.
6445
6446 Support for ELF format files has been worked on by Mark Eichin of Cygnus
6447 Support (original, incomplete implementation for SPARC), Pete Hoogenboom and
6448 Jeff Law at the University of Utah (HPPA mainly), Michael Meissner of the Open
6449 Software Foundation (i386 mainly), and Ken Raeburn of Cygnus Support (sparc,
6450 and some initial 64-bit support).
6451
6452 Linas Vepstas added GAS support for the ESA/390 ``IBM 370'' architecture.
6453
6454 Richard Henderson rewrote the Alpha assembler. Klaus Kaempf wrote GAS and BFD
6455 support for openVMS/Alpha.
6456
6457 Timothy Wall, Michael Hayes, and Greg Smart contributed to the various tic*
6458 flavors.
6459
6460 David Heine, Sterling Augustine, Bob Wilson and John Ruttenberg from Tensilica,
6461 Inc. added support for Xtensa processors.
6462
6463 Several engineers at Cygnus Support have also provided many small bug fixes and
6464 configuration enhancements.
6465
6466 Many others have contributed large or small bugfixes and enhancements. If
6467 you have contributed significant work and are not mentioned on this list, and
6468 want to be, let us know. Some of the history has been lost; we are not
6469 intentionally leaving anyone out.
6470
6471 @include fdl.texi
6472
6473 @node Index
6474 @unnumbered Index
6475
6476 @printindex cp
6477
6478 @contents
6479 @bye
6480 @c Local Variables:
6481 @c fill-column: 79
6482 @c End:
This page took 0.165957 seconds and 5 git commands to generate.