13d8817e4Smiod\input texinfo @c                               -*-Texinfo-*-
23d8817e4Smiod@c  Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
33d8817e4Smiod@c  2001, 2002, 2003, 2004, 2005
43d8817e4Smiod@c  Free Software Foundation, Inc.
53d8817e4Smiod@c UPDATE!!  On future updates--
63d8817e4Smiod@c   (1)   check for new machine-dep cmdline options in
73d8817e4Smiod@c         md_parse_option definitions in config/tc-*.c
83d8817e4Smiod@c   (2)   for platform-specific directives, examine md_pseudo_op
93d8817e4Smiod@c         in config/tc-*.c
103d8817e4Smiod@c   (3)   for object-format specific directives, examine obj_pseudo_op
113d8817e4Smiod@c         in config/obj-*.c
123d8817e4Smiod@c   (4)   portable directives in potable[] in read.c
133d8817e4Smiod@c %**start of header
143d8817e4Smiod@setfilename as.info
153d8817e4Smiod@c ---config---
163d8817e4Smiod@macro gcctabopt{body}
173d8817e4Smiod@code{\body\}
183d8817e4Smiod@end macro
193d8817e4Smiod@c defaults, config file may override:
203d8817e4Smiod@set have-stabs
213d8817e4Smiod@c ---
223d8817e4Smiod@c man begin NAME
233d8817e4Smiod@c ---
243d8817e4Smiod@include asconfig.texi
253d8817e4Smiod@include gasver.texi
263d8817e4Smiod@c ---
273d8817e4Smiod@c man end
283d8817e4Smiod@c ---
293d8817e4Smiod@c common OR combinations of conditions
303d8817e4Smiod@ifset COFF
313d8817e4Smiod@set COFF-ELF
323d8817e4Smiod@end ifset
333d8817e4Smiod@ifset ELF
343d8817e4Smiod@set COFF-ELF
353d8817e4Smiod@end ifset
363d8817e4Smiod@ifset AOUT
373d8817e4Smiod@set aout-bout
383d8817e4Smiod@end ifset
393d8817e4Smiod@ifset ARM/Thumb
403d8817e4Smiod@set ARM
413d8817e4Smiod@end ifset
423d8817e4Smiod@ifset BOUT
433d8817e4Smiod@set aout-bout
443d8817e4Smiod@end ifset
453d8817e4Smiod@ifset H8/300
463d8817e4Smiod@set H8
473d8817e4Smiod@end ifset
483d8817e4Smiod@ifset SH
493d8817e4Smiod@set H8
503d8817e4Smiod@end ifset
513d8817e4Smiod@ifset HPPA
523d8817e4Smiod@set abnormal-separator
533d8817e4Smiod@end ifset
543d8817e4Smiod@c ------------
553d8817e4Smiod@ifset GENERIC
563d8817e4Smiod@settitle Using @value{AS}
573d8817e4Smiod@end ifset
583d8817e4Smiod@ifclear GENERIC
593d8817e4Smiod@settitle Using @value{AS} (@value{TARGET})
603d8817e4Smiod@end ifclear
613d8817e4Smiod@setchapternewpage odd
623d8817e4Smiod@c %**end of header
633d8817e4Smiod
643d8817e4Smiod@c @smallbook
653d8817e4Smiod@c @set SMALL
663d8817e4Smiod@c WARE! Some of the machine-dependent sections contain tables of machine
673d8817e4Smiod@c instructions.  Except in multi-column format, these tables look silly.
683d8817e4Smiod@c Unfortunately, Texinfo doesn't have a general-purpose multi-col format, so
693d8817e4Smiod@c the multi-col format is faked within @example sections.
703d8817e4Smiod@c
713d8817e4Smiod@c Again unfortunately, the natural size that fits on a page, for these tables,
723d8817e4Smiod@c is different depending on whether or not smallbook is turned on.
733d8817e4Smiod@c This matters, because of order: text flow switches columns at each page
743d8817e4Smiod@c break.
753d8817e4Smiod@c
763d8817e4Smiod@c The format faked in this source works reasonably well for smallbook,
773d8817e4Smiod@c not well for the default large-page format.  This manual expects that if you
783d8817e4Smiod@c turn on @smallbook, you will also uncomment the "@set SMALL" to enable the
793d8817e4Smiod@c tables in question.  You can turn on one without the other at your
803d8817e4Smiod@c discretion, of course.
813d8817e4Smiod@ifinfo
823d8817e4Smiod@set SMALL
833d8817e4Smiod@c the insn tables look just as silly in info files regardless of smallbook,
843d8817e4Smiod@c might as well show 'em anyways.
853d8817e4Smiod@end ifinfo
863d8817e4Smiod
873d8817e4Smiod@ifinfo
883d8817e4Smiod@format
893d8817e4SmiodSTART-INFO-DIR-ENTRY
903d8817e4Smiod* As: (as).                     The GNU assembler.
913d8817e4Smiod* Gas: (as).                    The GNU assembler.
923d8817e4SmiodEND-INFO-DIR-ENTRY
933d8817e4Smiod@end format
943d8817e4Smiod@end ifinfo
953d8817e4Smiod
963d8817e4Smiod@finalout
973d8817e4Smiod@syncodeindex ky cp
983d8817e4Smiod
993d8817e4Smiod@ifinfo
1003d8817e4SmiodThis file documents the GNU Assembler "@value{AS}".
1013d8817e4Smiod
1023d8817e4Smiod@c man begin COPYRIGHT
1033d8817e4SmiodCopyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc.
1043d8817e4Smiod
1053d8817e4SmiodPermission is granted to copy, distribute and/or modify this document
1063d8817e4Smiodunder the terms of the GNU Free Documentation License, Version 1.1
1073d8817e4Smiodor any later version published by the Free Software Foundation;
1083d8817e4Smiodwith no Invariant Sections, with no Front-Cover Texts, and with no
1093d8817e4SmiodBack-Cover Texts.  A copy of the license is included in the
1103d8817e4Smiodsection entitled ``GNU Free Documentation License''.
1113d8817e4Smiod
1123d8817e4Smiod@c man end
1133d8817e4Smiod
1143d8817e4Smiod@ignore
1153d8817e4SmiodPermission is granted to process this file through Tex and print the
1163d8817e4Smiodresults, provided the printed document carries copying permission
1173d8817e4Smiodnotice identical to this one except for the removal of this paragraph
1183d8817e4Smiod(this paragraph not being relevant to the printed manual).
1193d8817e4Smiod
1203d8817e4Smiod@end ignore
1213d8817e4Smiod@end ifinfo
1223d8817e4Smiod
1233d8817e4Smiod@titlepage
1243d8817e4Smiod@title Using @value{AS}
1253d8817e4Smiod@subtitle The @sc{gnu} Assembler
1263d8817e4Smiod@ifclear GENERIC
1273d8817e4Smiod@subtitle for the @value{TARGET} family
1283d8817e4Smiod@end ifclear
1293d8817e4Smiod@sp 1
1303d8817e4Smiod@subtitle Version @value{VERSION}
1313d8817e4Smiod@sp 1
1323d8817e4Smiod@sp 13
1333d8817e4SmiodThe Free Software Foundation Inc.  thanks The Nice Computer
1343d8817e4SmiodCompany of Australia for loaning Dean Elsner to write the
1353d8817e4Smiodfirst (Vax) version of @command{as} for Project @sc{gnu}.
1363d8817e4SmiodThe proprietors, management and staff of TNCCA thank FSF for
1373d8817e4Smioddistracting the boss while they got some work
1383d8817e4Smioddone.
1393d8817e4Smiod@sp 3
1403d8817e4Smiod@author Dean Elsner, Jay Fenlason & friends
1413d8817e4Smiod@page
1423d8817e4Smiod@tex
1433d8817e4Smiod{\parskip=0pt
1443d8817e4Smiod\hfill {\it Using {\tt @value{AS}}}\par
1453d8817e4Smiod\hfill Edited by Cygnus Support\par
1463d8817e4Smiod}
1473d8817e4Smiod%"boxit" macro for figures:
1483d8817e4Smiod%Modified from Knuth's ``boxit'' macro from TeXbook (answer to exercise 21.3)
1493d8817e4Smiod\gdef\boxit#1#2{\vbox{\hrule\hbox{\vrule\kern3pt
1503d8817e4Smiod     \vbox{\parindent=0pt\parskip=0pt\hsize=#1\kern3pt\strut\hfil
1513d8817e4Smiod#2\hfil\strut\kern3pt}\kern3pt\vrule}\hrule}}%box with visible outline
1523d8817e4Smiod\gdef\ibox#1#2{\hbox to #1{#2\hfil}\kern8pt}% invisible box
1533d8817e4Smiod@end tex
1543d8817e4Smiod
1553d8817e4Smiod@vskip 0pt plus 1filll
1563d8817e4SmiodCopyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc.
1573d8817e4Smiod
1583d8817e4Smiod      Permission is granted to copy, distribute and/or modify this document
1593d8817e4Smiod      under the terms of the GNU Free Documentation License, Version 1.1
1603d8817e4Smiod      or any later version published by the Free Software Foundation;
1613d8817e4Smiod      with no Invariant Sections, with no Front-Cover Texts, and with no
1623d8817e4Smiod      Back-Cover Texts.  A copy of the license is included in the
1633d8817e4Smiod      section entitled ``GNU Free Documentation License''.
1643d8817e4Smiod
1653d8817e4Smiod@end titlepage
1663d8817e4Smiod
1673d8817e4Smiod@ifnottex
1683d8817e4Smiod@node Top
1693d8817e4Smiod@top Using @value{AS}
1703d8817e4Smiod
1713d8817e4SmiodThis file is a user guide to the @sc{gnu} assembler @command{@value{AS}} version
1723d8817e4Smiod@value{VERSION}.
1733d8817e4Smiod@ifclear GENERIC
1743d8817e4SmiodThis version of the file describes @command{@value{AS}} configured to generate
1753d8817e4Smiodcode for @value{TARGET} architectures.
1763d8817e4Smiod@end ifclear
1773d8817e4Smiod
1783d8817e4SmiodThis document is distributed under the terms of the GNU Free
1793d8817e4SmiodDocumentation License.  A copy of the license is included in the
1803d8817e4Smiodsection entitled ``GNU Free Documentation License''.
1813d8817e4Smiod
1823d8817e4Smiod@menu
1833d8817e4Smiod* Overview::                    Overview
1843d8817e4Smiod* Invoking::                    Command-Line Options
1853d8817e4Smiod* Syntax::                      Syntax
1863d8817e4Smiod* Sections::                    Sections and Relocation
1873d8817e4Smiod* Symbols::                     Symbols
1883d8817e4Smiod* Expressions::                 Expressions
1893d8817e4Smiod* Pseudo Ops::                  Assembler Directives
1903d8817e4Smiod* Machine Dependencies::        Machine Dependent Features
1913d8817e4Smiod* Reporting Bugs::              Reporting Bugs
1923d8817e4Smiod* Acknowledgements::            Who Did What
1933d8817e4Smiod* GNU Free Documentation License::  GNU Free Documentation License
1943d8817e4Smiod* Index::                       Index
1953d8817e4Smiod@end menu
1963d8817e4Smiod@end ifnottex
1973d8817e4Smiod
1983d8817e4Smiod@node Overview
1993d8817e4Smiod@chapter Overview
2003d8817e4Smiod@iftex
2013d8817e4SmiodThis manual is a user guide to the @sc{gnu} assembler @command{@value{AS}}.
2023d8817e4Smiod@ifclear GENERIC
2033d8817e4SmiodThis version of the manual describes @command{@value{AS}} configured to generate
2043d8817e4Smiodcode for @value{TARGET} architectures.
2053d8817e4Smiod@end ifclear
2063d8817e4Smiod@end iftex
2073d8817e4Smiod
2083d8817e4Smiod@cindex invocation summary
2093d8817e4Smiod@cindex option summary
2103d8817e4Smiod@cindex summary of options
2113d8817e4SmiodHere is a brief summary of how to invoke @command{@value{AS}}.  For details,
2123d8817e4Smiod@pxref{Invoking,,Command-Line Options}.
2133d8817e4Smiod
214513939efSschwarze@set as
215513939efSschwarze@c man title as the portable GNU assembler
2163d8817e4Smiod
2173d8817e4Smiod@ignore
2183d8817e4Smiod@c man begin SEEALSO
2193d8817e4Smiodgcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}.
2203d8817e4Smiod@c man end
2213d8817e4Smiod@end ignore
2223d8817e4Smiod
2233d8817e4Smiod@c We don't use deffn and friends for the following because they seem
2243d8817e4Smiod@c to be limited to one line for the header.
2253d8817e4Smiod@smallexample
2263d8817e4Smiod@c man begin SYNOPSIS
2273d8817e4Smiod@value{AS} [@b{-a}[@b{cdhlns}][=@var{file}]] [@b{--alternate}] [@b{-D}]
2283d8817e4Smiod [@b{--defsym} @var{sym}=@var{val}] [@b{-f}] [@b{-g}] [@b{--gstabs}]
2293d8817e4Smiod [@b{--gstabs+}] [@b{--gdwarf-2}] [@b{--help}] [@b{-I} @var{dir}] [@b{-J}]
2303d8817e4Smiod [@b{-K}] [@b{-L}] [@b{--listing-lhs-width}=@var{NUM}]
2313d8817e4Smiod [@b{--listing-lhs-width2}=@var{NUM}] [@b{--listing-rhs-width}=@var{NUM}]
2323d8817e4Smiod [@b{--listing-cont-lines}=@var{NUM}] [@b{--keep-locals}] [@b{-o}
2333d8817e4Smiod @var{objfile}] [@b{-R}] [@b{--reduce-memory-overheads}] [@b{--statistics}]
2343d8817e4Smiod [@b{-v}] [@b{-version}] [@b{--version}] [@b{-W}] [@b{--warn}]
2353d8817e4Smiod [@b{--fatal-warnings}] [@b{-w}] [@b{-x}] [@b{-Z}] [@b{@@@var{FILE}}]
2363d8817e4Smiod [@b{--target-help}] [@var{target-options}]
2373d8817e4Smiod [@b{--}|@var{files} @dots{}]
2383d8817e4Smiod@c
2393d8817e4Smiod@c Target dependent options are listed below.  Keep the list sorted.
2403d8817e4Smiod@c Add an empty line for separation.
2413d8817e4Smiod@ifset ALPHA
2423d8817e4Smiod
2433d8817e4Smiod@emph{Target Alpha options:}
2443d8817e4Smiod   [@b{-m@var{cpu}}]
2453d8817e4Smiod   [@b{-mdebug} | @b{-no-mdebug}]
2463d8817e4Smiod   [@b{-relax}] [@b{-g}] [@b{-G@var{size}}]
2473d8817e4Smiod   [@b{-F}] [@b{-32addr}]
2483d8817e4Smiod@end ifset
2493d8817e4Smiod@ifset ARC
2503d8817e4Smiod
2513d8817e4Smiod@emph{Target ARC options:}
2523d8817e4Smiod   [@b{-marc[5|6|7|8]}]
2533d8817e4Smiod   [@b{-EB}|@b{-EL}]
2543d8817e4Smiod@end ifset
2553d8817e4Smiod@ifset ARM
2563d8817e4Smiod
2573d8817e4Smiod@emph{Target ARM options:}
2583d8817e4Smiod@c Don't document the deprecated options
2593d8817e4Smiod   [@b{-mcpu}=@var{processor}[+@var{extension}@dots{}]]
2603d8817e4Smiod   [@b{-march}=@var{architecture}[+@var{extension}@dots{}]]
2613d8817e4Smiod   [@b{-mfpu}=@var{floating-point-format}]
2623d8817e4Smiod   [@b{-mfloat-abi}=@var{abi}]
2633d8817e4Smiod   [@b{-meabi}=@var{ver}]
2643d8817e4Smiod   [@b{-mthumb}]
2653d8817e4Smiod   [@b{-EB}|@b{-EL}]
2663d8817e4Smiod   [@b{-mapcs-32}|@b{-mapcs-26}|@b{-mapcs-float}|
2673d8817e4Smiod    @b{-mapcs-reentrant}]
2683d8817e4Smiod   [@b{-mthumb-interwork}] [@b{-k}]
2693d8817e4Smiod@end ifset
2703d8817e4Smiod@ifset CRIS
2713d8817e4Smiod
2723d8817e4Smiod@emph{Target CRIS options:}
2733d8817e4Smiod   [@b{--underscore} | @b{--no-underscore}]
2743d8817e4Smiod   [@b{--pic}] [@b{-N}]
2753d8817e4Smiod   [@b{--emulation=criself} | @b{--emulation=crisaout}]
2763d8817e4Smiod   [@b{--march=v0_v10} | @b{--march=v10} | @b{--march=v32} | @b{--march=common_v10_v32}]
2773d8817e4Smiod@c Deprecated -- deliberately not documented.
2783d8817e4Smiod@c [@b{-h}] [@b{-H}]
2793d8817e4Smiod@end ifset
2803d8817e4Smiod@ifset D10V
2813d8817e4Smiod
2823d8817e4Smiod@emph{Target D10V options:}
2833d8817e4Smiod   [@b{-O}]
2843d8817e4Smiod@end ifset
2853d8817e4Smiod@ifset D30V
2863d8817e4Smiod
2873d8817e4Smiod@emph{Target D30V options:}
2883d8817e4Smiod   [@b{-O}|@b{-n}|@b{-N}]
2893d8817e4Smiod@end ifset
2903d8817e4Smiod@ifset H8
2913d8817e4Smiod@c Renesas family chips have no machine-dependent assembler options
2923d8817e4Smiod@end ifset
2933d8817e4Smiod@ifset HPPA
2943d8817e4Smiod@c HPPA has no machine-dependent assembler options (yet).
2953d8817e4Smiod@end ifset
2963d8817e4Smiod@ifset I80386
2973d8817e4Smiod
2983d8817e4Smiod@emph{Target i386 options:}
2993d8817e4Smiod   [@b{--32}|@b{--64}] [@b{-n}]
3003d8817e4Smiod@end ifset
3013d8817e4Smiod@ifset I960
3023d8817e4Smiod
3033d8817e4Smiod@emph{Target i960 options:}
3043d8817e4Smiod@c see md_parse_option in tc-i960.c
3053d8817e4Smiod   [@b{-ACA}|@b{-ACA_A}|@b{-ACB}|@b{-ACC}|@b{-AKA}|@b{-AKB}|
3063d8817e4Smiod    @b{-AKC}|@b{-AMC}]
3073d8817e4Smiod   [@b{-b}] [@b{-no-relax}]
3083d8817e4Smiod@end ifset
3093d8817e4Smiod@ifset IA64
3103d8817e4Smiod
3113d8817e4Smiod@emph{Target IA-64 options:}
3123d8817e4Smiod   [@b{-mconstant-gp}|@b{-mauto-pic}]
3133d8817e4Smiod   [@b{-milp32}|@b{-milp64}|@b{-mlp64}|@b{-mp64}]
3143d8817e4Smiod   [@b{-mle}|@b{mbe}]
3153d8817e4Smiod   [@b{-mtune=itanium1}|@b{-mtune=itanium2}]
3163d8817e4Smiod   [@b{-munwind-check=warning}|@b{-munwind-check=error}]
3173d8817e4Smiod   [@b{-mhint.b=ok}|@b{-mhint.b=warning}|@b{-mhint.b=error}]
3183d8817e4Smiod   [@b{-x}|@b{-xexplicit}] [@b{-xauto}] [@b{-xdebug}]
3193d8817e4Smiod@end ifset
3203d8817e4Smiod@ifset IP2K
3213d8817e4Smiod
3223d8817e4Smiod@emph{Target IP2K options:}
3233d8817e4Smiod   [@b{-mip2022}|@b{-mip2022ext}]
3243d8817e4Smiod@end ifset
3253d8817e4Smiod@ifset M32C
3263d8817e4Smiod
3273d8817e4Smiod@emph{Target M32C options:}
3283d8817e4Smiod   [@b{-m32c}|@b{-m16c}]
3293d8817e4Smiod@end ifset
3303d8817e4Smiod@ifset M32R
3313d8817e4Smiod
3323d8817e4Smiod@emph{Target M32R options:}
3333d8817e4Smiod   [@b{--m32rx}|@b{--[no-]warn-explicit-parallel-conflicts}|
3343d8817e4Smiod   @b{--W[n]p}]
3353d8817e4Smiod@end ifset
3363d8817e4Smiod@ifset M680X0
3373d8817e4Smiod
3383d8817e4Smiod@emph{Target M680X0 options:}
3393d8817e4Smiod   [@b{-l}] [@b{-m68000}|@b{-m68010}|@b{-m68020}|@dots{}]
3403d8817e4Smiod@end ifset
3413d8817e4Smiod@ifset M68HC11
3423d8817e4Smiod
3433d8817e4Smiod@emph{Target M68HC11 options:}
3443d8817e4Smiod   [@b{-m68hc11}|@b{-m68hc12}|@b{-m68hcs12}]
3453d8817e4Smiod   [@b{-mshort}|@b{-mlong}]
3463d8817e4Smiod   [@b{-mshort-double}|@b{-mlong-double}]
3473d8817e4Smiod   [@b{--force-long-branchs}] [@b{--short-branchs}]
3483d8817e4Smiod   [@b{--strict-direct-mode}] [@b{--print-insn-syntax}]
3493d8817e4Smiod   [@b{--print-opcodes}] [@b{--generate-example}]
3503d8817e4Smiod@end ifset
3513d8817e4Smiod@ifset MCORE
3523d8817e4Smiod
3533d8817e4Smiod@emph{Target MCORE options:}
3543d8817e4Smiod   [@b{-jsri2bsr}] [@b{-sifilter}] [@b{-relax}]
3553d8817e4Smiod   [@b{-mcpu=[210|340]}]
3563d8817e4Smiod@end ifset
3573d8817e4Smiod@ifset MIPS
3583d8817e4Smiod
3593d8817e4Smiod@emph{Target MIPS options:}
3603d8817e4Smiod   [@b{-nocpp}] [@b{-EL}] [@b{-EB}] [@b{-O}[@var{optimization level}]]
3613d8817e4Smiod   [@b{-g}[@var{debug level}]] [@b{-G} @var{num}] [@b{-KPIC}] [@b{-call_shared}]
3623d8817e4Smiod   [@b{-non_shared}] [@b{-xgot}]
3633d8817e4Smiod   [@b{-mabi}=@var{ABI}] [@b{-32}] [@b{-n32}] [@b{-64}] [@b{-mfp32}] [@b{-mgp32}]
3643d8817e4Smiod   [@b{-march}=@var{CPU}] [@b{-mtune}=@var{CPU}] [@b{-mips1}] [@b{-mips2}]
3653d8817e4Smiod   [@b{-mips3}] [@b{-mips4}] [@b{-mips5}] [@b{-mips32}] [@b{-mips32r2}]
3663d8817e4Smiod   [@b{-mips64}] [@b{-mips64r2}]
3673d8817e4Smiod   [@b{-construct-floats}] [@b{-no-construct-floats}]
3683d8817e4Smiod   [@b{-trap}] [@b{-no-break}] [@b{-break}] [@b{-no-trap}]
3693d8817e4Smiod   [@b{-mfix7000}] [@b{-mno-fix7000}]
3703d8817e4Smiod   [@b{-mips16}] [@b{-no-mips16}]
3713d8817e4Smiod   [@b{-mips3d}] [@b{-no-mips3d}]
3723d8817e4Smiod   [@b{-mdmx}] [@b{-no-mdmx}]
3733d8817e4Smiod   [@b{-mdsp}] [@b{-mno-dsp}]
3743d8817e4Smiod   [@b{-mmt}] [@b{-mno-mt}]
3753d8817e4Smiod   [@b{-mdebug}] [@b{-no-mdebug}]
3763d8817e4Smiod   [@b{-mpdr}] [@b{-mno-pdr}]
3773d8817e4Smiod@end ifset
3783d8817e4Smiod@ifset MMIX
3793d8817e4Smiod
3803d8817e4Smiod@emph{Target MMIX options:}
3813d8817e4Smiod   [@b{--fixed-special-register-names}] [@b{--globalize-symbols}]
3823d8817e4Smiod   [@b{--gnu-syntax}] [@b{--relax}] [@b{--no-predefined-symbols}]
3833d8817e4Smiod   [@b{--no-expand}] [@b{--no-merge-gregs}] [@b{-x}]
3843d8817e4Smiod   [@b{--linker-allocated-gregs}]
3853d8817e4Smiod@end ifset
3863d8817e4Smiod@ifset PDP11
3873d8817e4Smiod
3883d8817e4Smiod@emph{Target PDP11 options:}
3893d8817e4Smiod   [@b{-mpic}|@b{-mno-pic}] [@b{-mall}] [@b{-mno-extensions}]
3903d8817e4Smiod   [@b{-m}@var{extension}|@b{-mno-}@var{extension}]
3913d8817e4Smiod   [@b{-m}@var{cpu}] [@b{-m}@var{machine}]
3923d8817e4Smiod@end ifset
3933d8817e4Smiod@ifset PJ
3943d8817e4Smiod
3953d8817e4Smiod@emph{Target picoJava options:}
3963d8817e4Smiod   [@b{-mb}|@b{-me}]
3973d8817e4Smiod@end ifset
3983d8817e4Smiod@ifset PPC
3993d8817e4Smiod
4003d8817e4Smiod@emph{Target PowerPC options:}
4013d8817e4Smiod   [@b{-mpwrx}|@b{-mpwr2}|@b{-mpwr}|@b{-m601}|@b{-mppc}|@b{-mppc32}|@b{-m603}|@b{-m604}|
4023d8817e4Smiod    @b{-m403}|@b{-m405}|@b{-mppc64}|@b{-m620}|@b{-mppc64bridge}|@b{-mbooke}|
4033d8817e4Smiod    @b{-mbooke32}|@b{-mbooke64}]
4043d8817e4Smiod   [@b{-mcom}|@b{-many}|@b{-maltivec}] [@b{-memb}]
4053d8817e4Smiod   [@b{-mregnames}|@b{-mno-regnames}]
4063d8817e4Smiod   [@b{-mrelocatable}|@b{-mrelocatable-lib}]
4073d8817e4Smiod   [@b{-mlittle}|@b{-mlittle-endian}|@b{-mbig}|@b{-mbig-endian}]
4083d8817e4Smiod   [@b{-msolaris}|@b{-mno-solaris}]
4093d8817e4Smiod@end ifset
4103d8817e4Smiod@ifset SPARC
4113d8817e4Smiod
4123d8817e4Smiod@emph{Target SPARC options:}
4133d8817e4Smiod@c The order here is important.  See c-sparc.texi.
4143d8817e4Smiod   [@b{-Av6}|@b{-Av7}|@b{-Av8}|@b{-Asparclet}|@b{-Asparclite}
4153d8817e4Smiod    @b{-Av8plus}|@b{-Av8plusa}|@b{-Av9}|@b{-Av9a}]
4163d8817e4Smiod   [@b{-xarch=v8plus}|@b{-xarch=v8plusa}] [@b{-bump}]
4173d8817e4Smiod   [@b{-32}|@b{-64}]
4183d8817e4Smiod@end ifset
4193d8817e4Smiod@ifset TIC54X
4203d8817e4Smiod
4213d8817e4Smiod@emph{Target TIC54X options:}
4223d8817e4Smiod [@b{-mcpu=54[123589]}|@b{-mcpu=54[56]lp}] [@b{-mfar-mode}|@b{-mf}]
4233d8817e4Smiod [@b{-merrors-to-file} @var{<filename>}|@b{-me} @var{<filename>}]
4243d8817e4Smiod@end ifset
4253d8817e4Smiod
4263d8817e4Smiod@ifset Z80
4273d8817e4Smiod
4283d8817e4Smiod@emph{Target Z80 options:}
4293d8817e4Smiod  [@b{-z80}] [@b{-r800}]
4303d8817e4Smiod  [@b{ -ignore-undocumented-instructions}] [@b{-Wnud}]
4313d8817e4Smiod  [@b{ -ignore-unportable-instructions}] [@b{-Wnup}]
4323d8817e4Smiod  [@b{ -warn-undocumented-instructions}] [@b{-Wud}]
4333d8817e4Smiod  [@b{ -warn-unportable-instructions}] [@b{-Wup}]
4343d8817e4Smiod  [@b{ -forbid-undocumented-instructions}] [@b{-Fud}]
4353d8817e4Smiod  [@b{ -forbid-unportable-instructions}] [@b{-Fup}]
4363d8817e4Smiod@end ifset
4373d8817e4Smiod
4383d8817e4Smiod@ifset Z8000
4393d8817e4Smiod@c Z8000 has no machine-dependent assembler options
4403d8817e4Smiod@end ifset
4413d8817e4Smiod@ifset XTENSA
4423d8817e4Smiod
4433d8817e4Smiod@emph{Target Xtensa options:}
4443d8817e4Smiod [@b{--[no-]text-section-literals}] [@b{--[no-]absolute-literals}]
4453d8817e4Smiod [@b{--[no-]target-align}] [@b{--[no-]longcalls}]
4463d8817e4Smiod [@b{--[no-]transform}]
4473d8817e4Smiod [@b{--rename-section} @var{oldname}=@var{newname}]
4483d8817e4Smiod@end ifset
4493d8817e4Smiod@c man end
4503d8817e4Smiod@end smallexample
4513d8817e4Smiod
4523d8817e4Smiod@c man begin OPTIONS
4533d8817e4Smiod
4543d8817e4Smiod@table @gcctabopt
4553d8817e4Smiod@include at-file.texi
4563d8817e4Smiod
4573d8817e4Smiod@item -a[cdhlmns]
4583d8817e4SmiodTurn on listings, in any of a variety of ways:
4593d8817e4Smiod
4603d8817e4Smiod@table @gcctabopt
4613d8817e4Smiod@item -ac
4623d8817e4Smiodomit false conditionals
4633d8817e4Smiod
4643d8817e4Smiod@item -ad
4653d8817e4Smiodomit debugging directives
4663d8817e4Smiod
4673d8817e4Smiod@item -ah
4683d8817e4Smiodinclude high-level source
4693d8817e4Smiod
4703d8817e4Smiod@item -al
4713d8817e4Smiodinclude assembly
4723d8817e4Smiod
4733d8817e4Smiod@item -am
4743d8817e4Smiodinclude macro expansions
4753d8817e4Smiod
4763d8817e4Smiod@item -an
4773d8817e4Smiodomit forms processing
4783d8817e4Smiod
4793d8817e4Smiod@item -as
4803d8817e4Smiodinclude symbols
4813d8817e4Smiod
4823d8817e4Smiod@item =file
4833d8817e4Smiodset the name of the listing file
4843d8817e4Smiod@end table
4853d8817e4Smiod
4863d8817e4SmiodYou may combine these options; for example, use @samp{-aln} for assembly
4873d8817e4Smiodlisting without forms processing.  The @samp{=file} option, if used, must be
4883d8817e4Smiodthe last one.  By itself, @samp{-a} defaults to @samp{-ahls}.
4893d8817e4Smiod
4903d8817e4Smiod@item --alternate
4913d8817e4SmiodBegin in alternate macro mode, see @ref{Altmacro,,@code{.altmacro}}.
4923d8817e4Smiod
4933d8817e4Smiod@item -D
4943d8817e4SmiodIgnored.  This option is accepted for script compatibility with calls to
4953d8817e4Smiodother assemblers.
4963d8817e4Smiod
4973d8817e4Smiod@item --defsym @var{sym}=@var{value}
4983d8817e4SmiodDefine the symbol @var{sym} to be @var{value} before assembling the input file.
4993d8817e4Smiod@var{value} must be an integer constant.  As in C, a leading @samp{0x}
5003d8817e4Smiodindicates a hexadecimal value, and a leading @samp{0} indicates an octal value.
5013d8817e4Smiod
5023d8817e4Smiod@item -f
5033d8817e4Smiod``fast''---skip whitespace and comment preprocessing (assume source is
5043d8817e4Smiodcompiler output).
5053d8817e4Smiod
5063d8817e4Smiod@item -g
5073d8817e4Smiod@itemx --gen-debug
5083d8817e4SmiodGenerate debugging information for each assembler source line using whichever
5093d8817e4Smioddebug format is preferred by the target.  This currently means either STABS,
5103d8817e4SmiodECOFF or DWARF2.
5113d8817e4Smiod
5123d8817e4Smiod@item --gstabs
5133d8817e4SmiodGenerate stabs debugging information for each assembler line.  This
5143d8817e4Smiodmay help debugging assembler code, if the debugger can handle it.
5153d8817e4Smiod
5163d8817e4Smiod@item --gstabs+
5173d8817e4SmiodGenerate stabs debugging information for each assembler line, with GNU
5183d8817e4Smiodextensions that probably only gdb can handle, and that could make other
5193d8817e4Smioddebuggers crash or refuse to read your program.  This
5203d8817e4Smiodmay help debugging assembler code.  Currently the only GNU extension is
5213d8817e4Smiodthe location of the current working directory at assembling time.
5223d8817e4Smiod
5233d8817e4Smiod@item --gdwarf-2
5243d8817e4SmiodGenerate DWARF2 debugging information for each assembler line.  This
5253d8817e4Smiodmay help debugging assembler code, if the debugger can handle it.  Note---this
5263d8817e4Smiodoption is only supported by some targets, not all of them.
5273d8817e4Smiod
5283d8817e4Smiod@item --help
5293d8817e4SmiodPrint a summary of the command line options and exit.
5303d8817e4Smiod
5313d8817e4Smiod@item --target-help
5323d8817e4SmiodPrint a summary of all target specific options and exit.
5333d8817e4Smiod
5343d8817e4Smiod@item -I @var{dir}
5353d8817e4SmiodAdd directory @var{dir} to the search list for @code{.include} directives.
5363d8817e4Smiod
5373d8817e4Smiod@item -J
5383d8817e4SmiodDon't warn about signed overflow.
5393d8817e4Smiod
5403d8817e4Smiod@item -K
5413d8817e4Smiod@ifclear DIFF-TBL-KLUGE
5423d8817e4SmiodThis option is accepted but has no effect on the @value{TARGET} family.
5433d8817e4Smiod@end ifclear
5443d8817e4Smiod@ifset DIFF-TBL-KLUGE
5453d8817e4SmiodIssue warnings when difference tables altered for long displacements.
5463d8817e4Smiod@end ifset
5473d8817e4Smiod
5483d8817e4Smiod@item -L
5493d8817e4Smiod@itemx --keep-locals
5503d8817e4SmiodKeep (in the symbol table) local symbols.  On traditional a.out systems
5513d8817e4Smiodthese start with @samp{L}, but different systems have different local
5523d8817e4Smiodlabel prefixes.
5533d8817e4Smiod
5543d8817e4Smiod@item --listing-lhs-width=@var{number}
5553d8817e4SmiodSet the maximum width, in words, of the output data column for an assembler
5563d8817e4Smiodlisting to @var{number}.
5573d8817e4Smiod
5583d8817e4Smiod@item --listing-lhs-width2=@var{number}
5593d8817e4SmiodSet the maximum width, in words, of the output data column for continuation
5603d8817e4Smiodlines in an assembler listing to @var{number}.
5613d8817e4Smiod
5623d8817e4Smiod@item --listing-rhs-width=@var{number}
5633d8817e4SmiodSet the maximum width of an input source line, as displayed in a listing, to
5643d8817e4Smiod@var{number} bytes.
5653d8817e4Smiod
5663d8817e4Smiod@item --listing-cont-lines=@var{number}
5673d8817e4SmiodSet the maximum number of lines printed in a listing for a single line of input
5683d8817e4Smiodto @var{number} + 1.
5693d8817e4Smiod
5703d8817e4Smiod@item -o @var{objfile}
5713d8817e4SmiodName the object-file output from @command{@value{AS}} @var{objfile}.
5723d8817e4Smiod
5733d8817e4Smiod@item -R
5743d8817e4SmiodFold the data section into the text section.
5753d8817e4Smiod
5763d8817e4Smiod@kindex --hash-size=@var{number}
5773d8817e4SmiodSet the default size of GAS's hash tables to a prime number close to
5783d8817e4Smiod@var{number}.  Increasing this value can reduce the length of time it takes the
5793d8817e4Smiodassembler to perform its tasks, at the expense of increasing the assembler's
5803d8817e4Smiodmemory requirements.  Similarly reducing this value can reduce the memory
5813d8817e4Smiodrequirements at the expense of speed.
5823d8817e4Smiod
5833d8817e4Smiod@item --reduce-memory-overheads
5843d8817e4SmiodThis option reduces GAS's memory requirements, at the expense of making the
5853d8817e4Smiodassembly processes slower.  Currently this switch is a synonym for
5863d8817e4Smiod@samp{--hash-size=4051}, but in the future it may have other effects as well.
5873d8817e4Smiod
5883d8817e4Smiod@item --statistics
5893d8817e4SmiodPrint the maximum space (in bytes) and total time (in seconds) used by
5903d8817e4Smiodassembly.
5913d8817e4Smiod
5923d8817e4Smiod@item --strip-local-absolute
5933d8817e4SmiodRemove local absolute symbols from the outgoing symbol table.
5943d8817e4Smiod
5953d8817e4Smiod@item -v
5963d8817e4Smiod@itemx -version
5973d8817e4SmiodPrint the @command{as} version.
5983d8817e4Smiod
5993d8817e4Smiod@item --version
6003d8817e4SmiodPrint the @command{as} version and exit.
6013d8817e4Smiod
6023d8817e4Smiod@item -W
6033d8817e4Smiod@itemx --no-warn
6043d8817e4SmiodSuppress warning messages.
6053d8817e4Smiod
6063d8817e4Smiod@item --fatal-warnings
6073d8817e4SmiodTreat warnings as errors.
6083d8817e4Smiod
6093d8817e4Smiod@item --warn
6103d8817e4SmiodDon't suppress warning messages or treat them as errors.
6113d8817e4Smiod
6123d8817e4Smiod@item -w
6133d8817e4SmiodIgnored.
6143d8817e4Smiod
6153d8817e4Smiod@item -x
6163d8817e4SmiodIgnored.
6173d8817e4Smiod
6183d8817e4Smiod@item -Z
6193d8817e4SmiodGenerate an object file even after errors.
6203d8817e4Smiod
6213d8817e4Smiod@item -- | @var{files} @dots{}
6223d8817e4SmiodStandard input, or source files to assemble.
6233d8817e4Smiod
6243d8817e4Smiod@end table
6253d8817e4Smiod
6263d8817e4Smiod@ifset ARC
6273d8817e4SmiodThe following options are available when @value{AS} is configured for
6283d8817e4Smiodan ARC processor.
6293d8817e4Smiod
6303d8817e4Smiod@table @gcctabopt
6313d8817e4Smiod@item -marc[5|6|7|8]
6323d8817e4SmiodThis option selects the core processor variant.
6333d8817e4Smiod@item -EB | -EL
6343d8817e4SmiodSelect either big-endian (-EB) or little-endian (-EL) output.
6353d8817e4Smiod@end table
6363d8817e4Smiod@end ifset
6373d8817e4Smiod
6383d8817e4Smiod@ifset ARM
6393d8817e4SmiodThe following options are available when @value{AS} is configured for the ARM
6403d8817e4Smiodprocessor family.
6413d8817e4Smiod
6423d8817e4Smiod@table @gcctabopt
6433d8817e4Smiod@item -mcpu=@var{processor}[+@var{extension}@dots{}]
6443d8817e4SmiodSpecify which ARM processor variant is the target.
6453d8817e4Smiod@item -march=@var{architecture}[+@var{extension}@dots{}]
6463d8817e4SmiodSpecify which ARM architecture variant is used by the target.
6473d8817e4Smiod@item -mfpu=@var{floating-point-format}
6483d8817e4SmiodSelect which Floating Point architecture is the target.
6493d8817e4Smiod@item -mfloat-abi=@var{abi}
6503d8817e4SmiodSelect which floating point ABI is in use.
6513d8817e4Smiod@item -mthumb
6523d8817e4SmiodEnable Thumb only instruction decoding.
6533d8817e4Smiod@item -mapcs-32 | -mapcs-26 | -mapcs-float | -mapcs-reentrant
6543d8817e4SmiodSelect which procedure calling convention is in use.
6553d8817e4Smiod@item -EB | -EL
6563d8817e4SmiodSelect either big-endian (-EB) or little-endian (-EL) output.
6573d8817e4Smiod@item -mthumb-interwork
6583d8817e4SmiodSpecify that the code has been generated with interworking between Thumb and
6593d8817e4SmiodARM code in mind.
6603d8817e4Smiod@item -k
6613d8817e4SmiodSpecify that PIC code has been generated.
6623d8817e4Smiod@end table
6633d8817e4Smiod@end ifset
6643d8817e4Smiod
6653d8817e4Smiod@ifset CRIS
6663d8817e4SmiodSee the info pages for documentation of the CRIS-specific options.
6673d8817e4Smiod@end ifset
6683d8817e4Smiod
6693d8817e4Smiod@ifset D10V
6703d8817e4SmiodThe following options are available when @value{AS} is configured for
6713d8817e4Smioda D10V processor.
6723d8817e4Smiod@table @gcctabopt
6733d8817e4Smiod@cindex D10V optimization
6743d8817e4Smiod@cindex optimization, D10V
6753d8817e4Smiod@item -O
6763d8817e4SmiodOptimize output by parallelizing instructions.
6773d8817e4Smiod@end table
6783d8817e4Smiod@end ifset
6793d8817e4Smiod
6803d8817e4Smiod@ifset D30V
6813d8817e4SmiodThe following options are available when @value{AS} is configured for a D30V
6823d8817e4Smiodprocessor.
6833d8817e4Smiod@table @gcctabopt
6843d8817e4Smiod@cindex D30V optimization
6853d8817e4Smiod@cindex optimization, D30V
6863d8817e4Smiod@item -O
6873d8817e4SmiodOptimize output by parallelizing instructions.
6883d8817e4Smiod
6893d8817e4Smiod@cindex D30V nops
6903d8817e4Smiod@item -n
6913d8817e4SmiodWarn when nops are generated.
6923d8817e4Smiod
6933d8817e4Smiod@cindex D30V nops after 32-bit multiply
6943d8817e4Smiod@item -N
6953d8817e4SmiodWarn when a nop after a 32-bit multiply instruction is generated.
6963d8817e4Smiod@end table
6973d8817e4Smiod@end ifset
6983d8817e4Smiod
6993d8817e4Smiod@ifset I960
7003d8817e4SmiodThe following options are available when @value{AS} is configured for the
7013d8817e4SmiodIntel 80960 processor.
7023d8817e4Smiod
7033d8817e4Smiod@table @gcctabopt
7043d8817e4Smiod@item -ACA | -ACA_A | -ACB | -ACC | -AKA | -AKB | -AKC | -AMC
7053d8817e4SmiodSpecify which variant of the 960 architecture is the target.
7063d8817e4Smiod
7073d8817e4Smiod@item -b
7083d8817e4SmiodAdd code to collect statistics about branches taken.
7093d8817e4Smiod
7103d8817e4Smiod@item -no-relax
7113d8817e4SmiodDo not alter compare-and-branch instructions for long displacements;
7123d8817e4Smioderror if necessary.
7133d8817e4Smiod
7143d8817e4Smiod@end table
7153d8817e4Smiod@end ifset
7163d8817e4Smiod
7173d8817e4Smiod@ifset IP2K
7183d8817e4SmiodThe following options are available when @value{AS} is configured for the
7193d8817e4SmiodUbicom IP2K series.
7203d8817e4Smiod
7213d8817e4Smiod@table @gcctabopt
7223d8817e4Smiod
7233d8817e4Smiod@item -mip2022ext
7243d8817e4SmiodSpecifies that the extended IP2022 instructions are allowed.
7253d8817e4Smiod
7263d8817e4Smiod@item -mip2022
7273d8817e4SmiodRestores the default behaviour, which restricts the permitted instructions to
7283d8817e4Smiodjust the basic IP2022 ones.
7293d8817e4Smiod
7303d8817e4Smiod@end table
7313d8817e4Smiod@end ifset
7323d8817e4Smiod
7333d8817e4Smiod@ifset M32C
7343d8817e4SmiodThe following options are available when @value{AS} is configured for the
7353d8817e4SmiodRenesas M32C and M16C processors.
7363d8817e4Smiod
7373d8817e4Smiod@table @gcctabopt
7383d8817e4Smiod
7393d8817e4Smiod@item -m32c
7403d8817e4SmiodAssemble M32C instructions.
7413d8817e4Smiod
7423d8817e4Smiod@item -m16c
7433d8817e4SmiodAssemble M16C instructions (the default).
7443d8817e4Smiod
7453d8817e4Smiod@end table
7463d8817e4Smiod@end ifset
7473d8817e4Smiod
7483d8817e4Smiod@ifset M32R
7493d8817e4SmiodThe following options are available when @value{AS} is configured for the
7503d8817e4SmiodRenesas M32R (formerly Mitsubishi M32R) series.
7513d8817e4Smiod
7523d8817e4Smiod@table @gcctabopt
7533d8817e4Smiod
7543d8817e4Smiod@item --m32rx
7553d8817e4SmiodSpecify which processor in the M32R family is the target.  The default
7563d8817e4Smiodis normally the M32R, but this option changes it to the M32RX.
7573d8817e4Smiod
7583d8817e4Smiod@item --warn-explicit-parallel-conflicts or --Wp
7593d8817e4SmiodProduce warning messages when questionable parallel constructs are
7603d8817e4Smiodencountered.
7613d8817e4Smiod
7623d8817e4Smiod@item --no-warn-explicit-parallel-conflicts or --Wnp
7633d8817e4SmiodDo not produce warning messages when questionable parallel constructs are
7643d8817e4Smiodencountered.
7653d8817e4Smiod
7663d8817e4Smiod@end table
7673d8817e4Smiod@end ifset
7683d8817e4Smiod
7693d8817e4Smiod@ifset M680X0
7703d8817e4SmiodThe following options are available when @value{AS} is configured for the
7713d8817e4SmiodMotorola 68000 series.
7723d8817e4Smiod
7733d8817e4Smiod@table @gcctabopt
7743d8817e4Smiod
7753d8817e4Smiod@item -l
7763d8817e4SmiodShorten references to undefined symbols, to one word instead of two.
7773d8817e4Smiod
7783d8817e4Smiod@item -m68000 | -m68008 | -m68010 | -m68020 | -m68030
7793d8817e4Smiod@itemx | -m68040 | -m68060 | -m68302 | -m68331 | -m68332
7803d8817e4Smiod@itemx | -m68333 | -m68340 | -mcpu32 | -m5200
7813d8817e4SmiodSpecify what processor in the 68000 family is the target.  The default
7823d8817e4Smiodis normally the 68020, but this can be changed at configuration time.
7833d8817e4Smiod
7843d8817e4Smiod@item -m68881 | -m68882 | -mno-68881 | -mno-68882
7853d8817e4SmiodThe target machine does (or does not) have a floating-point coprocessor.
7863d8817e4SmiodThe default is to assume a coprocessor for 68020, 68030, and cpu32.  Although
7873d8817e4Smiodthe basic 68000 is not compatible with the 68881, a combination of the
7883d8817e4Smiodtwo can be specified, since it's possible to do emulation of the
7893d8817e4Smiodcoprocessor instructions with the main processor.
7903d8817e4Smiod
7913d8817e4Smiod@item -m68851 | -mno-68851
7923d8817e4SmiodThe target machine does (or does not) have a memory-management
7933d8817e4Smiodunit coprocessor.  The default is to assume an MMU for 68020 and up.
7943d8817e4Smiod
7953d8817e4Smiod@end table
7963d8817e4Smiod@end ifset
7973d8817e4Smiod
7983d8817e4Smiod@ifset PDP11
7993d8817e4Smiod
8003d8817e4SmiodFor details about the PDP-11 machine dependent features options,
8013d8817e4Smiodsee @ref{PDP-11-Options}.
8023d8817e4Smiod
8033d8817e4Smiod@table @gcctabopt
8043d8817e4Smiod@item -mpic | -mno-pic
8053d8817e4SmiodGenerate position-independent (or position-dependent) code.  The
8063d8817e4Smioddefault is @option{-mpic}.
8073d8817e4Smiod
8083d8817e4Smiod@item -mall
8093d8817e4Smiod@itemx -mall-extensions
8103d8817e4SmiodEnable all instruction set extensions.  This is the default.
8113d8817e4Smiod
8123d8817e4Smiod@item -mno-extensions
8133d8817e4SmiodDisable all instruction set extensions.
8143d8817e4Smiod
8153d8817e4Smiod@item -m@var{extension} | -mno-@var{extension}
8163d8817e4SmiodEnable (or disable) a particular instruction set extension.
8173d8817e4Smiod
8183d8817e4Smiod@item -m@var{cpu}
8193d8817e4SmiodEnable the instruction set extensions supported by a particular CPU, and
8203d8817e4Smioddisable all other extensions.
8213d8817e4Smiod
8223d8817e4Smiod@item -m@var{machine}
8233d8817e4SmiodEnable the instruction set extensions supported by a particular machine
8243d8817e4Smiodmodel, and disable all other extensions.
8253d8817e4Smiod@end table
8263d8817e4Smiod
8273d8817e4Smiod@end ifset
8283d8817e4Smiod
8293d8817e4Smiod@ifset PJ
8303d8817e4SmiodThe following options are available when @value{AS} is configured for
8313d8817e4Smioda picoJava processor.
8323d8817e4Smiod
8333d8817e4Smiod@table @gcctabopt
8343d8817e4Smiod
8353d8817e4Smiod@cindex PJ endianness
8363d8817e4Smiod@cindex endianness, PJ
8373d8817e4Smiod@cindex big endian output, PJ
8383d8817e4Smiod@item -mb
8393d8817e4SmiodGenerate ``big endian'' format output.
8403d8817e4Smiod
8413d8817e4Smiod@cindex little endian output, PJ
8423d8817e4Smiod@item -ml
8433d8817e4SmiodGenerate ``little endian'' format output.
8443d8817e4Smiod
8453d8817e4Smiod@end table
8463d8817e4Smiod@end ifset
8473d8817e4Smiod
8483d8817e4Smiod@ifset M68HC11
8493d8817e4SmiodThe following options are available when @value{AS} is configured for the
8503d8817e4SmiodMotorola 68HC11 or 68HC12 series.
8513d8817e4Smiod
8523d8817e4Smiod@table @gcctabopt
8533d8817e4Smiod
8543d8817e4Smiod@item -m68hc11 | -m68hc12 | -m68hcs12
8553d8817e4SmiodSpecify what processor is the target.  The default is
8563d8817e4Smioddefined by the configuration option when building the assembler.
8573d8817e4Smiod
8583d8817e4Smiod@item -mshort
8593d8817e4SmiodSpecify to use the 16-bit integer ABI.
8603d8817e4Smiod
8613d8817e4Smiod@item -mlong
8623d8817e4SmiodSpecify to use the 32-bit integer ABI.
8633d8817e4Smiod
8643d8817e4Smiod@item -mshort-double
8653d8817e4SmiodSpecify to use the 32-bit double ABI.
8663d8817e4Smiod
8673d8817e4Smiod@item -mlong-double
8683d8817e4SmiodSpecify to use the 64-bit double ABI.
8693d8817e4Smiod
8703d8817e4Smiod@item --force-long-branchs
8713d8817e4SmiodRelative branches are turned into absolute ones. This concerns
8723d8817e4Smiodconditional branches, unconditional branches and branches to a
8733d8817e4Smiodsub routine.
8743d8817e4Smiod
8753d8817e4Smiod@item -S | --short-branchs
8763d8817e4SmiodDo not turn relative branchs into absolute ones
8773d8817e4Smiodwhen the offset is out of range.
8783d8817e4Smiod
8793d8817e4Smiod@item --strict-direct-mode
8803d8817e4SmiodDo not turn the direct addressing mode into extended addressing mode
8813d8817e4Smiodwhen the instruction does not support direct addressing mode.
8823d8817e4Smiod
8833d8817e4Smiod@item --print-insn-syntax
8843d8817e4SmiodPrint the syntax of instruction in case of error.
8853d8817e4Smiod
8863d8817e4Smiod@item --print-opcodes
8873d8817e4Smiodprint the list of instructions with syntax and then exit.
8883d8817e4Smiod
8893d8817e4Smiod@item --generate-example
8903d8817e4Smiodprint an example of instruction for each possible instruction and then exit.
8913d8817e4SmiodThis option is only useful for testing @command{@value{AS}}.
8923d8817e4Smiod
8933d8817e4Smiod@end table
8943d8817e4Smiod@end ifset
8953d8817e4Smiod
8963d8817e4Smiod@ifset SPARC
8973d8817e4SmiodThe following options are available when @command{@value{AS}} is configured
8983d8817e4Smiodfor the SPARC architecture:
8993d8817e4Smiod
9003d8817e4Smiod@table @gcctabopt
9013d8817e4Smiod@item -Av6 | -Av7 | -Av8 | -Asparclet | -Asparclite
9023d8817e4Smiod@itemx -Av8plus | -Av8plusa | -Av9 | -Av9a
9033d8817e4SmiodExplicitly select a variant of the SPARC architecture.
9043d8817e4Smiod
9053d8817e4Smiod@samp{-Av8plus} and @samp{-Av8plusa} select a 32 bit environment.
9063d8817e4Smiod@samp{-Av9} and @samp{-Av9a} select a 64 bit environment.
9073d8817e4Smiod
9083d8817e4Smiod@samp{-Av8plusa} and @samp{-Av9a} enable the SPARC V9 instruction set with
9093d8817e4SmiodUltraSPARC extensions.
9103d8817e4Smiod
9113d8817e4Smiod@item -xarch=v8plus | -xarch=v8plusa
9123d8817e4SmiodFor compatibility with the Solaris v9 assembler.  These options are
9133d8817e4Smiodequivalent to -Av8plus and -Av8plusa, respectively.
9143d8817e4Smiod
9153d8817e4Smiod@item -bump
9163d8817e4SmiodWarn when the assembler switches to another architecture.
9173d8817e4Smiod@end table
9183d8817e4Smiod@end ifset
9193d8817e4Smiod
9203d8817e4Smiod@ifset TIC54X
9213d8817e4SmiodThe following options are available when @value{AS} is configured for the 'c54x
9223d8817e4Smiodarchitecture.
9233d8817e4Smiod
9243d8817e4Smiod@table @gcctabopt
9253d8817e4Smiod@item -mfar-mode
9263d8817e4SmiodEnable extended addressing mode.  All addresses and relocations will assume
9273d8817e4Smiodextended addressing (usually 23 bits).
9283d8817e4Smiod@item -mcpu=@var{CPU_VERSION}
9293d8817e4SmiodSets the CPU version being compiled for.
9303d8817e4Smiod@item -merrors-to-file @var{FILENAME}
9313d8817e4SmiodRedirect error output to a file, for broken systems which don't support such
9323d8817e4Smiodbehaviour in the shell.
9333d8817e4Smiod@end table
9343d8817e4Smiod@end ifset
9353d8817e4Smiod
9363d8817e4Smiod@ifset MIPS
9373d8817e4SmiodThe following options are available when @value{AS} is configured for
9383d8817e4Smioda @sc{mips} processor.
9393d8817e4Smiod
9403d8817e4Smiod@table @gcctabopt
9413d8817e4Smiod@item -G @var{num}
9423d8817e4SmiodThis option sets the largest size of an object that can be referenced
9433d8817e4Smiodimplicitly with the @code{gp} register.  It is only accepted for targets that
9443d8817e4Smioduse ECOFF format, such as a DECstation running Ultrix.  The default value is 8.
9453d8817e4Smiod
9463d8817e4Smiod@cindex MIPS endianness
9473d8817e4Smiod@cindex endianness, MIPS
9483d8817e4Smiod@cindex big endian output, MIPS
9493d8817e4Smiod@item -EB
9503d8817e4SmiodGenerate ``big endian'' format output.
9513d8817e4Smiod
9523d8817e4Smiod@cindex little endian output, MIPS
9533d8817e4Smiod@item -EL
9543d8817e4SmiodGenerate ``little endian'' format output.
9553d8817e4Smiod
9563d8817e4Smiod@cindex MIPS ISA
9573d8817e4Smiod@item -mips1
9583d8817e4Smiod@itemx -mips2
9593d8817e4Smiod@itemx -mips3
9603d8817e4Smiod@itemx -mips4
9613d8817e4Smiod@itemx -mips5
9623d8817e4Smiod@itemx -mips32
9633d8817e4Smiod@itemx -mips32r2
9643d8817e4Smiod@itemx -mips64
9653d8817e4Smiod@itemx -mips64r2
9663d8817e4SmiodGenerate code for a particular @sc{mips} Instruction Set Architecture level.
9673d8817e4Smiod@samp{-mips1} is an alias for @samp{-march=r3000}, @samp{-mips2} is an
9683d8817e4Smiodalias for @samp{-march=r6000}, @samp{-mips3} is an alias for
9693d8817e4Smiod@samp{-march=r4000} and @samp{-mips4} is an alias for @samp{-march=r8000}.
9703d8817e4Smiod@samp{-mips5}, @samp{-mips32}, @samp{-mips32r2}, @samp{-mips64}, and
9713d8817e4Smiod@samp{-mips64r2}
9723d8817e4Smiodcorrespond to generic
9733d8817e4Smiod@samp{MIPS V}, @samp{MIPS32}, @samp{MIPS32 Release 2}, @samp{MIPS64},
9743d8817e4Smiodand @samp{MIPS64 Release 2}
9753d8817e4SmiodISA processors, respectively.
9763d8817e4Smiod
9773d8817e4Smiod@item -march=@var{CPU}
9783d8817e4SmiodGenerate code for a particular @sc{mips} cpu.
9793d8817e4Smiod
9803d8817e4Smiod@item -mtune=@var{cpu}
9813d8817e4SmiodSchedule and tune for a particular @sc{mips} cpu.
9823d8817e4Smiod
9833d8817e4Smiod@item -mfix7000
9843d8817e4Smiod@itemx -mno-fix7000
9853d8817e4SmiodCause nops to be inserted if the read of the destination register
9863d8817e4Smiodof an mfhi or mflo instruction occurs in the following two instructions.
9873d8817e4Smiod
9883d8817e4Smiod@item -mdebug
9893d8817e4Smiod@itemx -no-mdebug
9903d8817e4SmiodCause stabs-style debugging output to go into an ECOFF-style .mdebug
9913d8817e4Smiodsection instead of the standard ELF .stabs sections.
9923d8817e4Smiod
9933d8817e4Smiod@item -mpdr
9943d8817e4Smiod@itemx -mno-pdr
9953d8817e4SmiodControl generation of @code{.pdr} sections.
9963d8817e4Smiod
9973d8817e4Smiod@item -mgp32
9983d8817e4Smiod@itemx -mfp32
9993d8817e4SmiodThe register sizes are normally inferred from the ISA and ABI, but these
10003d8817e4Smiodflags force a certain group of registers to be treated as 32 bits wide at
10013d8817e4Smiodall times.  @samp{-mgp32} controls the size of general-purpose registers
10023d8817e4Smiodand @samp{-mfp32} controls the size of floating-point registers.
10033d8817e4Smiod
10043d8817e4Smiod@item -mips16
10053d8817e4Smiod@itemx -no-mips16
10063d8817e4SmiodGenerate code for the MIPS 16 processor.  This is equivalent to putting
10073d8817e4Smiod@code{.set mips16} at the start of the assembly file.  @samp{-no-mips16}
10083d8817e4Smiodturns off this option.
10093d8817e4Smiod
10103d8817e4Smiod@item -mips3d
10113d8817e4Smiod@itemx -no-mips3d
10123d8817e4SmiodGenerate code for the MIPS-3D Application Specific Extension.
10133d8817e4SmiodThis tells the assembler to accept MIPS-3D instructions.
10143d8817e4Smiod@samp{-no-mips3d} turns off this option.
10153d8817e4Smiod
10163d8817e4Smiod@item -mdmx
10173d8817e4Smiod@itemx -no-mdmx
10183d8817e4SmiodGenerate code for the MDMX Application Specific Extension.
10193d8817e4SmiodThis tells the assembler to accept MDMX instructions.
10203d8817e4Smiod@samp{-no-mdmx} turns off this option.
10213d8817e4Smiod
10223d8817e4Smiod@item -mdsp
10233d8817e4Smiod@itemx -mno-dsp
10243d8817e4SmiodGenerate code for the DSP Application Specific Extension.
10253d8817e4SmiodThis tells the assembler to accept DSP instructions.
10263d8817e4Smiod@samp{-mno-dsp} turns off this option.
10273d8817e4Smiod
10283d8817e4Smiod@item -mmt
10293d8817e4Smiod@itemx -mno-mt
10303d8817e4SmiodGenerate code for the MT Application Specific Extension.
10313d8817e4SmiodThis tells the assembler to accept MT instructions.
10323d8817e4Smiod@samp{-mno-mt} turns off this option.
10333d8817e4Smiod
10343d8817e4Smiod@item --construct-floats
10353d8817e4Smiod@itemx --no-construct-floats
10363d8817e4SmiodThe @samp{--no-construct-floats} option disables the construction of
10373d8817e4Smioddouble width floating point constants by loading the two halves of the
10383d8817e4Smiodvalue into the two single width floating point registers that make up
10393d8817e4Smiodthe double width register.  By default @samp{--construct-floats} is
10403d8817e4Smiodselected, allowing construction of these floating point constants.
10413d8817e4Smiod
10423d8817e4Smiod@cindex emulation
10433d8817e4Smiod@item --emulation=@var{name}
10443d8817e4SmiodThis option causes @command{@value{AS}} to emulate @command{@value{AS}} configured
10453d8817e4Smiodfor some other target, in all respects, including output format (choosing
10463d8817e4Smiodbetween ELF and ECOFF only), handling of pseudo-opcodes which may generate
10473d8817e4Smioddebugging information or store symbol table information, and default
10483d8817e4Smiodendianness.  The available configuration names are: @samp{mipsecoff},
10493d8817e4Smiod@samp{mipself}, @samp{mipslecoff}, @samp{mipsbecoff}, @samp{mipslelf},
10503d8817e4Smiod@samp{mipsbelf}.  The first two do not alter the default endianness from that
10513d8817e4Smiodof the primary target for which the assembler was configured; the others change
10523d8817e4Smiodthe default to little- or big-endian as indicated by the @samp{b} or @samp{l}
10533d8817e4Smiodin the name.  Using @samp{-EB} or @samp{-EL} will override the endianness
10543d8817e4Smiodselection in any case.
10553d8817e4Smiod
10563d8817e4SmiodThis option is currently supported only when the primary target
10573d8817e4Smiod@command{@value{AS}} is configured for is a @sc{mips} ELF or ECOFF target.
10583d8817e4SmiodFurthermore, the primary target or others specified with
10593d8817e4Smiod@samp{--enable-targets=@dots{}} at configuration time must include support for
10603d8817e4Smiodthe other format, if both are to be available.  For example, the Irix 5
10613d8817e4Smiodconfiguration includes support for both.
10623d8817e4Smiod
10633d8817e4SmiodEventually, this option will support more configurations, with more
10643d8817e4Smiodfine-grained control over the assembler's behavior, and will be supported for
10653d8817e4Smiodmore processors.
10663d8817e4Smiod
10673d8817e4Smiod@item -nocpp
10683d8817e4Smiod@command{@value{AS}} ignores this option.  It is accepted for compatibility with
10693d8817e4Smiodthe native tools.
10703d8817e4Smiod
10713d8817e4Smiod@item --trap
10723d8817e4Smiod@itemx --no-trap
10733d8817e4Smiod@itemx --break
10743d8817e4Smiod@itemx --no-break
10753d8817e4SmiodControl how to deal with multiplication overflow and division by zero.
10763d8817e4Smiod@samp{--trap} or @samp{--no-break} (which are synonyms) take a trap exception
10773d8817e4Smiod(and only work for Instruction Set Architecture level 2 and higher);
10783d8817e4Smiod@samp{--break} or @samp{--no-trap} (also synonyms, and the default) take a
10793d8817e4Smiodbreak exception.
10803d8817e4Smiod
10813d8817e4Smiod@item -n
10823d8817e4SmiodWhen this option is used, @command{@value{AS}} will issue a warning every
10833d8817e4Smiodtime it generates a nop instruction from a macro.
10843d8817e4Smiod@end table
10853d8817e4Smiod@end ifset
10863d8817e4Smiod
10873d8817e4Smiod@ifset MCORE
10883d8817e4SmiodThe following options are available when @value{AS} is configured for
10893d8817e4Smiodan MCore processor.
10903d8817e4Smiod
10913d8817e4Smiod@table @gcctabopt
10923d8817e4Smiod@item -jsri2bsr
10933d8817e4Smiod@itemx -nojsri2bsr
10943d8817e4SmiodEnable or disable the JSRI to BSR transformation.  By default this is enabled.
10953d8817e4SmiodThe command line option @samp{-nojsri2bsr} can be used to disable it.
10963d8817e4Smiod
10973d8817e4Smiod@item -sifilter
10983d8817e4Smiod@itemx -nosifilter
10993d8817e4SmiodEnable or disable the silicon filter behaviour.  By default this is disabled.
11003d8817e4SmiodThe default can be overridden by the @samp{-sifilter} command line option.
11013d8817e4Smiod
11023d8817e4Smiod@item -relax
11033d8817e4SmiodAlter jump instructions for long displacements.
11043d8817e4Smiod
11053d8817e4Smiod@item -mcpu=[210|340]
11063d8817e4SmiodSelect the cpu type on the target hardware.  This controls which instructions
11073d8817e4Smiodcan be assembled.
11083d8817e4Smiod
11093d8817e4Smiod@item -EB
11103d8817e4SmiodAssemble for a big endian target.
11113d8817e4Smiod
11123d8817e4Smiod@item -EL
11133d8817e4SmiodAssemble for a little endian target.
11143d8817e4Smiod
11153d8817e4Smiod@end table
11163d8817e4Smiod@end ifset
11173d8817e4Smiod
11183d8817e4Smiod@ifset MMIX
11193d8817e4SmiodSee the info pages for documentation of the MMIX-specific options.
11203d8817e4Smiod@end ifset
11213d8817e4Smiod
11223d8817e4Smiod@ifset XTENSA
11233d8817e4SmiodThe following options are available when @value{AS} is configured for
11243d8817e4Smiodan Xtensa processor.
11253d8817e4Smiod
11263d8817e4Smiod@table @gcctabopt
11273d8817e4Smiod@item --text-section-literals | --no-text-section-literals
11283d8817e4SmiodWith @option{--text-@-section-@-literals}, literal pools are interspersed
11293d8817e4Smiodin the text section.  The default is
11303d8817e4Smiod@option{--no-@-text-@-section-@-literals}, which places literals in a
11313d8817e4Smiodseparate section in the output file.  These options only affect literals
11323d8817e4Smiodreferenced via PC-relative @code{L32R} instructions; literals for
11333d8817e4Smiodabsolute mode @code{L32R} instructions are handled separately.
11343d8817e4Smiod
11353d8817e4Smiod@item --absolute-literals | --no-absolute-literals
11363d8817e4SmiodIndicate to the assembler whether @code{L32R} instructions use absolute
11373d8817e4Smiodor PC-relative addressing.  The default is to assume absolute addressing
11383d8817e4Smiodif the Xtensa processor includes the absolute @code{L32R} addressing
11393d8817e4Smiodoption.  Otherwise, only the PC-relative @code{L32R} mode can be used.
11403d8817e4Smiod
11413d8817e4Smiod@item --target-align | --no-target-align
11423d8817e4SmiodEnable or disable automatic alignment to reduce branch penalties at the
11433d8817e4Smiodexpense of some code density.  The default is @option{--target-@-align}.
11443d8817e4Smiod
11453d8817e4Smiod@item --longcalls | --no-longcalls
11463d8817e4SmiodEnable or disable transformation of call instructions to allow calls
11473d8817e4Smiodacross a greater range of addresses.  The default is
11483d8817e4Smiod@option{--no-@-longcalls}.
11493d8817e4Smiod
11503d8817e4Smiod@item --transform | --no-transform
11513d8817e4SmiodEnable or disable all assembler transformations of Xtensa instructions.
11523d8817e4SmiodThe default is @option{--transform};
11533d8817e4Smiod@option{--no-transform} should be used only in the rare cases when the
11543d8817e4Smiodinstructions must be exactly as specified in the assembly source.
11553d8817e4Smiod@end table
11563d8817e4Smiod@end ifset
11573d8817e4Smiod
11583d8817e4Smiod@ifset Z80
11593d8817e4SmiodThe following options are available when @value{AS} is configured for
11603d8817e4Smioda Z80 family processor.
11613d8817e4Smiod@table @gcctabopt
11623d8817e4Smiod@item -z80
11633d8817e4SmiodAssemble for Z80 processor.
11643d8817e4Smiod@item -r800
11653d8817e4SmiodAssemble for R800 processor.
11663d8817e4Smiod@item  -ignore-undocumented-instructions
11673d8817e4Smiod@itemx -Wnud
11683d8817e4SmiodAssemble undocumented Z80 instructions that also work on R800 without warning.
11693d8817e4Smiod@item  -ignore-unportable-instructions
11703d8817e4Smiod@itemx -Wnup
11713d8817e4SmiodAssemble all undocumented Z80 instructions without warning.
11723d8817e4Smiod@item  -warn-undocumented-instructions
11733d8817e4Smiod@itemx -Wud
11743d8817e4SmiodIssue a warning for undocumented Z80 instructions that also work on R800.
11753d8817e4Smiod@item  -warn-unportable-instructions
11763d8817e4Smiod@itemx -Wup
11773d8817e4SmiodIssue a warning for undocumented Z80 instructions that do notwork on R800.
11783d8817e4Smiod@item  -forbid-undocumented-instructions
11793d8817e4Smiod@itemx -Fud
11803d8817e4SmiodTreat all undocumented instructions as errors.
11813d8817e4Smiod@item  -forbid-unportable-instructions
11823d8817e4Smiod@itemx -Fup
11833d8817e4SmiodTreat undocumented Z80 intructions that do notwork on R800 as errors.
11843d8817e4Smiod@end table
11853d8817e4Smiod@end ifset
11863d8817e4Smiod
11873d8817e4Smiod@c man end
11883d8817e4Smiod
11893d8817e4Smiod@menu
11903d8817e4Smiod* Manual::                      Structure of this Manual
11913d8817e4Smiod* GNU Assembler::               The GNU Assembler
11923d8817e4Smiod* Object Formats::              Object File Formats
11933d8817e4Smiod* Command Line::                Command Line
11943d8817e4Smiod* Input Files::                 Input Files
11953d8817e4Smiod* Object::                      Output (Object) File
11963d8817e4Smiod* Errors::                      Error and Warning Messages
11973d8817e4Smiod@end menu
11983d8817e4Smiod
11993d8817e4Smiod@node Manual
12003d8817e4Smiod@section Structure of this Manual
12013d8817e4Smiod
12023d8817e4Smiod@cindex manual, structure and purpose
12033d8817e4SmiodThis manual is intended to describe what you need to know to use
12043d8817e4Smiod@sc{gnu} @command{@value{AS}}.  We cover the syntax expected in source files, including
12053d8817e4Smiodnotation for symbols, constants, and expressions; the directives that
12063d8817e4Smiod@command{@value{AS}} understands; and of course how to invoke @command{@value{AS}}.
12073d8817e4Smiod
12083d8817e4Smiod@ifclear GENERIC
12093d8817e4SmiodWe also cover special features in the @value{TARGET}
12103d8817e4Smiodconfiguration of @command{@value{AS}}, including assembler directives.
12113d8817e4Smiod@end ifclear
12123d8817e4Smiod@ifset GENERIC
12133d8817e4SmiodThis manual also describes some of the machine-dependent features of
12143d8817e4Smiodvarious flavors of the assembler.
12153d8817e4Smiod@end ifset
12163d8817e4Smiod
12173d8817e4Smiod@cindex machine instructions (not covered)
12183d8817e4SmiodOn the other hand, this manual is @emph{not} intended as an introduction
12193d8817e4Smiodto programming in assembly language---let alone programming in general!
12203d8817e4SmiodIn a similar vein, we make no attempt to introduce the machine
12213d8817e4Smiodarchitecture; we do @emph{not} describe the instruction set, standard
12223d8817e4Smiodmnemonics, registers or addressing modes that are standard to a
12233d8817e4Smiodparticular architecture.
12243d8817e4Smiod@ifset GENERIC
12253d8817e4SmiodYou may want to consult the manufacturer's
12263d8817e4Smiodmachine architecture manual for this information.
12273d8817e4Smiod@end ifset
12283d8817e4Smiod@ifclear GENERIC
12293d8817e4Smiod@ifset H8/300
12303d8817e4SmiodFor information on the H8/300 machine instruction set, see @cite{H8/300
12313d8817e4SmiodSeries Programming Manual}.  For the H8/300H, see @cite{H8/300H Series
12323d8817e4SmiodProgramming Manual} (Renesas).
12333d8817e4Smiod@end ifset
12343d8817e4Smiod@ifset SH
12353d8817e4SmiodFor information on the Renesas (formerly Hitachi) / SuperH SH machine instruction set,
12363d8817e4Smiodsee @cite{SH-Microcomputer User's Manual} (Renesas) or
12373d8817e4Smiod@cite{SH-4 32-bit CPU Core Architecture} (SuperH) and
12383d8817e4Smiod@cite{SuperH (SH) 64-Bit RISC Series} (SuperH).
12393d8817e4Smiod@end ifset
12403d8817e4Smiod@ifset Z8000
12413d8817e4SmiodFor information on the Z8000 machine instruction set, see @cite{Z8000 CPU Technical Manual}
12423d8817e4Smiod@end ifset
12433d8817e4Smiod@end ifclear
12443d8817e4Smiod
12453d8817e4Smiod@c I think this is premature---doc@cygnus.com, 17jan1991
12463d8817e4Smiod@ignore
12473d8817e4SmiodThroughout this manual, we assume that you are running @dfn{GNU},
12483d8817e4Smiodthe portable operating system from the @dfn{Free Software
12493d8817e4SmiodFoundation, Inc.}.  This restricts our attention to certain kinds of
12503d8817e4Smiodcomputer (in particular, the kinds of computers that @sc{gnu} can run on);
12513d8817e4Smiodonce this assumption is granted examples and definitions need less
12523d8817e4Smiodqualification.
12533d8817e4Smiod
12543d8817e4Smiod@command{@value{AS}} is part of a team of programs that turn a high-level
12553d8817e4Smiodhuman-readable series of instructions into a low-level
12563d8817e4Smiodcomputer-readable series of instructions.  Different versions of
12573d8817e4Smiod@command{@value{AS}} are used for different kinds of computer.
12583d8817e4Smiod@end ignore
12593d8817e4Smiod
12603d8817e4Smiod@c There used to be a section "Terminology" here, which defined
12613d8817e4Smiod@c "contents", "byte", "word", and "long".  Defining "word" to any
12623d8817e4Smiod@c particular size is confusing when the .word directive may generate 16
12633d8817e4Smiod@c bits on one machine and 32 bits on another; in general, for the user
12643d8817e4Smiod@c version of this manual, none of these terms seem essential to define.
12653d8817e4Smiod@c They were used very little even in the former draft of the manual;
12663d8817e4Smiod@c this draft makes an effort to avoid them (except in names of
12673d8817e4Smiod@c directives).
12683d8817e4Smiod
12693d8817e4Smiod@node GNU Assembler
12703d8817e4Smiod@section The GNU Assembler
12713d8817e4Smiod
12723d8817e4Smiod@c man begin DESCRIPTION
12733d8817e4Smiod
12743d8817e4Smiod@sc{gnu} @command{as} is really a family of assemblers.
12753d8817e4Smiod@ifclear GENERIC
12763d8817e4SmiodThis manual describes @command{@value{AS}}, a member of that family which is
12773d8817e4Smiodconfigured for the @value{TARGET} architectures.
12783d8817e4Smiod@end ifclear
12793d8817e4SmiodIf you use (or have used) the @sc{gnu} assembler on one architecture, you
12803d8817e4Smiodshould find a fairly similar environment when you use it on another
12813d8817e4Smiodarchitecture.  Each version has much in common with the others,
12823d8817e4Smiodincluding object file formats, most assembler directives (often called
12833d8817e4Smiod@dfn{pseudo-ops}) and assembler syntax.@refill
12843d8817e4Smiod
12853d8817e4Smiod@cindex purpose of @sc{gnu} assembler
12863d8817e4Smiod@command{@value{AS}} is primarily intended to assemble the output of the
12873d8817e4Smiod@sc{gnu} C compiler @code{@value{GCC}} for use by the linker
12883d8817e4Smiod@code{@value{LD}}.  Nevertheless, we've tried to make @command{@value{AS}}
12893d8817e4Smiodassemble correctly everything that other assemblers for the same
12903d8817e4Smiodmachine would assemble.
12913d8817e4Smiod@ifset VAX
12923d8817e4SmiodAny exceptions are documented explicitly (@pxref{Machine Dependencies}).
12933d8817e4Smiod@end ifset
12943d8817e4Smiod@ifset M680X0
12953d8817e4Smiod@c This remark should appear in generic version of manual; assumption
12963d8817e4Smiod@c here is that generic version sets M680x0.
12973d8817e4SmiodThis doesn't mean @command{@value{AS}} always uses the same syntax as another
12983d8817e4Smiodassembler for the same architecture; for example, we know of several
12993d8817e4Smiodincompatible versions of 680x0 assembly language syntax.
13003d8817e4Smiod@end ifset
13013d8817e4Smiod
13023d8817e4Smiod@c man end
13033d8817e4Smiod
13043d8817e4SmiodUnlike older assemblers, @command{@value{AS}} is designed to assemble a source
13053d8817e4Smiodprogram in one pass of the source file.  This has a subtle impact on the
13063d8817e4Smiod@kbd{.org} directive (@pxref{Org,,@code{.org}}).
13073d8817e4Smiod
13083d8817e4Smiod@node Object Formats
13093d8817e4Smiod@section Object File Formats
13103d8817e4Smiod
13113d8817e4Smiod@cindex object file format
13123d8817e4SmiodThe @sc{gnu} assembler can be configured to produce several alternative
13133d8817e4Smiodobject file formats.  For the most part, this does not affect how you
13143d8817e4Smiodwrite assembly language programs; but directives for debugging symbols
13153d8817e4Smiodare typically different in different file formats.  @xref{Symbol
13163d8817e4SmiodAttributes,,Symbol Attributes}.
13173d8817e4Smiod@ifclear GENERIC
13183d8817e4Smiod@ifclear MULTI-OBJ
13193d8817e4SmiodFor the @value{TARGET} target, @command{@value{AS}} is configured to produce
13203d8817e4Smiod@value{OBJ-NAME} format object files.
13213d8817e4Smiod@end ifclear
13223d8817e4Smiod@c The following should exhaust all configs that set MULTI-OBJ, ideally
13233d8817e4Smiod@ifset I960
13243d8817e4SmiodOn the @value{TARGET}, @command{@value{AS}} can be configured to produce either
13253d8817e4Smiod@code{b.out} or COFF format object files.
13263d8817e4Smiod@end ifset
13273d8817e4Smiod@ifset HPPA
13283d8817e4SmiodOn the @value{TARGET}, @command{@value{AS}} can be configured to produce either
13293d8817e4SmiodSOM or ELF format object files.
13303d8817e4Smiod@end ifset
13313d8817e4Smiod@end ifclear
13323d8817e4Smiod
13333d8817e4Smiod@node Command Line
13343d8817e4Smiod@section Command Line
13353d8817e4Smiod
13363d8817e4Smiod@cindex command line conventions
13373d8817e4Smiod
13383d8817e4SmiodAfter the program name @command{@value{AS}}, the command line may contain
13393d8817e4Smiodoptions and file names.  Options may appear in any order, and may be
13403d8817e4Smiodbefore, after, or between file names.  The order of file names is
13413d8817e4Smiodsignificant.
13423d8817e4Smiod
13433d8817e4Smiod@cindex standard input, as input file
13443d8817e4Smiod@kindex --
13453d8817e4Smiod@file{--} (two hyphens) by itself names the standard input file
13463d8817e4Smiodexplicitly, as one of the files for @command{@value{AS}} to assemble.
13473d8817e4Smiod
13483d8817e4Smiod@cindex options, command line
13493d8817e4SmiodExcept for @samp{--} any command line argument that begins with a
13503d8817e4Smiodhyphen (@samp{-}) is an option.  Each option changes the behavior of
13513d8817e4Smiod@command{@value{AS}}.  No option changes the way another option works.  An
13523d8817e4Smiodoption is a @samp{-} followed by one or more letters; the case of
13533d8817e4Smiodthe letter is important.   All options are optional.
13543d8817e4Smiod
13553d8817e4SmiodSome options expect exactly one file name to follow them.  The file
13563d8817e4Smiodname may either immediately follow the option's letter (compatible
13573d8817e4Smiodwith older assemblers) or it may be the next command argument (@sc{gnu}
13583d8817e4Smiodstandard).  These two command lines are equivalent:
13593d8817e4Smiod
13603d8817e4Smiod@smallexample
13613d8817e4Smiod@value{AS} -o my-object-file.o mumble.s
13623d8817e4Smiod@value{AS} -omy-object-file.o mumble.s
13633d8817e4Smiod@end smallexample
13643d8817e4Smiod
13653d8817e4Smiod@node Input Files
13663d8817e4Smiod@section Input Files
13673d8817e4Smiod
13683d8817e4Smiod@cindex input
13693d8817e4Smiod@cindex source program
13703d8817e4Smiod@cindex files, input
13713d8817e4SmiodWe use the phrase @dfn{source program}, abbreviated @dfn{source}, to
13723d8817e4Smioddescribe the program input to one run of @command{@value{AS}}.  The program may
13733d8817e4Smiodbe in one or more files; how the source is partitioned into files
13743d8817e4Smioddoesn't change the meaning of the source.
13753d8817e4Smiod
13763d8817e4Smiod@c I added "con" prefix to "catenation" just to prove I can overcome my
13773d8817e4Smiod@c APL training...   doc@cygnus.com
13783d8817e4SmiodThe source program is a concatenation of the text in all the files, in the
13793d8817e4Smiodorder specified.
13803d8817e4Smiod
13813d8817e4Smiod@c man begin DESCRIPTION
13823d8817e4SmiodEach time you run @command{@value{AS}} it assembles exactly one source
13833d8817e4Smiodprogram.  The source program is made up of one or more files.
13843d8817e4Smiod(The standard input is also a file.)
13853d8817e4Smiod
13863d8817e4SmiodYou give @command{@value{AS}} a command line that has zero or more input file
13873d8817e4Smiodnames.  The input files are read (from left file name to right).  A
13883d8817e4Smiodcommand line argument (in any position) that has no special meaning
13893d8817e4Smiodis taken to be an input file name.
13903d8817e4Smiod
13913d8817e4SmiodIf you give @command{@value{AS}} no file names it attempts to read one input file
13923d8817e4Smiodfrom the @command{@value{AS}} standard input, which is normally your terminal.  You
13933d8817e4Smiodmay have to type @key{ctl-D} to tell @command{@value{AS}} there is no more program
13943d8817e4Smiodto assemble.
13953d8817e4Smiod
13963d8817e4SmiodUse @samp{--} if you need to explicitly name the standard input file
13973d8817e4Smiodin your command line.
13983d8817e4Smiod
13993d8817e4SmiodIf the source is empty, @command{@value{AS}} produces a small, empty object
14003d8817e4Smiodfile.
14013d8817e4Smiod
14023d8817e4Smiod@c man end
14033d8817e4Smiod
14043d8817e4Smiod@subheading Filenames and Line-numbers
14053d8817e4Smiod
14063d8817e4Smiod@cindex input file linenumbers
14073d8817e4Smiod@cindex line numbers, in input files
14083d8817e4SmiodThere are two ways of locating a line in the input file (or files) and
14093d8817e4Smiodeither may be used in reporting error messages.  One way refers to a line
14103d8817e4Smiodnumber in a physical file; the other refers to a line number in a
14113d8817e4Smiod``logical'' file.  @xref{Errors, ,Error and Warning Messages}.
14123d8817e4Smiod
14133d8817e4Smiod@dfn{Physical files} are those files named in the command line given
14143d8817e4Smiodto @command{@value{AS}}.
14153d8817e4Smiod
14163d8817e4Smiod@dfn{Logical files} are simply names declared explicitly by assembler
14173d8817e4Smioddirectives; they bear no relation to physical files.  Logical file names help
14183d8817e4Smioderror messages reflect the original source file, when @command{@value{AS}} source
14193d8817e4Smiodis itself synthesized from other files.  @command{@value{AS}} understands the
14203d8817e4Smiod@samp{#} directives emitted by the @code{@value{GCC}} preprocessor.  See also
14213d8817e4Smiod@ref{File,,@code{.file}}.
14223d8817e4Smiod
14233d8817e4Smiod@node Object
14243d8817e4Smiod@section Output (Object) File
14253d8817e4Smiod
14263d8817e4Smiod@cindex object file
14273d8817e4Smiod@cindex output file
14283d8817e4Smiod@kindex a.out
14293d8817e4Smiod@kindex .o
14303d8817e4SmiodEvery time you run @command{@value{AS}} it produces an output file, which is
14313d8817e4Smiodyour assembly language program translated into numbers.  This file
14323d8817e4Smiodis the object file.  Its default name is
14333d8817e4Smiod@ifclear BOUT
14343d8817e4Smiod@code{a.out}.
14353d8817e4Smiod@end ifclear
14363d8817e4Smiod@ifset BOUT
14373d8817e4Smiod@ifset GENERIC
14383d8817e4Smiod@code{a.out}, or
14393d8817e4Smiod@end ifset
14403d8817e4Smiod@code{b.out} when @command{@value{AS}} is configured for the Intel 80960.
14413d8817e4Smiod@end ifset
14423d8817e4SmiodYou can give it another name by using the @option{-o} option.  Conventionally,
14433d8817e4Smiodobject file names end with @file{.o}.  The default name is used for historical
14443d8817e4Smiodreasons: older assemblers were capable of assembling self-contained programs
14453d8817e4Smioddirectly into a runnable program.  (For some formats, this isn't currently
14463d8817e4Smiodpossible, but it can be done for the @code{a.out} format.)
14473d8817e4Smiod
14483d8817e4Smiod@cindex linker
14493d8817e4Smiod@kindex ld
14503d8817e4SmiodThe object file is meant for input to the linker @code{@value{LD}}.  It contains
14513d8817e4Smiodassembled program code, information to help @code{@value{LD}} integrate
14523d8817e4Smiodthe assembled program into a runnable file, and (optionally) symbolic
14533d8817e4Smiodinformation for the debugger.
14543d8817e4Smiod
14553d8817e4Smiod@c link above to some info file(s) like the description of a.out.
14563d8817e4Smiod@c don't forget to describe @sc{gnu} info as well as Unix lossage.
14573d8817e4Smiod
14583d8817e4Smiod@node Errors
14593d8817e4Smiod@section Error and Warning Messages
14603d8817e4Smiod
14613d8817e4Smiod@c man begin DESCRIPTION
14623d8817e4Smiod
14633d8817e4Smiod@cindex error messages
14643d8817e4Smiod@cindex warning messages
14653d8817e4Smiod@cindex messages from assembler
14663d8817e4Smiod@command{@value{AS}} may write warnings and error messages to the standard error
14673d8817e4Smiodfile (usually your terminal).  This should not happen when  a compiler
14683d8817e4Smiodruns @command{@value{AS}} automatically.  Warnings report an assumption made so
14693d8817e4Smiodthat @command{@value{AS}} could keep assembling a flawed program; errors report a
14703d8817e4Smiodgrave problem that stops the assembly.
14713d8817e4Smiod
14723d8817e4Smiod@c man end
14733d8817e4Smiod
14743d8817e4Smiod@cindex format of warning messages
14753d8817e4SmiodWarning messages have the format
14763d8817e4Smiod
14773d8817e4Smiod@smallexample
14783d8817e4Smiodfile_name:@b{NNN}:Warning Message Text
14793d8817e4Smiod@end smallexample
14803d8817e4Smiod
14813d8817e4Smiod@noindent
14823d8817e4Smiod@cindex line numbers, in warnings/errors
14833d8817e4Smiod(where @b{NNN} is a line number).  If a logical file name has been given
14843d8817e4Smiod(@pxref{File,,@code{.file}}) it is used for the filename, otherwise the name of
14853d8817e4Smiodthe current input file is used.  If a logical line number was given
14863d8817e4Smiod@ifset GENERIC
14873d8817e4Smiod(@pxref{Line,,@code{.line}})
14883d8817e4Smiod@end ifset
14893d8817e4Smiodthen it is used to calculate the number printed,
14903d8817e4Smiodotherwise the actual line in the current source file is printed.  The
14913d8817e4Smiodmessage text is intended to be self explanatory (in the grand Unix
14923d8817e4Smiodtradition).
14933d8817e4Smiod
14943d8817e4Smiod@cindex format of error messages
14953d8817e4SmiodError messages have the format
14963d8817e4Smiod@smallexample
14973d8817e4Smiodfile_name:@b{NNN}:FATAL:Error Message Text
14983d8817e4Smiod@end smallexample
14993d8817e4SmiodThe file name and line number are derived as for warning
15003d8817e4Smiodmessages.  The actual message text may be rather less explanatory
15013d8817e4Smiodbecause many of them aren't supposed to happen.
15023d8817e4Smiod
15033d8817e4Smiod@node Invoking
15043d8817e4Smiod@chapter Command-Line Options
15053d8817e4Smiod
15063d8817e4Smiod@cindex options, all versions of assembler
15073d8817e4SmiodThis chapter describes command-line options available in @emph{all}
15083d8817e4Smiodversions of the @sc{gnu} assembler; @pxref{Machine Dependencies}, for options specific
15093d8817e4Smiod@ifclear GENERIC
15103d8817e4Smiodto the @value{TARGET} target.
15113d8817e4Smiod@end ifclear
15123d8817e4Smiod@ifset GENERIC
15133d8817e4Smiodto particular machine architectures.
15143d8817e4Smiod@end ifset
15153d8817e4Smiod
15163d8817e4Smiod@c man begin DESCRIPTION
15173d8817e4Smiod
15183d8817e4SmiodIf you are invoking @command{@value{AS}} via the @sc{gnu} C compiler,
15193d8817e4Smiodyou can use the @samp{-Wa} option to pass arguments through to the assembler.
15203d8817e4SmiodThe assembler arguments must be separated from each other (and the @samp{-Wa})
15213d8817e4Smiodby commas.  For example:
15223d8817e4Smiod
15233d8817e4Smiod@smallexample
15243d8817e4Smiodgcc -c -g -O -Wa,-alh,-L file.c
15253d8817e4Smiod@end smallexample
15263d8817e4Smiod
15273d8817e4Smiod@noindent
15283d8817e4SmiodThis passes two options to the assembler: @samp{-alh} (emit a listing to
15293d8817e4Smiodstandard output with high-level and assembly source) and @samp{-L} (retain
15303d8817e4Smiodlocal symbols in the symbol table).
15313d8817e4Smiod
15323d8817e4SmiodUsually you do not need to use this @samp{-Wa} mechanism, since many compiler
15333d8817e4Smiodcommand-line options are automatically passed to the assembler by the compiler.
15343d8817e4Smiod(You can call the @sc{gnu} compiler driver with the @samp{-v} option to see
15353d8817e4Smiodprecisely what options it passes to each compilation pass, including the
15363d8817e4Smiodassembler.)
15373d8817e4Smiod
15383d8817e4Smiod@c man end
15393d8817e4Smiod
15403d8817e4Smiod@menu
15413d8817e4Smiod* a::             -a[cdhlns] enable listings
15423d8817e4Smiod* alternate::     --alternate enable alternate macro syntax
15433d8817e4Smiod* D::             -D for compatibility
15443d8817e4Smiod* f::             -f to work faster
15453d8817e4Smiod* I::             -I for .include search path
15463d8817e4Smiod@ifclear DIFF-TBL-KLUGE
15473d8817e4Smiod* K::             -K for compatibility
15483d8817e4Smiod@end ifclear
15493d8817e4Smiod@ifset DIFF-TBL-KLUGE
15503d8817e4Smiod* K::             -K for difference tables
15513d8817e4Smiod@end ifset
15523d8817e4Smiod
15533d8817e4Smiod* L::             -L to retain local labels
15543d8817e4Smiod* listing::       --listing-XXX to configure listing output
15553d8817e4Smiod* M::		  -M or --mri to assemble in MRI compatibility mode
15563d8817e4Smiod* MD::            --MD for dependency tracking
15573d8817e4Smiod* o::             -o to name the object file
15583d8817e4Smiod* R::             -R to join data and text sections
15593d8817e4Smiod* statistics::    --statistics to see statistics about assembly
15603d8817e4Smiod* traditional-format:: --traditional-format for compatible output
15613d8817e4Smiod* v::             -v to announce version
15623d8817e4Smiod* W::             -W, --no-warn, --warn, --fatal-warnings to control warnings
15633d8817e4Smiod* Z::             -Z to make object file even after errors
15643d8817e4Smiod@end menu
15653d8817e4Smiod
15663d8817e4Smiod@node a
15673d8817e4Smiod@section Enable Listings: @option{-a[cdhlns]}
15683d8817e4Smiod
15693d8817e4Smiod@kindex -a
15703d8817e4Smiod@kindex -ac
15713d8817e4Smiod@kindex -ad
15723d8817e4Smiod@kindex -ah
15733d8817e4Smiod@kindex -al
15743d8817e4Smiod@kindex -an
15753d8817e4Smiod@kindex -as
15763d8817e4Smiod@cindex listings, enabling
15773d8817e4Smiod@cindex assembly listings, enabling
15783d8817e4Smiod
15793d8817e4SmiodThese options enable listing output from the assembler.  By itself,
15803d8817e4Smiod@samp{-a} requests high-level, assembly, and symbols listing.
15813d8817e4SmiodYou can use other letters to select specific options for the list:
15823d8817e4Smiod@samp{-ah} requests a high-level language listing,
15833d8817e4Smiod@samp{-al} requests an output-program assembly listing, and
15843d8817e4Smiod@samp{-as} requests a symbol table listing.
15853d8817e4SmiodHigh-level listings require that a compiler debugging option like
15863d8817e4Smiod@samp{-g} be used, and that assembly listings (@samp{-al}) be requested
15873d8817e4Smiodalso.
15883d8817e4Smiod
15893d8817e4SmiodUse the @samp{-ac} option to omit false conditionals from a listing.  Any lines
15903d8817e4Smiodwhich are not assembled because of a false @code{.if} (or @code{.ifdef}, or any
15913d8817e4Smiodother conditional), or a true @code{.if} followed by an @code{.else}, will be
15923d8817e4Smiodomitted from the listing.
15933d8817e4Smiod
15943d8817e4SmiodUse the @samp{-ad} option to omit debugging directives from the
15953d8817e4Smiodlisting.
15963d8817e4Smiod
15973d8817e4SmiodOnce you have specified one of these options, you can further control
15983d8817e4Smiodlisting output and its appearance using the directives @code{.list},
15993d8817e4Smiod@code{.nolist}, @code{.psize}, @code{.eject}, @code{.title}, and
16003d8817e4Smiod@code{.sbttl}.
16013d8817e4SmiodThe @samp{-an} option turns off all forms processing.
16023d8817e4SmiodIf you do not request listing output with one of the @samp{-a} options, the
16033d8817e4Smiodlisting-control directives have no effect.
16043d8817e4Smiod
16053d8817e4SmiodThe letters after @samp{-a} may be combined into one option,
16063d8817e4Smiod@emph{e.g.}, @samp{-aln}.
16073d8817e4Smiod
16083d8817e4SmiodNote if the assembler source is coming from the standard input (eg because it
16093d8817e4Smiodis being created by @code{@value{GCC}} and the @samp{-pipe} command line switch
16103d8817e4Smiodis being used) then the listing will not contain any comments or preprocessor
16113d8817e4Smioddirectives.  This is because the listing code buffers input source lines from
16123d8817e4Smiodstdin only after they have been preprocessed by the assembler.  This reduces
16133d8817e4Smiodmemory usage and makes the code more efficient.
16143d8817e4Smiod
16153d8817e4Smiod@node alternate
16163d8817e4Smiod@section @option{--alternate}
16173d8817e4Smiod
16183d8817e4Smiod@kindex --alternate
16193d8817e4SmiodBegin in alternate macro mode, see @ref{Altmacro,,@code{.altmacro}}.
16203d8817e4Smiod
16213d8817e4Smiod@node D
16223d8817e4Smiod@section @option{-D}
16233d8817e4Smiod
16243d8817e4Smiod@kindex -D
16253d8817e4SmiodThis option has no effect whatsoever, but it is accepted to make it more
16263d8817e4Smiodlikely that scripts written for other assemblers also work with
16273d8817e4Smiod@command{@value{AS}}.
16283d8817e4Smiod
16293d8817e4Smiod@node f
16303d8817e4Smiod@section Work Faster: @option{-f}
16313d8817e4Smiod
16323d8817e4Smiod@kindex -f
16333d8817e4Smiod@cindex trusted compiler
16343d8817e4Smiod@cindex faster processing (@option{-f})
16353d8817e4Smiod@samp{-f} should only be used when assembling programs written by a
16363d8817e4Smiod(trusted) compiler.  @samp{-f} stops the assembler from doing whitespace
16373d8817e4Smiodand comment preprocessing on
16383d8817e4Smiodthe input file(s) before assembling them.  @xref{Preprocessing,
16393d8817e4Smiod,Preprocessing}.
16403d8817e4Smiod
16413d8817e4Smiod@quotation
16423d8817e4Smiod@emph{Warning:} if you use @samp{-f} when the files actually need to be
16433d8817e4Smiodpreprocessed (if they contain comments, for example), @command{@value{AS}} does
16443d8817e4Smiodnot work correctly.
16453d8817e4Smiod@end quotation
16463d8817e4Smiod
16473d8817e4Smiod@node I
16483d8817e4Smiod@section @code{.include} Search Path: @option{-I} @var{path}
16493d8817e4Smiod
16503d8817e4Smiod@kindex -I @var{path}
16513d8817e4Smiod@cindex paths for @code{.include}
16523d8817e4Smiod@cindex search path for @code{.include}
16533d8817e4Smiod@cindex @code{include} directive search path
16543d8817e4SmiodUse this option to add a @var{path} to the list of directories
16553d8817e4Smiod@command{@value{AS}} searches for files specified in @code{.include}
16563d8817e4Smioddirectives (@pxref{Include,,@code{.include}}).  You may use @option{-I} as
16573d8817e4Smiodmany times as necessary to include a variety of paths.  The current
16583d8817e4Smiodworking directory is always searched first; after that, @command{@value{AS}}
16593d8817e4Smiodsearches any @samp{-I} directories in the same order as they were
16603d8817e4Smiodspecified (left to right) on the command line.
16613d8817e4Smiod
16623d8817e4Smiod@node K
16633d8817e4Smiod@section Difference Tables: @option{-K}
16643d8817e4Smiod
16653d8817e4Smiod@kindex -K
16663d8817e4Smiod@ifclear DIFF-TBL-KLUGE
16673d8817e4SmiodOn the @value{TARGET} family, this option is allowed, but has no effect.  It is
16683d8817e4Smiodpermitted for compatibility with the @sc{gnu} assembler on other platforms,
16693d8817e4Smiodwhere it can be used to warn when the assembler alters the machine code
16703d8817e4Smiodgenerated for @samp{.word} directives in difference tables.  The @value{TARGET}
16713d8817e4Smiodfamily does not have the addressing limitations that sometimes lead to this
16723d8817e4Smiodalteration on other platforms.
16733d8817e4Smiod@end ifclear
16743d8817e4Smiod
16753d8817e4Smiod@ifset DIFF-TBL-KLUGE
16763d8817e4Smiod@cindex difference tables, warning
16773d8817e4Smiod@cindex warning for altered difference tables
16783d8817e4Smiod@command{@value{AS}} sometimes alters the code emitted for directives of the form
16793d8817e4Smiod@samp{.word @var{sym1}-@var{sym2}}; @pxref{Word,,@code{.word}}.
16803d8817e4SmiodYou can use the @samp{-K} option if you want a warning issued when this
16813d8817e4Smiodis done.
16823d8817e4Smiod@end ifset
16833d8817e4Smiod
16843d8817e4Smiod@node L
16853d8817e4Smiod@section Include Local Labels: @option{-L}
16863d8817e4Smiod
16873d8817e4Smiod@kindex -L
16883d8817e4Smiod@cindex local labels, retaining in output
16893d8817e4SmiodLabels beginning with @samp{L} (upper case only) are called @dfn{local
16903d8817e4Smiodlabels}. @xref{Symbol Names}.  Normally you do not see such labels when
16913d8817e4Smioddebugging, because they are intended for the use of programs (like
16923d8817e4Smiodcompilers) that compose assembler programs, not for your notice.
16933d8817e4SmiodNormally both @command{@value{AS}} and @code{@value{LD}} discard such labels, so you do not
16943d8817e4Smiodnormally debug with them.
16953d8817e4Smiod
16963d8817e4SmiodThis option tells @command{@value{AS}} to retain those @samp{L@dots{}} symbols
16973d8817e4Smiodin the object file.  Usually if you do this you also tell the linker
16983d8817e4Smiod@code{@value{LD}} to preserve symbols whose names begin with @samp{L}.
16993d8817e4Smiod
17003d8817e4SmiodBy default, a local label is any label beginning with @samp{L}, but each
17013d8817e4Smiodtarget is allowed to redefine the local label prefix.
17023d8817e4Smiod@ifset HPPA
17033d8817e4SmiodOn the HPPA local labels begin with @samp{L$}.
17043d8817e4Smiod@end ifset
17053d8817e4Smiod
17063d8817e4Smiod@node listing
17073d8817e4Smiod@section Configuring listing output: @option{--listing}
17083d8817e4Smiod
17093d8817e4SmiodThe listing feature of the assembler can be enabled via the command line switch
17103d8817e4Smiod@samp{-a} (@pxref{a}).  This feature combines the input source file(s) with a
17113d8817e4Smiodhex dump of the corresponding locations in the output object file, and displays
17123d8817e4Smiodthem as a listing file.  The format of this listing can be controlled by pseudo
17133d8817e4Smiodops inside the assembler source (@pxref{List} @pxref{Title} @pxref{Sbttl}
17143d8817e4Smiod@pxref{Psize} @pxref{Eject}) and also by the following switches:
17153d8817e4Smiod
17163d8817e4Smiod@table @gcctabopt
17173d8817e4Smiod@item --listing-lhs-width=@samp{number}
17183d8817e4Smiod@kindex --listing-lhs-width
17193d8817e4Smiod@cindex Width of first line disassembly output
17203d8817e4SmiodSets the maximum width, in words, of the first line of the hex byte dump.  This
17213d8817e4Smioddump appears on the left hand side of the listing output.
17223d8817e4Smiod
17233d8817e4Smiod@item --listing-lhs-width2=@samp{number}
17243d8817e4Smiod@kindex --listing-lhs-width2
17253d8817e4Smiod@cindex Width of continuation lines of disassembly output
17263d8817e4SmiodSets the maximum width, in words, of any further lines of the hex byte dump for
17273d8817e4Smioda given input source line.  If this value is not specified, it defaults to being
17283d8817e4Smiodthe same as the value specified for @samp{--listing-lhs-width}.  If neither
17293d8817e4Smiodswitch is used the default is to one.
17303d8817e4Smiod
17313d8817e4Smiod@item --listing-rhs-width=@samp{number}
17323d8817e4Smiod@kindex --listing-rhs-width
17333d8817e4Smiod@cindex Width of source line output
17343d8817e4SmiodSets the maximum width, in characters, of the source line that is displayed
17353d8817e4Smiodalongside the hex dump.  The default value for this parameter is 100.  The
17363d8817e4Smiodsource line is displayed on the right hand side of the listing output.
17373d8817e4Smiod
17383d8817e4Smiod@item --listing-cont-lines=@samp{number}
17393d8817e4Smiod@kindex --listing-cont-lines
17403d8817e4Smiod@cindex Maximum number of continuation lines
17413d8817e4SmiodSets the maximum number of continuation lines of hex dump that will be
17423d8817e4Smioddisplayed for a given single line of source input.  The default value is 4.
17433d8817e4Smiod@end table
17443d8817e4Smiod
17453d8817e4Smiod@node M
17463d8817e4Smiod@section Assemble in MRI Compatibility Mode: @option{-M}
17473d8817e4Smiod
17483d8817e4Smiod@kindex -M
17493d8817e4Smiod@cindex MRI compatibility mode
17503d8817e4SmiodThe @option{-M} or @option{--mri} option selects MRI compatibility mode.  This
17513d8817e4Smiodchanges the syntax and pseudo-op handling of @command{@value{AS}} to make it
17523d8817e4Smiodcompatible with the @code{ASM68K} or the @code{ASM960} (depending upon the
17533d8817e4Smiodconfigured target) assembler from Microtec Research.  The exact nature of the
17543d8817e4SmiodMRI syntax will not be documented here; see the MRI manuals for more
17553d8817e4Smiodinformation.  Note in particular that the handling of macros and macro
17563d8817e4Smiodarguments is somewhat different.  The purpose of this option is to permit
17573d8817e4Smiodassembling existing MRI assembler code using @command{@value{AS}}.
17583d8817e4Smiod
17593d8817e4SmiodThe MRI compatibility is not complete.  Certain operations of the MRI assembler
17603d8817e4Smioddepend upon its object file format, and can not be supported using other object
17613d8817e4Smiodfile formats.  Supporting these would require enhancing each object file format
17623d8817e4Smiodindividually.  These are:
17633d8817e4Smiod
17643d8817e4Smiod@itemize @bullet
17653d8817e4Smiod@item global symbols in common section
17663d8817e4Smiod
17673d8817e4SmiodThe m68k MRI assembler supports common sections which are merged by the linker.
17683d8817e4SmiodOther object file formats do not support this.  @command{@value{AS}} handles
17693d8817e4Smiodcommon sections by treating them as a single common symbol.  It permits local
17703d8817e4Smiodsymbols to be defined within a common section, but it can not support global
17713d8817e4Smiodsymbols, since it has no way to describe them.
17723d8817e4Smiod
17733d8817e4Smiod@item complex relocations
17743d8817e4Smiod
17753d8817e4SmiodThe MRI assemblers support relocations against a negated section address, and
17763d8817e4Smiodrelocations which combine the start addresses of two or more sections.  These
17773d8817e4Smiodare not support by other object file formats.
17783d8817e4Smiod
17793d8817e4Smiod@item @code{END} pseudo-op specifying start address
17803d8817e4Smiod
17813d8817e4SmiodThe MRI @code{END} pseudo-op permits the specification of a start address.
17823d8817e4SmiodThis is not supported by other object file formats.  The start address may
17833d8817e4Smiodinstead be specified using the @option{-e} option to the linker, or in a linker
17843d8817e4Smiodscript.
17853d8817e4Smiod
17863d8817e4Smiod@item @code{IDNT}, @code{.ident} and @code{NAME} pseudo-ops
17873d8817e4Smiod
17883d8817e4SmiodThe MRI @code{IDNT}, @code{.ident} and @code{NAME} pseudo-ops assign a module
17893d8817e4Smiodname to the output file.  This is not supported by other object file formats.
17903d8817e4Smiod
17913d8817e4Smiod@item @code{ORG} pseudo-op
17923d8817e4Smiod
17933d8817e4SmiodThe m68k MRI @code{ORG} pseudo-op begins an absolute section at a given
17943d8817e4Smiodaddress.  This differs from the usual @command{@value{AS}} @code{.org} pseudo-op,
17953d8817e4Smiodwhich changes the location within the current section.  Absolute sections are
17963d8817e4Smiodnot supported by other object file formats.  The address of a section may be
17973d8817e4Smiodassigned within a linker script.
17983d8817e4Smiod@end itemize
17993d8817e4Smiod
18003d8817e4SmiodThere are some other features of the MRI assembler which are not supported by
18013d8817e4Smiod@command{@value{AS}}, typically either because they are difficult or because they
18023d8817e4Smiodseem of little consequence.  Some of these may be supported in future releases.
18033d8817e4Smiod
18043d8817e4Smiod@itemize @bullet
18053d8817e4Smiod
18063d8817e4Smiod@item EBCDIC strings
18073d8817e4Smiod
18083d8817e4SmiodEBCDIC strings are not supported.
18093d8817e4Smiod
18103d8817e4Smiod@item packed binary coded decimal
18113d8817e4Smiod
18123d8817e4SmiodPacked binary coded decimal is not supported.  This means that the @code{DC.P}
18133d8817e4Smiodand @code{DCB.P} pseudo-ops are not supported.
18143d8817e4Smiod
18153d8817e4Smiod@item @code{FEQU} pseudo-op
18163d8817e4Smiod
18173d8817e4SmiodThe m68k @code{FEQU} pseudo-op is not supported.
18183d8817e4Smiod
18193d8817e4Smiod@item @code{NOOBJ} pseudo-op
18203d8817e4Smiod
18213d8817e4SmiodThe m68k @code{NOOBJ} pseudo-op is not supported.
18223d8817e4Smiod
18233d8817e4Smiod@item @code{OPT} branch control options
18243d8817e4Smiod
18253d8817e4SmiodThe m68k @code{OPT} branch control options---@code{B}, @code{BRS}, @code{BRB},
18263d8817e4Smiod@code{BRL}, and @code{BRW}---are ignored.  @command{@value{AS}} automatically
18273d8817e4Smiodrelaxes all branches, whether forward or backward, to an appropriate size, so
18283d8817e4Smiodthese options serve no purpose.
18293d8817e4Smiod
18303d8817e4Smiod@item @code{OPT} list control options
18313d8817e4Smiod
18323d8817e4SmiodThe following m68k @code{OPT} list control options are ignored: @code{C},
18333d8817e4Smiod@code{CEX}, @code{CL}, @code{CRE}, @code{E}, @code{G}, @code{I}, @code{M},
18343d8817e4Smiod@code{MEX}, @code{MC}, @code{MD}, @code{X}.
18353d8817e4Smiod
18363d8817e4Smiod@item other @code{OPT} options
18373d8817e4Smiod
18383d8817e4SmiodThe following m68k @code{OPT} options are ignored: @code{NEST}, @code{O},
18393d8817e4Smiod@code{OLD}, @code{OP}, @code{P}, @code{PCO}, @code{PCR}, @code{PCS}, @code{R}.
18403d8817e4Smiod
18413d8817e4Smiod@item @code{OPT} @code{D} option is default
18423d8817e4Smiod
18433d8817e4SmiodThe m68k @code{OPT} @code{D} option is the default, unlike the MRI assembler.
18443d8817e4Smiod@code{OPT NOD} may be used to turn it off.
18453d8817e4Smiod
18463d8817e4Smiod@item @code{XREF} pseudo-op.
18473d8817e4Smiod
18483d8817e4SmiodThe m68k @code{XREF} pseudo-op is ignored.
18493d8817e4Smiod
18503d8817e4Smiod@item @code{.debug} pseudo-op
18513d8817e4Smiod
18523d8817e4SmiodThe i960 @code{.debug} pseudo-op is not supported.
18533d8817e4Smiod
18543d8817e4Smiod@item @code{.extended} pseudo-op
18553d8817e4Smiod
18563d8817e4SmiodThe i960 @code{.extended} pseudo-op is not supported.
18573d8817e4Smiod
18583d8817e4Smiod@item @code{.list} pseudo-op.
18593d8817e4Smiod
18603d8817e4SmiodThe various options of the i960 @code{.list} pseudo-op are not supported.
18613d8817e4Smiod
18623d8817e4Smiod@item @code{.optimize} pseudo-op
18633d8817e4Smiod
18643d8817e4SmiodThe i960 @code{.optimize} pseudo-op is not supported.
18653d8817e4Smiod
18663d8817e4Smiod@item @code{.output} pseudo-op
18673d8817e4Smiod
18683d8817e4SmiodThe i960 @code{.output} pseudo-op is not supported.
18693d8817e4Smiod
18703d8817e4Smiod@item @code{.setreal} pseudo-op
18713d8817e4Smiod
18723d8817e4SmiodThe i960 @code{.setreal} pseudo-op is not supported.
18733d8817e4Smiod
18743d8817e4Smiod@end itemize
18753d8817e4Smiod
18763d8817e4Smiod@node MD
18773d8817e4Smiod@section Dependency Tracking: @option{--MD}
18783d8817e4Smiod
18793d8817e4Smiod@kindex --MD
18803d8817e4Smiod@cindex dependency tracking
18813d8817e4Smiod@cindex make rules
18823d8817e4Smiod
18833d8817e4Smiod@command{@value{AS}} can generate a dependency file for the file it creates.  This
18843d8817e4Smiodfile consists of a single rule suitable for @code{make} describing the
18853d8817e4Smioddependencies of the main source file.
18863d8817e4Smiod
18873d8817e4SmiodThe rule is written to the file named in its argument.
18883d8817e4Smiod
18893d8817e4SmiodThis feature is used in the automatic updating of makefiles.
18903d8817e4Smiod
18913d8817e4Smiod@node o
18923d8817e4Smiod@section Name the Object File: @option{-o}
18933d8817e4Smiod
18943d8817e4Smiod@kindex -o
18953d8817e4Smiod@cindex naming object file
18963d8817e4Smiod@cindex object file name
18973d8817e4SmiodThere is always one object file output when you run @command{@value{AS}}.  By
18983d8817e4Smioddefault it has the name
18993d8817e4Smiod@ifset GENERIC
19003d8817e4Smiod@ifset I960
19013d8817e4Smiod@file{a.out} (or @file{b.out}, for Intel 960 targets only).
19023d8817e4Smiod@end ifset
19033d8817e4Smiod@ifclear I960
19043d8817e4Smiod@file{a.out}.
19053d8817e4Smiod@end ifclear
19063d8817e4Smiod@end ifset
19073d8817e4Smiod@ifclear GENERIC
19083d8817e4Smiod@ifset I960
19093d8817e4Smiod@file{b.out}.
19103d8817e4Smiod@end ifset
19113d8817e4Smiod@ifclear I960
19123d8817e4Smiod@file{a.out}.
19133d8817e4Smiod@end ifclear
19143d8817e4Smiod@end ifclear
19153d8817e4SmiodYou use this option (which takes exactly one filename) to give the
19163d8817e4Smiodobject file a different name.
19173d8817e4Smiod
19183d8817e4SmiodWhatever the object file is called, @command{@value{AS}} overwrites any
19193d8817e4Smiodexisting file of the same name.
19203d8817e4Smiod
19213d8817e4Smiod@node R
19223d8817e4Smiod@section Join Data and Text Sections: @option{-R}
19233d8817e4Smiod
19243d8817e4Smiod@kindex -R
19253d8817e4Smiod@cindex data and text sections, joining
19263d8817e4Smiod@cindex text and data sections, joining
19273d8817e4Smiod@cindex joining text and data sections
19283d8817e4Smiod@cindex merging text and data sections
19293d8817e4Smiod@option{-R} tells @command{@value{AS}} to write the object file as if all
19303d8817e4Smioddata-section data lives in the text section.  This is only done at
19313d8817e4Smiodthe very last moment:  your binary data are the same, but data
19323d8817e4Smiodsection parts are relocated differently.  The data section part of
19333d8817e4Smiodyour object file is zero bytes long because all its bytes are
19343d8817e4Smiodappended to the text section.  (@xref{Sections,,Sections and Relocation}.)
19353d8817e4Smiod
19363d8817e4SmiodWhen you specify @option{-R} it would be possible to generate shorter
19373d8817e4Smiodaddress displacements (because we do not have to cross between text and
19383d8817e4Smioddata section).  We refrain from doing this simply for compatibility with
19393d8817e4Smiodolder versions of @command{@value{AS}}.  In future, @option{-R} may work this way.
19403d8817e4Smiod
19413d8817e4Smiod@ifset COFF-ELF
19423d8817e4SmiodWhen @command{@value{AS}} is configured for COFF or ELF output,
19433d8817e4Smiodthis option is only useful if you use sections named @samp{.text} and
19443d8817e4Smiod@samp{.data}.
19453d8817e4Smiod@end ifset
19463d8817e4Smiod
19473d8817e4Smiod@ifset HPPA
19483d8817e4Smiod@option{-R} is not supported for any of the HPPA targets.  Using
19493d8817e4Smiod@option{-R} generates a warning from @command{@value{AS}}.
19503d8817e4Smiod@end ifset
19513d8817e4Smiod
19523d8817e4Smiod@node statistics
19533d8817e4Smiod@section Display Assembly Statistics: @option{--statistics}
19543d8817e4Smiod
19553d8817e4Smiod@kindex --statistics
19563d8817e4Smiod@cindex statistics, about assembly
19573d8817e4Smiod@cindex time, total for assembly
19583d8817e4Smiod@cindex space used, maximum for assembly
19593d8817e4SmiodUse @samp{--statistics} to display two statistics about the resources used by
19603d8817e4Smiod@command{@value{AS}}: the maximum amount of space allocated during the assembly
19613d8817e4Smiod(in bytes), and the total execution time taken for the assembly (in @sc{cpu}
19623d8817e4Smiodseconds).
19633d8817e4Smiod
19643d8817e4Smiod@node traditional-format
19653d8817e4Smiod@section Compatible Output: @option{--traditional-format}
19663d8817e4Smiod
19673d8817e4Smiod@kindex --traditional-format
19683d8817e4SmiodFor some targets, the output of @command{@value{AS}} is different in some ways
19693d8817e4Smiodfrom the output of some existing assembler.  This switch requests
19703d8817e4Smiod@command{@value{AS}} to use the traditional format instead.
19713d8817e4Smiod
19723d8817e4SmiodFor example, it disables the exception frame optimizations which
19733d8817e4Smiod@command{@value{AS}} normally does by default on @code{@value{GCC}} output.
19743d8817e4Smiod
19753d8817e4Smiod@node v
19763d8817e4Smiod@section Announce Version: @option{-v}
19773d8817e4Smiod
19783d8817e4Smiod@kindex -v
19793d8817e4Smiod@kindex -version
19803d8817e4Smiod@cindex assembler version
19813d8817e4Smiod@cindex version of assembler
19823d8817e4SmiodYou can find out what version of as is running by including the
19833d8817e4Smiodoption @samp{-v} (which you can also spell as @samp{-version}) on the
19843d8817e4Smiodcommand line.
19853d8817e4Smiod
19863d8817e4Smiod@node W
19873d8817e4Smiod@section Control Warnings: @option{-W}, @option{--warn}, @option{--no-warn}, @option{--fatal-warnings}
19883d8817e4Smiod
19893d8817e4Smiod@command{@value{AS}} should never give a warning or error message when
19903d8817e4Smiodassembling compiler output.  But programs written by people often
19913d8817e4Smiodcause @command{@value{AS}} to give a warning that a particular assumption was
19923d8817e4Smiodmade.  All such warnings are directed to the standard error file.
19933d8817e4Smiod
19943d8817e4Smiod@kindex -W
19953d8817e4Smiod@kindex --no-warn
19963d8817e4Smiod@cindex suppressing warnings
19973d8817e4Smiod@cindex warnings, suppressing
19983d8817e4SmiodIf you use the @option{-W} and @option{--no-warn} options, no warnings are issued.
19993d8817e4SmiodThis only affects the warning messages: it does not change any particular of
20003d8817e4Smiodhow @command{@value{AS}} assembles your file.  Errors, which stop the assembly,
20013d8817e4Smiodare still reported.
20023d8817e4Smiod
20033d8817e4Smiod@kindex --fatal-warnings
20043d8817e4Smiod@cindex errors, caused by warnings
20053d8817e4Smiod@cindex warnings, causing error
20063d8817e4SmiodIf you use the @option{--fatal-warnings} option, @command{@value{AS}} considers
20073d8817e4Smiodfiles that generate warnings to be in error.
20083d8817e4Smiod
20093d8817e4Smiod@kindex --warn
20103d8817e4Smiod@cindex warnings, switching on
20113d8817e4SmiodYou can switch these options off again by specifying @option{--warn}, which
20123d8817e4Smiodcauses warnings to be output as usual.
20133d8817e4Smiod
20143d8817e4Smiod@node Z
20153d8817e4Smiod@section Generate Object File in Spite of Errors: @option{-Z}
20163d8817e4Smiod@cindex object file, after errors
20173d8817e4Smiod@cindex errors, continuing after
20183d8817e4SmiodAfter an error message, @command{@value{AS}} normally produces no output.  If for
20193d8817e4Smiodsome reason you are interested in object file output even after
20203d8817e4Smiod@command{@value{AS}} gives an error message on your program, use the @samp{-Z}
20213d8817e4Smiodoption.  If there are any errors, @command{@value{AS}} continues anyways, and
20223d8817e4Smiodwrites an object file after a final warning message of the form @samp{@var{n}
20233d8817e4Smioderrors, @var{m} warnings, generating bad object file.}
20243d8817e4Smiod
20253d8817e4Smiod@node Syntax
20263d8817e4Smiod@chapter Syntax
20273d8817e4Smiod
20283d8817e4Smiod@cindex machine-independent syntax
20293d8817e4Smiod@cindex syntax, machine-independent
20303d8817e4SmiodThis chapter describes the machine-independent syntax allowed in a
20313d8817e4Smiodsource file.  @command{@value{AS}} syntax is similar to what many other
20323d8817e4Smiodassemblers use; it is inspired by the BSD 4.2
20333d8817e4Smiod@ifclear VAX
20343d8817e4Smiodassembler.
20353d8817e4Smiod@end ifclear
20363d8817e4Smiod@ifset VAX
20373d8817e4Smiodassembler, except that @command{@value{AS}} does not assemble Vax bit-fields.
20383d8817e4Smiod@end ifset
20393d8817e4Smiod
20403d8817e4Smiod@menu
20413d8817e4Smiod* Preprocessing::              Preprocessing
20423d8817e4Smiod* Whitespace::                  Whitespace
20433d8817e4Smiod* Comments::                    Comments
20443d8817e4Smiod* Symbol Intro::                Symbols
20453d8817e4Smiod* Statements::                  Statements
20463d8817e4Smiod* Constants::                   Constants
20473d8817e4Smiod@end menu
20483d8817e4Smiod
20493d8817e4Smiod@node Preprocessing
20503d8817e4Smiod@section Preprocessing
20513d8817e4Smiod
20523d8817e4Smiod@cindex preprocessing
20533d8817e4SmiodThe @command{@value{AS}} internal preprocessor:
20543d8817e4Smiod@itemize @bullet
20553d8817e4Smiod@cindex whitespace, removed by preprocessor
20563d8817e4Smiod@item
20573d8817e4Smiodadjusts and removes extra whitespace.  It leaves one space or tab before
20583d8817e4Smiodthe keywords on a line, and turns any other whitespace on the line into
20593d8817e4Smioda single space.
20603d8817e4Smiod
20613d8817e4Smiod@cindex comments, removed by preprocessor
20623d8817e4Smiod@item
20633d8817e4Smiodremoves all comments, replacing them with a single space, or an
20643d8817e4Smiodappropriate number of newlines.
20653d8817e4Smiod
20663d8817e4Smiod@cindex constants, converted by preprocessor
20673d8817e4Smiod@item
20683d8817e4Smiodconverts character constants into the appropriate numeric values.
20693d8817e4Smiod@end itemize
20703d8817e4Smiod
20713d8817e4SmiodIt does not do macro processing, include file handling, or
20723d8817e4Smiodanything else you may get from your C compiler's preprocessor.  You can
20733d8817e4Smioddo include file processing with the @code{.include} directive
20743d8817e4Smiod(@pxref{Include,,@code{.include}}).  You can use the @sc{gnu} C compiler driver
20753d8817e4Smiodto get other ``CPP'' style preprocessing by giving the input file a
20763d8817e4Smiod@samp{.S} suffix.  @xref{Overall Options,, Options Controlling the Kind of
20773d8817e4SmiodOutput, gcc.info, Using GNU CC}.
20783d8817e4Smiod
20793d8817e4SmiodExcess whitespace, comments, and character constants
20803d8817e4Smiodcannot be used in the portions of the input text that are not
20813d8817e4Smiodpreprocessed.
20823d8817e4Smiod
20833d8817e4Smiod@cindex turning preprocessing on and off
20843d8817e4Smiod@cindex preprocessing, turning on and off
20853d8817e4Smiod@kindex #NO_APP
20863d8817e4Smiod@kindex #APP
20873d8817e4SmiodIf the first line of an input file is @code{#NO_APP} or if you use the
20883d8817e4Smiod@samp{-f} option, whitespace and comments are not removed from the input file.
20893d8817e4SmiodWithin an input file, you can ask for whitespace and comment removal in
2090*7d62d86aSjcaspecific portions of the file by putting a line that says @code{#APP} before
2091*7d62d86aSjcathe text that may contain whitespace or comments, and putting a line that says
20923d8817e4Smiod@code{#NO_APP} after this text.  This feature is mainly intend to support
20933d8817e4Smiod@code{asm} statements in compilers whose output is otherwise free of comments
20943d8817e4Smiodand whitespace.
20953d8817e4Smiod
20963d8817e4Smiod@node Whitespace
20973d8817e4Smiod@section Whitespace
20983d8817e4Smiod
20993d8817e4Smiod@cindex whitespace
21003d8817e4Smiod@dfn{Whitespace} is one or more blanks or tabs, in any order.
21013d8817e4SmiodWhitespace is used to separate symbols, and to make programs neater for
21023d8817e4Smiodpeople to read.  Unless within character constants
21033d8817e4Smiod(@pxref{Characters,,Character Constants}), any whitespace means the same
21043d8817e4Smiodas exactly one space.
21053d8817e4Smiod
21063d8817e4Smiod@node Comments
21073d8817e4Smiod@section Comments
21083d8817e4Smiod
21093d8817e4Smiod@cindex comments
21103d8817e4SmiodThere are two ways of rendering comments to @command{@value{AS}}.  In both
21113d8817e4Smiodcases the comment is equivalent to one space.
21123d8817e4Smiod
21133d8817e4SmiodAnything from @samp{/*} through the next @samp{*/} is a comment.
21143d8817e4SmiodThis means you may not nest these comments.
21153d8817e4Smiod
21163d8817e4Smiod@smallexample
21173d8817e4Smiod/*
21183d8817e4Smiod  The only way to include a newline ('\n') in a comment
21193d8817e4Smiod  is to use this sort of comment.
21203d8817e4Smiod*/
21213d8817e4Smiod
21223d8817e4Smiod/* This sort of comment does not nest. */
21233d8817e4Smiod@end smallexample
21243d8817e4Smiod
21253d8817e4Smiod@cindex line comment character
21263d8817e4SmiodAnything from the @dfn{line comment} character to the next newline
21273d8817e4Smiodis considered a comment and is ignored.  The line comment character is
21283d8817e4Smiod@ifset ARC
21293d8817e4Smiod@samp{;} on the ARC;
21303d8817e4Smiod@end ifset
21313d8817e4Smiod@ifset ARM
21323d8817e4Smiod@samp{@@} on the ARM;
21333d8817e4Smiod@end ifset
21343d8817e4Smiod@ifset H8/300
21353d8817e4Smiod@samp{;} for the H8/300 family;
21363d8817e4Smiod@end ifset
21373d8817e4Smiod@ifset HPPA
21383d8817e4Smiod@samp{;} for the HPPA;
21393d8817e4Smiod@end ifset
21403d8817e4Smiod@ifset I80386
21413d8817e4Smiod@samp{#} on the i386 and x86-64;
21423d8817e4Smiod@end ifset
21433d8817e4Smiod@ifset I960
21443d8817e4Smiod@samp{#} on the i960;
21453d8817e4Smiod@end ifset
21463d8817e4Smiod@ifset PDP11
21473d8817e4Smiod@samp{;} for the PDP-11;
21483d8817e4Smiod@end ifset
21493d8817e4Smiod@ifset PJ
21503d8817e4Smiod@samp{;} for picoJava;
21513d8817e4Smiod@end ifset
21523d8817e4Smiod@ifset PPC
21533d8817e4Smiod@samp{#} for Motorola PowerPC;
21543d8817e4Smiod@end ifset
21553d8817e4Smiod@ifset SH
21563d8817e4Smiod@samp{!} for the Renesas / SuperH SH;
21573d8817e4Smiod@end ifset
21583d8817e4Smiod@ifset SPARC
21593d8817e4Smiod@samp{!} on the SPARC;
21603d8817e4Smiod@end ifset
21613d8817e4Smiod@ifset IP2K
21623d8817e4Smiod@samp{#} on the ip2k;
21633d8817e4Smiod@end ifset
21643d8817e4Smiod@ifset M32C
21653d8817e4Smiod@samp{#} on the m32c;
21663d8817e4Smiod@end ifset
21673d8817e4Smiod@ifset M32R
21683d8817e4Smiod@samp{#} on the m32r;
21693d8817e4Smiod@end ifset
21703d8817e4Smiod@ifset M680X0
21713d8817e4Smiod@samp{|} on the 680x0;
21723d8817e4Smiod@end ifset
21733d8817e4Smiod@ifset M68HC11
21743d8817e4Smiod@samp{#} on the 68HC11 and 68HC12;
21753d8817e4Smiod@end ifset
21763d8817e4Smiod@ifset VAX
21773d8817e4Smiod@samp{#} on the Vax;
21783d8817e4Smiod@end ifset
21793d8817e4Smiod@ifset Z80
21803d8817e4Smiod@samp{;} for the Z80;
21813d8817e4Smiod@end ifset
21823d8817e4Smiod@ifset Z8000
21833d8817e4Smiod@samp{!} for the Z8000;
21843d8817e4Smiod@end ifset
21853d8817e4Smiod@ifset V850
21863d8817e4Smiod@samp{#} on the V850;
21873d8817e4Smiod@end ifset
21883d8817e4Smiod@ifset XTENSA
21893d8817e4Smiod@samp{#} for Xtensa systems;
21903d8817e4Smiod@end ifset
21913d8817e4Smiodsee @ref{Machine Dependencies}.  @refill
21923d8817e4Smiod@c FIXME What about i860?
21933d8817e4Smiod
21943d8817e4Smiod@ifset GENERIC
21953d8817e4SmiodOn some machines there are two different line comment characters.  One
21963d8817e4Smiodcharacter only begins a comment if it is the first non-whitespace character on
21973d8817e4Smioda line, while the other always begins a comment.
21983d8817e4Smiod@end ifset
21993d8817e4Smiod
22003d8817e4Smiod@ifset V850
22013d8817e4SmiodThe V850 assembler also supports a double dash as starting a comment that
22023d8817e4Smiodextends to the end of the line.
22033d8817e4Smiod
22043d8817e4Smiod@samp{--};
22053d8817e4Smiod@end ifset
22063d8817e4Smiod
22073d8817e4Smiod@kindex #
22083d8817e4Smiod@cindex lines starting with @code{#}
22093d8817e4Smiod@cindex logical line numbers
22103d8817e4SmiodTo be compatible with past assemblers, lines that begin with @samp{#} have a
22113d8817e4Smiodspecial interpretation.  Following the @samp{#} should be an absolute
22123d8817e4Smiodexpression (@pxref{Expressions}): the logical line number of the @emph{next}
22133d8817e4Smiodline.  Then a string (@pxref{Strings,, Strings}) is allowed: if present it is a
22143d8817e4Smiodnew logical file name.  The rest of the line, if any, should be whitespace.
22153d8817e4Smiod
22163d8817e4SmiodIf the first non-whitespace characters on the line are not numeric,
22173d8817e4Smiodthe line is ignored.  (Just like a comment.)
22183d8817e4Smiod
22193d8817e4Smiod@smallexample
22203d8817e4Smiod                          # This is an ordinary comment.
22213d8817e4Smiod# 42-6 "new_file_name"    # New logical file name
22223d8817e4Smiod                          # This is logical line # 36.
22233d8817e4Smiod@end smallexample
22243d8817e4SmiodThis feature is deprecated, and may disappear from future versions
22253d8817e4Smiodof @command{@value{AS}}.
22263d8817e4Smiod
22273d8817e4Smiod@node Symbol Intro
22283d8817e4Smiod@section Symbols
22293d8817e4Smiod
22303d8817e4Smiod@cindex characters used in symbols
22313d8817e4Smiod@ifclear SPECIAL-SYMS
22323d8817e4SmiodA @dfn{symbol} is one or more characters chosen from the set of all
22333d8817e4Smiodletters (both upper and lower case), digits and the three characters
22343d8817e4Smiod@samp{_.$}.
22353d8817e4Smiod@end ifclear
22363d8817e4Smiod@ifset SPECIAL-SYMS
22373d8817e4Smiod@ifclear GENERIC
22383d8817e4Smiod@ifset H8
22393d8817e4SmiodA @dfn{symbol} is one or more characters chosen from the set of all
22403d8817e4Smiodletters (both upper and lower case), digits and the three characters
22413d8817e4Smiod@samp{._$}.  (Save that, on the H8/300 only, you may not use @samp{$} in
22423d8817e4Smiodsymbol names.)
22433d8817e4Smiod@end ifset
22443d8817e4Smiod@end ifclear
22453d8817e4Smiod@end ifset
22463d8817e4Smiod@ifset GENERIC
22473d8817e4SmiodOn most machines, you can also use @code{$} in symbol names; exceptions
22483d8817e4Smiodare noted in @ref{Machine Dependencies}.
22493d8817e4Smiod@end ifset
22503d8817e4SmiodNo symbol may begin with a digit.  Case is significant.
22513d8817e4SmiodThere is no length limit: all characters are significant.  Symbols are
22523d8817e4Smioddelimited by characters not in that set, or by the beginning of a file
22533d8817e4Smiod(since the source program must end with a newline, the end of a file is
22543d8817e4Smiodnot a possible symbol delimiter).  @xref{Symbols}.
22553d8817e4Smiod@cindex length of symbols
22563d8817e4Smiod
22573d8817e4Smiod@node Statements
22583d8817e4Smiod@section Statements
22593d8817e4Smiod
22603d8817e4Smiod@cindex statements, structure of
22613d8817e4Smiod@cindex line separator character
22623d8817e4Smiod@cindex statement separator character
22633d8817e4Smiod@ifclear GENERIC
22643d8817e4Smiod@ifclear abnormal-separator
22653d8817e4SmiodA @dfn{statement} ends at a newline character (@samp{\n}) or at a
22663d8817e4Smiodsemicolon (@samp{;}).  The newline or semicolon is considered part of
22673d8817e4Smiodthe preceding statement.  Newlines and semicolons within character
22683d8817e4Smiodconstants are an exception: they do not end statements.
22693d8817e4Smiod@end ifclear
22703d8817e4Smiod@ifset abnormal-separator
22713d8817e4Smiod@ifset HPPA
22723d8817e4SmiodA @dfn{statement} ends at a newline character (@samp{\n}) or an exclamation
22733d8817e4Smiodpoint (@samp{!}).  The newline or exclamation point is considered part of the
22743d8817e4Smiodpreceding statement.  Newlines and exclamation points within character
22753d8817e4Smiodconstants are an exception: they do not end statements.
22763d8817e4Smiod@end ifset
22773d8817e4Smiod@ifset H8
22783d8817e4SmiodA @dfn{statement} ends at a newline character (@samp{\n}); or (for the
22793d8817e4SmiodH8/300) a dollar sign (@samp{$}); or (for the Renesas-SH) a semicolon
22803d8817e4Smiod(@samp{;}).  The newline or separator character is considered part of
22813d8817e4Smiodthe preceding statement.  Newlines and separators within character
22823d8817e4Smiodconstants are an exception: they do not end statements.
22833d8817e4Smiod@end ifset
22843d8817e4Smiod@end ifset
22853d8817e4Smiod@end ifclear
22863d8817e4Smiod@ifset GENERIC
22873d8817e4SmiodA @dfn{statement} ends at a newline character (@samp{\n}) or line
22883d8817e4Smiodseparator character.  (The line separator is usually @samp{;}, unless
22893d8817e4Smiodthis conflicts with the comment character; @pxref{Machine Dependencies}.)  The
22903d8817e4Smiodnewline or separator character is considered part of the preceding
22913d8817e4Smiodstatement.  Newlines and separators within character constants are an
22923d8817e4Smiodexception: they do not end statements.
22933d8817e4Smiod@end ifset
22943d8817e4Smiod
22953d8817e4Smiod@cindex newline, required at file end
22963d8817e4Smiod@cindex EOF, newline must precede
22973d8817e4SmiodIt is an error to end any statement with end-of-file:  the last
22983d8817e4Smiodcharacter of any input file should be a newline.@refill
22993d8817e4Smiod
23003d8817e4SmiodAn empty statement is allowed, and may include whitespace.  It is ignored.
23013d8817e4Smiod
23023d8817e4Smiod@cindex instructions and directives
23033d8817e4Smiod@cindex directives and instructions
23043d8817e4Smiod@c "key symbol" is not used elsewhere in the document; seems pedantic to
23053d8817e4Smiod@c @defn{} it in that case, as was done previously...  doc@cygnus.com,
23063d8817e4Smiod@c 13feb91.
23073d8817e4SmiodA statement begins with zero or more labels, optionally followed by a
23083d8817e4Smiodkey symbol which determines what kind of statement it is.  The key
23093d8817e4Smiodsymbol determines the syntax of the rest of the statement.  If the
23103d8817e4Smiodsymbol begins with a dot @samp{.} then the statement is an assembler
23113d8817e4Smioddirective: typically valid for any computer.  If the symbol begins with
23123d8817e4Smioda letter the statement is an assembly language @dfn{instruction}: it
23133d8817e4Smiodassembles into a machine language instruction.
23143d8817e4Smiod@ifset GENERIC
23153d8817e4SmiodDifferent versions of @command{@value{AS}} for different computers
23163d8817e4Smiodrecognize different instructions.  In fact, the same symbol may
23173d8817e4Smiodrepresent a different instruction in a different computer's assembly
23183d8817e4Smiodlanguage.@refill
23193d8817e4Smiod@end ifset
23203d8817e4Smiod
23213d8817e4Smiod@cindex @code{:} (label)
23223d8817e4Smiod@cindex label (@code{:})
23233d8817e4SmiodA label is a symbol immediately followed by a colon (@code{:}).
23243d8817e4SmiodWhitespace before a label or after a colon is permitted, but you may not
23253d8817e4Smiodhave whitespace between a label's symbol and its colon. @xref{Labels}.
23263d8817e4Smiod
23273d8817e4Smiod@ifset HPPA
23283d8817e4SmiodFor HPPA targets, labels need not be immediately followed by a colon, but
23293d8817e4Smiodthe definition of a label must begin in column zero.  This also implies that
23303d8817e4Smiodonly one label may be defined on each line.
23313d8817e4Smiod@end ifset
23323d8817e4Smiod
23333d8817e4Smiod@smallexample
23343d8817e4Smiodlabel:     .directive    followed by something
23353d8817e4Smiodanother_label:           # This is an empty statement.
23363d8817e4Smiod           instruction   operand_1, operand_2, @dots{}
23373d8817e4Smiod@end smallexample
23383d8817e4Smiod
23393d8817e4Smiod@node Constants
23403d8817e4Smiod@section Constants
23413d8817e4Smiod
23423d8817e4Smiod@cindex constants
23433d8817e4SmiodA constant is a number, written so that its value is known by
23443d8817e4Smiodinspection, without knowing any context.  Like this:
23453d8817e4Smiod@smallexample
23463d8817e4Smiod@group
23473d8817e4Smiod.byte  74, 0112, 092, 0x4A, 0X4a, 'J, '\J # All the same value.
23483d8817e4Smiod.ascii "Ring the bell\7"                  # A string constant.
23493d8817e4Smiod.octa  0x123456789abcdef0123456789ABCDEF0 # A bignum.
23503d8817e4Smiod.float 0f-314159265358979323846264338327\
23513d8817e4Smiod95028841971.693993751E-40                 # - pi, a flonum.
23523d8817e4Smiod@end group
23533d8817e4Smiod@end smallexample
23543d8817e4Smiod
23553d8817e4Smiod@menu
23563d8817e4Smiod* Characters::                  Character Constants
23573d8817e4Smiod* Numbers::                     Number Constants
23583d8817e4Smiod@end menu
23593d8817e4Smiod
23603d8817e4Smiod@node Characters
23613d8817e4Smiod@subsection Character Constants
23623d8817e4Smiod
23633d8817e4Smiod@cindex character constants
23643d8817e4Smiod@cindex constants, character
23653d8817e4SmiodThere are two kinds of character constants.  A @dfn{character} stands
23663d8817e4Smiodfor one character in one byte and its value may be used in
23673d8817e4Smiodnumeric expressions.  String constants (properly called string
23683d8817e4Smiod@emph{literals}) are potentially many bytes and their values may not be
23693d8817e4Smiodused in arithmetic expressions.
23703d8817e4Smiod
23713d8817e4Smiod@menu
23723d8817e4Smiod* Strings::                     Strings
23733d8817e4Smiod* Chars::                       Characters
23743d8817e4Smiod@end menu
23753d8817e4Smiod
23763d8817e4Smiod@node Strings
23773d8817e4Smiod@subsubsection Strings
23783d8817e4Smiod
23793d8817e4Smiod@cindex string constants
23803d8817e4Smiod@cindex constants, string
23813d8817e4SmiodA @dfn{string} is written between double-quotes.  It may contain
23823d8817e4Smioddouble-quotes or null characters.  The way to get special characters
23833d8817e4Smiodinto a string is to @dfn{escape} these characters: precede them with
23843d8817e4Smioda backslash @samp{\} character.  For example @samp{\\} represents
23853d8817e4Smiodone backslash:  the first @code{\} is an escape which tells
23863d8817e4Smiod@command{@value{AS}} to interpret the second character literally as a backslash
23873d8817e4Smiod(which prevents @command{@value{AS}} from recognizing the second @code{\} as an
23883d8817e4Smiodescape character).  The complete list of escapes follows.
23893d8817e4Smiod
23903d8817e4Smiod@cindex escape codes, character
23913d8817e4Smiod@cindex character escape codes
23923d8817e4Smiod@table @kbd
23933d8817e4Smiod@c      @item \a
23943d8817e4Smiod@c      Mnemonic for ACKnowledge; for ASCII this is octal code 007.
23953d8817e4Smiod@c
23963d8817e4Smiod@cindex @code{\b} (backspace character)
23973d8817e4Smiod@cindex backspace (@code{\b})
23983d8817e4Smiod@item \b
23993d8817e4SmiodMnemonic for backspace; for ASCII this is octal code 010.
24003d8817e4Smiod
24013d8817e4Smiod@c      @item \e
24023d8817e4Smiod@c      Mnemonic for EOText; for ASCII this is octal code 004.
24033d8817e4Smiod@c
24043d8817e4Smiod@cindex @code{\f} (formfeed character)
24053d8817e4Smiod@cindex formfeed (@code{\f})
24063d8817e4Smiod@item \f
24073d8817e4SmiodMnemonic for FormFeed; for ASCII this is octal code 014.
24083d8817e4Smiod
24093d8817e4Smiod@cindex @code{\n} (newline character)
24103d8817e4Smiod@cindex newline (@code{\n})
24113d8817e4Smiod@item \n
24123d8817e4SmiodMnemonic for newline; for ASCII this is octal code 012.
24133d8817e4Smiod
24143d8817e4Smiod@c      @item \p
24153d8817e4Smiod@c      Mnemonic for prefix; for ASCII this is octal code 033, usually known as @code{escape}.
24163d8817e4Smiod@c
24173d8817e4Smiod@cindex @code{\r} (carriage return character)
24183d8817e4Smiod@cindex carriage return (@code{\r})
24193d8817e4Smiod@item \r
24203d8817e4SmiodMnemonic for carriage-Return; for ASCII this is octal code 015.
24213d8817e4Smiod
24223d8817e4Smiod@c      @item \s
24233d8817e4Smiod@c      Mnemonic for space; for ASCII this is octal code 040.  Included for compliance with
24243d8817e4Smiod@c      other assemblers.
24253d8817e4Smiod@c
24263d8817e4Smiod@cindex @code{\t} (tab)
24273d8817e4Smiod@cindex tab (@code{\t})
24283d8817e4Smiod@item \t
24293d8817e4SmiodMnemonic for horizontal Tab; for ASCII this is octal code 011.
24303d8817e4Smiod
24313d8817e4Smiod@c      @item \v
24323d8817e4Smiod@c      Mnemonic for Vertical tab; for ASCII this is octal code 013.
24333d8817e4Smiod@c      @item \x @var{digit} @var{digit} @var{digit}
24343d8817e4Smiod@c      A hexadecimal character code.  The numeric code is 3 hexadecimal digits.
24353d8817e4Smiod@c
24363d8817e4Smiod@cindex @code{\@var{ddd}} (octal character code)
24373d8817e4Smiod@cindex octal character code (@code{\@var{ddd}})
24383d8817e4Smiod@item \ @var{digit} @var{digit} @var{digit}
24393d8817e4SmiodAn octal character code.  The numeric code is 3 octal digits.
24403d8817e4SmiodFor compatibility with other Unix systems, 8 and 9 are accepted as digits:
24413d8817e4Smiodfor example, @code{\008} has the value 010, and @code{\009} the value 011.
24423d8817e4Smiod
24433d8817e4Smiod@cindex @code{\@var{xd...}} (hex character code)
24443d8817e4Smiod@cindex hex character code (@code{\@var{xd...}})
24453d8817e4Smiod@item \@code{x} @var{hex-digits...}
24463d8817e4SmiodA hex character code.  All trailing hex digits are combined.  Either upper or
24473d8817e4Smiodlower case @code{x} works.
24483d8817e4Smiod
24493d8817e4Smiod@cindex @code{\\} (@samp{\} character)
24503d8817e4Smiod@cindex backslash (@code{\\})
24513d8817e4Smiod@item \\
24523d8817e4SmiodRepresents one @samp{\} character.
24533d8817e4Smiod
24543d8817e4Smiod@c      @item \'
24553d8817e4Smiod@c      Represents one @samp{'} (accent acute) character.
24563d8817e4Smiod@c      This is needed in single character literals
24573d8817e4Smiod@c      (@xref{Characters,,Character Constants}.) to represent
24583d8817e4Smiod@c      a @samp{'}.
24593d8817e4Smiod@c
24603d8817e4Smiod@cindex @code{\"} (doublequote character)
24613d8817e4Smiod@cindex doublequote (@code{\"})
24623d8817e4Smiod@item \"
24633d8817e4SmiodRepresents one @samp{"} character.  Needed in strings to represent
24643d8817e4Smiodthis character, because an unescaped @samp{"} would end the string.
24653d8817e4Smiod
24663d8817e4Smiod@item \ @var{anything-else}
24673d8817e4SmiodAny other character when escaped by @kbd{\} gives a warning, but
24683d8817e4Smiodassembles as if the @samp{\} was not present.  The idea is that if
24693d8817e4Smiodyou used an escape sequence you clearly didn't want the literal
24703d8817e4Smiodinterpretation of the following character.  However @command{@value{AS}} has no
24713d8817e4Smiodother interpretation, so @command{@value{AS}} knows it is giving you the wrong
24723d8817e4Smiodcode and warns you of the fact.
24733d8817e4Smiod@end table
24743d8817e4Smiod
24753d8817e4SmiodWhich characters are escapable, and what those escapes represent,
24763d8817e4Smiodvaries widely among assemblers.  The current set is what we think
24773d8817e4Smiodthe BSD 4.2 assembler recognizes, and is a subset of what most C
24783d8817e4Smiodcompilers recognize.  If you are in doubt, do not use an escape
24793d8817e4Smiodsequence.
24803d8817e4Smiod
24813d8817e4Smiod@node Chars
24823d8817e4Smiod@subsubsection Characters
24833d8817e4Smiod
24843d8817e4Smiod@cindex single character constant
24853d8817e4Smiod@cindex character, single
24863d8817e4Smiod@cindex constant, single character
24873d8817e4SmiodA single character may be written as a single quote immediately
24883d8817e4Smiodfollowed by that character.  The same escapes apply to characters as
24893d8817e4Smiodto strings.  So if you want to write the character backslash, you
24903d8817e4Smiodmust write @kbd{'\\} where the first @code{\} escapes the second
24913d8817e4Smiod@code{\}.  As you can see, the quote is an acute accent, not a
24923d8817e4Smiodgrave accent.  A newline
24933d8817e4Smiod@ifclear GENERIC
24943d8817e4Smiod@ifclear abnormal-separator
24953d8817e4Smiod(or semicolon @samp{;})
24963d8817e4Smiod@end ifclear
24973d8817e4Smiod@ifset abnormal-separator
24983d8817e4Smiod@ifset H8
24993d8817e4Smiod(or dollar sign @samp{$}, for the H8/300; or semicolon @samp{;} for the
25003d8817e4SmiodRenesas SH)
25013d8817e4Smiod@end ifset
25023d8817e4Smiod@end ifset
25033d8817e4Smiod@end ifclear
25043d8817e4Smiodimmediately following an acute accent is taken as a literal character
25053d8817e4Smiodand does not count as the end of a statement.  The value of a character
25063d8817e4Smiodconstant in a numeric expression is the machine's byte-wide code for
25073d8817e4Smiodthat character.  @command{@value{AS}} assumes your character code is ASCII:
25083d8817e4Smiod@kbd{'A} means 65, @kbd{'B} means 66, and so on. @refill
25093d8817e4Smiod
25103d8817e4Smiod@node Numbers
25113d8817e4Smiod@subsection Number Constants
25123d8817e4Smiod
25133d8817e4Smiod@cindex constants, number
25143d8817e4Smiod@cindex number constants
25153d8817e4Smiod@command{@value{AS}} distinguishes three kinds of numbers according to how they
25163d8817e4Smiodare stored in the target machine.  @emph{Integers} are numbers that
25173d8817e4Smiodwould fit into an @code{int} in the C language.  @emph{Bignums} are
25183d8817e4Smiodintegers, but they are stored in more than 32 bits.  @emph{Flonums}
25193d8817e4Smiodare floating point numbers, described below.
25203d8817e4Smiod
25213d8817e4Smiod@menu
25223d8817e4Smiod* Integers::                    Integers
25233d8817e4Smiod* Bignums::                     Bignums
25243d8817e4Smiod* Flonums::                     Flonums
25253d8817e4Smiod@ifclear GENERIC
25263d8817e4Smiod@ifset I960
25273d8817e4Smiod* Bit Fields::                  Bit Fields
25283d8817e4Smiod@end ifset
25293d8817e4Smiod@end ifclear
25303d8817e4Smiod@end menu
25313d8817e4Smiod
25323d8817e4Smiod@node Integers
25333d8817e4Smiod@subsubsection Integers
25343d8817e4Smiod@cindex integers
25353d8817e4Smiod@cindex constants, integer
25363d8817e4Smiod
25373d8817e4Smiod@cindex binary integers
25383d8817e4Smiod@cindex integers, binary
25393d8817e4SmiodA binary integer is @samp{0b} or @samp{0B} followed by zero or more of
25403d8817e4Smiodthe binary digits @samp{01}.
25413d8817e4Smiod
25423d8817e4Smiod@cindex octal integers
25433d8817e4Smiod@cindex integers, octal
25443d8817e4SmiodAn octal integer is @samp{0} followed by zero or more of the octal
25453d8817e4Smioddigits (@samp{01234567}).
25463d8817e4Smiod
25473d8817e4Smiod@cindex decimal integers
25483d8817e4Smiod@cindex integers, decimal
25493d8817e4SmiodA decimal integer starts with a non-zero digit followed by zero or
25503d8817e4Smiodmore digits (@samp{0123456789}).
25513d8817e4Smiod
25523d8817e4Smiod@cindex hexadecimal integers
25533d8817e4Smiod@cindex integers, hexadecimal
25543d8817e4SmiodA hexadecimal integer is @samp{0x} or @samp{0X} followed by one or
25553d8817e4Smiodmore hexadecimal digits chosen from @samp{0123456789abcdefABCDEF}.
25563d8817e4Smiod
25573d8817e4SmiodIntegers have the usual values.  To denote a negative integer, use
25583d8817e4Smiodthe prefix operator @samp{-} discussed under expressions
25593d8817e4Smiod(@pxref{Prefix Ops,,Prefix Operators}).
25603d8817e4Smiod
25613d8817e4Smiod@node Bignums
25623d8817e4Smiod@subsubsection Bignums
25633d8817e4Smiod
25643d8817e4Smiod@cindex bignums
25653d8817e4Smiod@cindex constants, bignum
25663d8817e4SmiodA @dfn{bignum} has the same syntax and semantics as an integer
25673d8817e4Smiodexcept that the number (or its negative) takes more than 32 bits to
25683d8817e4Smiodrepresent in binary.  The distinction is made because in some places
25693d8817e4Smiodintegers are permitted while bignums are not.
25703d8817e4Smiod
25713d8817e4Smiod@node Flonums
25723d8817e4Smiod@subsubsection Flonums
25733d8817e4Smiod@cindex flonums
25743d8817e4Smiod@cindex floating point numbers
25753d8817e4Smiod@cindex constants, floating point
25763d8817e4Smiod
25773d8817e4Smiod@cindex precision, floating point
25783d8817e4SmiodA @dfn{flonum} represents a floating point number.  The translation is
25793d8817e4Smiodindirect: a decimal floating point number from the text is converted by
25803d8817e4Smiod@command{@value{AS}} to a generic binary floating point number of more than
25813d8817e4Smiodsufficient precision.  This generic floating point number is converted
25823d8817e4Smiodto a particular computer's floating point format (or formats) by a
25833d8817e4Smiodportion of @command{@value{AS}} specialized to that computer.
25843d8817e4Smiod
25853d8817e4SmiodA flonum is written by writing (in order)
25863d8817e4Smiod@itemize @bullet
25873d8817e4Smiod@item
25883d8817e4SmiodThe digit @samp{0}.
25893d8817e4Smiod@ifset HPPA
25903d8817e4Smiod(@samp{0} is optional on the HPPA.)
25913d8817e4Smiod@end ifset
25923d8817e4Smiod
25933d8817e4Smiod@item
25943d8817e4SmiodA letter, to tell @command{@value{AS}} the rest of the number is a flonum.
25953d8817e4Smiod@ifset GENERIC
25963d8817e4Smiod@kbd{e} is recommended.  Case is not important.
25973d8817e4Smiod@ignore
25983d8817e4Smiod@c FIXME: verify if flonum syntax really this vague for most cases
25993d8817e4Smiod(Any otherwise illegal letter works here, but that might be changed.  Vax BSD
26003d8817e4Smiod4.2 assembler seems to allow any of @samp{defghDEFGH}.)
26013d8817e4Smiod@end ignore
26023d8817e4Smiod
26033d8817e4SmiodOn the H8/300, Renesas / SuperH SH,
26043d8817e4Smiodand AMD 29K architectures, the letter must be
26053d8817e4Smiodone of the letters @samp{DFPRSX} (in upper or lower case).
26063d8817e4Smiod
26073d8817e4SmiodOn the ARC, the letter must be one of the letters @samp{DFRS}
26083d8817e4Smiod(in upper or lower case).
26093d8817e4Smiod
26103d8817e4SmiodOn the Intel 960 architecture, the letter must be
26113d8817e4Smiodone of the letters @samp{DFT} (in upper or lower case).
26123d8817e4Smiod
26133d8817e4SmiodOn the HPPA architecture, the letter must be @samp{E} (upper case only).
26143d8817e4Smiod@end ifset
26153d8817e4Smiod@ifclear GENERIC
26163d8817e4Smiod@ifset ARC
26173d8817e4SmiodOne of the letters @samp{DFRS} (in upper or lower case).
26183d8817e4Smiod@end ifset
26193d8817e4Smiod@ifset H8
26203d8817e4SmiodOne of the letters @samp{DFPRSX} (in upper or lower case).
26213d8817e4Smiod@end ifset
26223d8817e4Smiod@ifset HPPA
26233d8817e4SmiodThe letter @samp{E} (upper case only).
26243d8817e4Smiod@end ifset
26253d8817e4Smiod@ifset I960
26263d8817e4SmiodOne of the letters @samp{DFT} (in upper or lower case).
26273d8817e4Smiod@end ifset
26283d8817e4Smiod@end ifclear
26293d8817e4Smiod
26303d8817e4Smiod@item
26313d8817e4SmiodAn optional sign: either @samp{+} or @samp{-}.
26323d8817e4Smiod
26333d8817e4Smiod@item
26343d8817e4SmiodAn optional @dfn{integer part}: zero or more decimal digits.
26353d8817e4Smiod
26363d8817e4Smiod@item
26373d8817e4SmiodAn optional @dfn{fractional part}: @samp{.} followed by zero
26383d8817e4Smiodor more decimal digits.
26393d8817e4Smiod
26403d8817e4Smiod@item
26413d8817e4SmiodAn optional exponent, consisting of:
26423d8817e4Smiod
26433d8817e4Smiod@itemize @bullet
26443d8817e4Smiod@item
26453d8817e4SmiodAn @samp{E} or @samp{e}.
26463d8817e4Smiod@c I can't find a config where "EXP_CHARS" is other than 'eE', but in
26473d8817e4Smiod@c principle this can perfectly well be different on different targets.
26483d8817e4Smiod@item
26493d8817e4SmiodOptional sign: either @samp{+} or @samp{-}.
26503d8817e4Smiod@item
26513d8817e4SmiodOne or more decimal digits.
26523d8817e4Smiod@end itemize
26533d8817e4Smiod
26543d8817e4Smiod@end itemize
26553d8817e4Smiod
26563d8817e4SmiodAt least one of the integer part or the fractional part must be
26573d8817e4Smiodpresent.  The floating point number has the usual base-10 value.
26583d8817e4Smiod
26593d8817e4Smiod@command{@value{AS}} does all processing using integers.  Flonums are computed
26603d8817e4Smiodindependently of any floating point hardware in the computer running
26613d8817e4Smiod@command{@value{AS}}.
26623d8817e4Smiod
26633d8817e4Smiod@ifclear GENERIC
26643d8817e4Smiod@ifset I960
26653d8817e4Smiod@c Bit fields are written as a general facility but are also controlled
26663d8817e4Smiod@c by a conditional-compilation flag---which is as of now (21mar91)
26673d8817e4Smiod@c turned on only by the i960 config of GAS.
26683d8817e4Smiod@node Bit Fields
26693d8817e4Smiod@subsubsection Bit Fields
26703d8817e4Smiod
26713d8817e4Smiod@cindex bit fields
26723d8817e4Smiod@cindex constants, bit field
26733d8817e4SmiodYou can also define numeric constants as @dfn{bit fields}.
26743d8817e4Smiodspecify two numbers separated by a colon---
26753d8817e4Smiod@example
26763d8817e4Smiod@var{mask}:@var{value}
26773d8817e4Smiod@end example
26783d8817e4Smiod@noindent
26793d8817e4Smiod@command{@value{AS}} applies a bitwise @sc{and} between @var{mask} and
26803d8817e4Smiod@var{value}.
26813d8817e4Smiod
26823d8817e4SmiodThe resulting number is then packed
26833d8817e4Smiod@ifset GENERIC
26843d8817e4Smiod@c this conditional paren in case bit fields turned on elsewhere than 960
26853d8817e4Smiod(in host-dependent byte order)
26863d8817e4Smiod@end ifset
26873d8817e4Smiodinto a field whose width depends on which assembler directive has the
26883d8817e4Smiodbit-field as its argument.  Overflow (a result from the bitwise and
26893d8817e4Smiodrequiring more binary digits to represent) is not an error; instead,
26903d8817e4Smiodmore constants are generated, of the specified width, beginning with the
26913d8817e4Smiodleast significant digits.@refill
26923d8817e4Smiod
26933d8817e4SmiodThe directives @code{.byte}, @code{.hword}, @code{.int}, @code{.long},
26943d8817e4Smiod@code{.short}, and @code{.word} accept bit-field arguments.
26953d8817e4Smiod@end ifset
26963d8817e4Smiod@end ifclear
26973d8817e4Smiod
26983d8817e4Smiod@node Sections
26993d8817e4Smiod@chapter Sections and Relocation
27003d8817e4Smiod@cindex sections
27013d8817e4Smiod@cindex relocation
27023d8817e4Smiod
27033d8817e4Smiod@menu
27043d8817e4Smiod* Secs Background::             Background
27053d8817e4Smiod* Ld Sections::                 Linker Sections
27063d8817e4Smiod* As Sections::                 Assembler Internal Sections
27073d8817e4Smiod* Sub-Sections::                Sub-Sections
27083d8817e4Smiod* bss::                         bss Section
27093d8817e4Smiod@end menu
27103d8817e4Smiod
27113d8817e4Smiod@node Secs Background
27123d8817e4Smiod@section Background
27133d8817e4Smiod
27143d8817e4SmiodRoughly, a section is a range of addresses, with no gaps; all data
27153d8817e4Smiod``in'' those addresses is treated the same for some particular purpose.
27163d8817e4SmiodFor example there may be a ``read only'' section.
27173d8817e4Smiod
27183d8817e4Smiod@cindex linker, and assembler
27193d8817e4Smiod@cindex assembler, and linker
27203d8817e4SmiodThe linker @code{@value{LD}} reads many object files (partial programs) and
27213d8817e4Smiodcombines their contents to form a runnable program.  When @command{@value{AS}}
27223d8817e4Smiodemits an object file, the partial program is assumed to start at address 0.
27233d8817e4Smiod@code{@value{LD}} assigns the final addresses for the partial program, so that
27243d8817e4Smioddifferent partial programs do not overlap.  This is actually an
27253d8817e4Smiodoversimplification, but it suffices to explain how @command{@value{AS}} uses
27263d8817e4Smiodsections.
27273d8817e4Smiod
27283d8817e4Smiod@code{@value{LD}} moves blocks of bytes of your program to their run-time
27293d8817e4Smiodaddresses.  These blocks slide to their run-time addresses as rigid
27303d8817e4Smiodunits; their length does not change and neither does the order of bytes
27313d8817e4Smiodwithin them.  Such a rigid unit is called a @emph{section}.  Assigning
27323d8817e4Smiodrun-time addresses to sections is called @dfn{relocation}.  It includes
27333d8817e4Smiodthe task of adjusting mentions of object-file addresses so they refer to
27343d8817e4Smiodthe proper run-time addresses.
27353d8817e4Smiod@ifset H8
27363d8817e4SmiodFor the H8/300, and for the Renesas / SuperH SH,
27373d8817e4Smiod@command{@value{AS}} pads sections if needed to
27383d8817e4Smiodensure they end on a word (sixteen bit) boundary.
27393d8817e4Smiod@end ifset
27403d8817e4Smiod
27413d8817e4Smiod@cindex standard assembler sections
27423d8817e4SmiodAn object file written by @command{@value{AS}} has at least three sections, any
27433d8817e4Smiodof which may be empty.  These are named @dfn{text}, @dfn{data} and
27443d8817e4Smiod@dfn{bss} sections.
27453d8817e4Smiod
27463d8817e4Smiod@ifset COFF-ELF
27473d8817e4Smiod@ifset GENERIC
27483d8817e4SmiodWhen it generates COFF or ELF output,
27493d8817e4Smiod@end ifset
27503d8817e4Smiod@command{@value{AS}} can also generate whatever other named sections you specify
27513d8817e4Smiodusing the @samp{.section} directive (@pxref{Section,,@code{.section}}).
27523d8817e4SmiodIf you do not use any directives that place output in the @samp{.text}
27533d8817e4Smiodor @samp{.data} sections, these sections still exist, but are empty.
27543d8817e4Smiod@end ifset
27553d8817e4Smiod
27563d8817e4Smiod@ifset HPPA
27573d8817e4Smiod@ifset GENERIC
27583d8817e4SmiodWhen @command{@value{AS}} generates SOM or ELF output for the HPPA,
27593d8817e4Smiod@end ifset
27603d8817e4Smiod@command{@value{AS}} can also generate whatever other named sections you
27613d8817e4Smiodspecify using the @samp{.space} and @samp{.subspace} directives.  See
27623d8817e4Smiod@cite{HP9000 Series 800 Assembly Language Reference Manual}
27633d8817e4Smiod(HP 92432-90001) for details on the @samp{.space} and @samp{.subspace}
27643d8817e4Smiodassembler directives.
27653d8817e4Smiod
27663d8817e4Smiod@ifset SOM
27673d8817e4SmiodAdditionally, @command{@value{AS}} uses different names for the standard
27683d8817e4Smiodtext, data, and bss sections when generating SOM output.  Program text
27693d8817e4Smiodis placed into the @samp{$CODE$} section, data into @samp{$DATA$}, and
27703d8817e4SmiodBSS into @samp{$BSS$}.
27713d8817e4Smiod@end ifset
27723d8817e4Smiod@end ifset
27733d8817e4Smiod
27743d8817e4SmiodWithin the object file, the text section starts at address @code{0}, the
27753d8817e4Smioddata section follows, and the bss section follows the data section.
27763d8817e4Smiod
27773d8817e4Smiod@ifset HPPA
27783d8817e4SmiodWhen generating either SOM or ELF output files on the HPPA, the text
27793d8817e4Smiodsection starts at address @code{0}, the data section at address
27803d8817e4Smiod@code{0x4000000}, and the bss section follows the data section.
27813d8817e4Smiod@end ifset
27823d8817e4Smiod
27833d8817e4SmiodTo let @code{@value{LD}} know which data changes when the sections are
27843d8817e4Smiodrelocated, and how to change that data, @command{@value{AS}} also writes to the
27853d8817e4Smiodobject file details of the relocation needed.  To perform relocation
27863d8817e4Smiod@code{@value{LD}} must know, each time an address in the object
27873d8817e4Smiodfile is mentioned:
27883d8817e4Smiod@itemize @bullet
27893d8817e4Smiod@item
27903d8817e4SmiodWhere in the object file is the beginning of this reference to
27913d8817e4Smiodan address?
27923d8817e4Smiod@item
27933d8817e4SmiodHow long (in bytes) is this reference?
27943d8817e4Smiod@item
27953d8817e4SmiodWhich section does the address refer to?  What is the numeric value of
27963d8817e4Smiod@display
27973d8817e4Smiod(@var{address}) @minus{} (@var{start-address of section})?
27983d8817e4Smiod@end display
27993d8817e4Smiod@item
28003d8817e4SmiodIs the reference to an address ``Program-Counter relative''?
28013d8817e4Smiod@end itemize
28023d8817e4Smiod
28033d8817e4Smiod@cindex addresses, format of
28043d8817e4Smiod@cindex section-relative addressing
28053d8817e4SmiodIn fact, every address @command{@value{AS}} ever uses is expressed as
28063d8817e4Smiod@display
28073d8817e4Smiod(@var{section}) + (@var{offset into section})
28083d8817e4Smiod@end display
28093d8817e4Smiod@noindent
28103d8817e4SmiodFurther, most expressions @command{@value{AS}} computes have this section-relative
28113d8817e4Smiodnature.
28123d8817e4Smiod@ifset SOM
28133d8817e4Smiod(For some object formats, such as SOM for the HPPA, some expressions are
28143d8817e4Smiodsymbol-relative instead.)
28153d8817e4Smiod@end ifset
28163d8817e4Smiod
28173d8817e4SmiodIn this manual we use the notation @{@var{secname} @var{N}@} to mean ``offset
28183d8817e4Smiod@var{N} into section @var{secname}.''
28193d8817e4Smiod
28203d8817e4SmiodApart from text, data and bss sections you need to know about the
28213d8817e4Smiod@dfn{absolute} section.  When @code{@value{LD}} mixes partial programs,
28223d8817e4Smiodaddresses in the absolute section remain unchanged.  For example, address
28233d8817e4Smiod@code{@{absolute 0@}} is ``relocated'' to run-time address 0 by
28243d8817e4Smiod@code{@value{LD}}.  Although the linker never arranges two partial programs'
28253d8817e4Smioddata sections with overlapping addresses after linking, @emph{by definition}
28263d8817e4Smiodtheir absolute sections must overlap.  Address @code{@{absolute@ 239@}} in one
28273d8817e4Smiodpart of a program is always the same address when the program is running as
28283d8817e4Smiodaddress @code{@{absolute@ 239@}} in any other part of the program.
28293d8817e4Smiod
28303d8817e4SmiodThe idea of sections is extended to the @dfn{undefined} section.  Any
28313d8817e4Smiodaddress whose section is unknown at assembly time is by definition
28323d8817e4Smiodrendered @{undefined @var{U}@}---where @var{U} is filled in later.
28333d8817e4SmiodSince numbers are always defined, the only way to generate an undefined
28343d8817e4Smiodaddress is to mention an undefined symbol.  A reference to a named
28353d8817e4Smiodcommon block would be such a symbol: its value is unknown at assembly
28363d8817e4Smiodtime so it has section @emph{undefined}.
28373d8817e4Smiod
28383d8817e4SmiodBy analogy the word @emph{section} is used to describe groups of sections in
28393d8817e4Smiodthe linked program.  @code{@value{LD}} puts all partial programs' text
28403d8817e4Smiodsections in contiguous addresses in the linked program.  It is
28413d8817e4Smiodcustomary to refer to the @emph{text section} of a program, meaning all
28423d8817e4Smiodthe addresses of all partial programs' text sections.  Likewise for
28433d8817e4Smioddata and bss sections.
28443d8817e4Smiod
28453d8817e4SmiodSome sections are manipulated by @code{@value{LD}}; others are invented for
28463d8817e4Smioduse of @command{@value{AS}} and have no meaning except during assembly.
28473d8817e4Smiod
28483d8817e4Smiod@node Ld Sections
28493d8817e4Smiod@section Linker Sections
28503d8817e4Smiod@code{@value{LD}} deals with just four kinds of sections, summarized below.
28513d8817e4Smiod
28523d8817e4Smiod@table @strong
28533d8817e4Smiod
28543d8817e4Smiod@ifset COFF-ELF
28553d8817e4Smiod@cindex named sections
28563d8817e4Smiod@cindex sections, named
28573d8817e4Smiod@item named sections
28583d8817e4Smiod@end ifset
28593d8817e4Smiod@ifset aout-bout
28603d8817e4Smiod@cindex text section
28613d8817e4Smiod@cindex data section
28623d8817e4Smiod@itemx text section
28633d8817e4Smiod@itemx data section
28643d8817e4Smiod@end ifset
28653d8817e4SmiodThese sections hold your program.  @command{@value{AS}} and @code{@value{LD}} treat them as
28663d8817e4Smiodseparate but equal sections.  Anything you can say of one section is
28673d8817e4Smiodtrue of another.
28683d8817e4Smiod@c @ifset aout-bout
28693d8817e4SmiodWhen the program is running, however, it is
28703d8817e4Smiodcustomary for the text section to be unalterable.  The
28713d8817e4Smiodtext section is often shared among processes: it contains
28723d8817e4Smiodinstructions, constants and the like.  The data section of a running
28733d8817e4Smiodprogram is usually alterable: for example, C variables would be stored
28743d8817e4Smiodin the data section.
28753d8817e4Smiod@c @end ifset
28763d8817e4Smiod
28773d8817e4Smiod@cindex bss section
28783d8817e4Smiod@item bss section
28793d8817e4SmiodThis section contains zeroed bytes when your program begins running.  It
28803d8817e4Smiodis used to hold uninitialized variables or common storage.  The length of
28813d8817e4Smiodeach partial program's bss section is important, but because it starts
28823d8817e4Smiodout containing zeroed bytes there is no need to store explicit zero
28833d8817e4Smiodbytes in the object file.  The bss section was invented to eliminate
28843d8817e4Smiodthose explicit zeros from object files.
28853d8817e4Smiod
28863d8817e4Smiod@cindex absolute section
28873d8817e4Smiod@item absolute section
28883d8817e4SmiodAddress 0 of this section is always ``relocated'' to runtime address 0.
28893d8817e4SmiodThis is useful if you want to refer to an address that @code{@value{LD}} must
28903d8817e4Smiodnot change when relocating.  In this sense we speak of absolute
28913d8817e4Smiodaddresses being ``unrelocatable'': they do not change during relocation.
28923d8817e4Smiod
28933d8817e4Smiod@cindex undefined section
28943d8817e4Smiod@item undefined section
28953d8817e4SmiodThis ``section'' is a catch-all for address references to objects not in
28963d8817e4Smiodthe preceding sections.
28973d8817e4Smiod@c FIXME: ref to some other doc on obj-file formats could go here.
28983d8817e4Smiod@end table
28993d8817e4Smiod
29003d8817e4Smiod@cindex relocation example
29013d8817e4SmiodAn idealized example of three relocatable sections follows.
29023d8817e4Smiod@ifset COFF-ELF
29033d8817e4SmiodThe example uses the traditional section names @samp{.text} and @samp{.data}.
29043d8817e4Smiod@end ifset
29053d8817e4SmiodMemory addresses are on the horizontal axis.
29063d8817e4Smiod
29073d8817e4Smiod@c TEXI2ROFF-KILL
29083d8817e4Smiod@ifnottex
29093d8817e4Smiod@c END TEXI2ROFF-KILL
29103d8817e4Smiod@smallexample
29113d8817e4Smiod                      +-----+----+--+
29123d8817e4Smiodpartial program # 1:  |ttttt|dddd|00|
29133d8817e4Smiod                      +-----+----+--+
29143d8817e4Smiod
29153d8817e4Smiod                      text   data bss
29163d8817e4Smiod                      seg.   seg. seg.
29173d8817e4Smiod
29183d8817e4Smiod                      +---+---+---+
29193d8817e4Smiodpartial program # 2:  |TTT|DDD|000|
29203d8817e4Smiod                      +---+---+---+
29213d8817e4Smiod
29223d8817e4Smiod                      +--+---+-----+--+----+---+-----+~~
29233d8817e4Smiodlinked program:       |  |TTT|ttttt|  |dddd|DDD|00000|
29243d8817e4Smiod                      +--+---+-----+--+----+---+-----+~~
29253d8817e4Smiod
29263d8817e4Smiod    addresses:        0 @dots{}
29273d8817e4Smiod@end smallexample
29283d8817e4Smiod@c TEXI2ROFF-KILL
29293d8817e4Smiod@end ifnottex
29303d8817e4Smiod@need 5000
29313d8817e4Smiod@tex
29323d8817e4Smiod\bigskip
29333d8817e4Smiod\line{\it Partial program \#1: \hfil}
29343d8817e4Smiod\line{\ibox{2.5cm}{\tt text}\ibox{2cm}{\tt data}\ibox{1cm}{\tt bss}\hfil}
29353d8817e4Smiod\line{\boxit{2.5cm}{\tt ttttt}\boxit{2cm}{\tt dddd}\boxit{1cm}{\tt 00}\hfil}
29363d8817e4Smiod
29373d8817e4Smiod\line{\it Partial program \#2: \hfil}
29383d8817e4Smiod\line{\ibox{1cm}{\tt text}\ibox{1.5cm}{\tt data}\ibox{1cm}{\tt bss}\hfil}
29393d8817e4Smiod\line{\boxit{1cm}{\tt TTT}\boxit{1.5cm}{\tt DDDD}\boxit{1cm}{\tt 000}\hfil}
29403d8817e4Smiod
29413d8817e4Smiod\line{\it linked program: \hfil}
29423d8817e4Smiod\line{\ibox{.5cm}{}\ibox{1cm}{\tt text}\ibox{2.5cm}{}\ibox{.75cm}{}\ibox{2cm}{\tt data}\ibox{1.5cm}{}\ibox{2cm}{\tt bss}\hfil}
29433d8817e4Smiod\line{\boxit{.5cm}{}\boxit{1cm}{\tt TTT}\boxit{2.5cm}{\tt
29443d8817e4Smiodttttt}\boxit{.75cm}{}\boxit{2cm}{\tt dddd}\boxit{1.5cm}{\tt
29453d8817e4SmiodDDDD}\boxit{2cm}{\tt 00000}\ \dots\hfil}
29463d8817e4Smiod
29473d8817e4Smiod\line{\it addresses: \hfil}
29483d8817e4Smiod\line{0\dots\hfil}
29493d8817e4Smiod
29503d8817e4Smiod@end tex
29513d8817e4Smiod@c END TEXI2ROFF-KILL
29523d8817e4Smiod
29533d8817e4Smiod@node As Sections
29543d8817e4Smiod@section Assembler Internal Sections
29553d8817e4Smiod
29563d8817e4Smiod@cindex internal assembler sections
29573d8817e4Smiod@cindex sections in messages, internal
29583d8817e4SmiodThese sections are meant only for the internal use of @command{@value{AS}}.  They
29593d8817e4Smiodhave no meaning at run-time.  You do not really need to know about these
29603d8817e4Smiodsections for most purposes; but they can be mentioned in @command{@value{AS}}
29613d8817e4Smiodwarning messages, so it might be helpful to have an idea of their
29623d8817e4Smiodmeanings to @command{@value{AS}}.  These sections are used to permit the
29633d8817e4Smiodvalue of every expression in your assembly language program to be a
29643d8817e4Smiodsection-relative address.
29653d8817e4Smiod
29663d8817e4Smiod@table @b
29673d8817e4Smiod@cindex assembler internal logic error
29683d8817e4Smiod@item ASSEMBLER-INTERNAL-LOGIC-ERROR!
29693d8817e4SmiodAn internal assembler logic error has been found.  This means there is a
29703d8817e4Smiodbug in the assembler.
29713d8817e4Smiod
29723d8817e4Smiod@cindex expr (internal section)
29733d8817e4Smiod@item expr section
29743d8817e4SmiodThe assembler stores complex expression internally as combinations of
29753d8817e4Smiodsymbols.  When it needs to represent an expression as a symbol, it puts
29763d8817e4Smiodit in the expr section.
29773d8817e4Smiod@c FIXME item debug
29783d8817e4Smiod@c FIXME item transfer[t] vector preload
29793d8817e4Smiod@c FIXME item transfer[t] vector postload
29803d8817e4Smiod@c FIXME item register
29813d8817e4Smiod@end table
29823d8817e4Smiod
29833d8817e4Smiod@node Sub-Sections
29843d8817e4Smiod@section Sub-Sections
29853d8817e4Smiod
29863d8817e4Smiod@cindex numbered subsections
29873d8817e4Smiod@cindex grouping data
29883d8817e4Smiod@ifset aout-bout
29893d8817e4SmiodAssembled bytes
29903d8817e4Smiod@ifset COFF-ELF
29913d8817e4Smiodconventionally
29923d8817e4Smiod@end ifset
29933d8817e4Smiodfall into two sections: text and data.
29943d8817e4Smiod@end ifset
29953d8817e4SmiodYou may have separate groups of
29963d8817e4Smiod@ifset GENERIC
29973d8817e4Smioddata in named sections
29983d8817e4Smiod@end ifset
29993d8817e4Smiod@ifclear GENERIC
30003d8817e4Smiod@ifclear aout-bout
30013d8817e4Smioddata in named sections
30023d8817e4Smiod@end ifclear
30033d8817e4Smiod@ifset aout-bout
30043d8817e4Smiodtext or data
30053d8817e4Smiod@end ifset
30063d8817e4Smiod@end ifclear
30073d8817e4Smiodthat you want to end up near to each other in the object file, even though they
30083d8817e4Smiodare not contiguous in the assembler source.  @command{@value{AS}} allows you to
30093d8817e4Smioduse @dfn{subsections} for this purpose.  Within each section, there can be
30103d8817e4Smiodnumbered subsections with values from 0 to 8192.  Objects assembled into the
30113d8817e4Smiodsame subsection go into the object file together with other objects in the same
30123d8817e4Smiodsubsection.  For example, a compiler might want to store constants in the text
30133d8817e4Smiodsection, but might not want to have them interspersed with the program being
30143d8817e4Smiodassembled.  In this case, the compiler could issue a @samp{.text 0} before each
30153d8817e4Smiodsection of code being output, and a @samp{.text 1} before each group of
30163d8817e4Smiodconstants being output.
30173d8817e4Smiod
30183d8817e4SmiodSubsections are optional.  If you do not use subsections, everything
30193d8817e4Smiodgoes in subsection number zero.
30203d8817e4Smiod
30213d8817e4Smiod@ifset GENERIC
30223d8817e4SmiodEach subsection is zero-padded up to a multiple of four bytes.
30233d8817e4Smiod(Subsections may be padded a different amount on different flavors
30243d8817e4Smiodof @command{@value{AS}}.)
30253d8817e4Smiod@end ifset
30263d8817e4Smiod@ifclear GENERIC
30273d8817e4Smiod@ifset H8
30283d8817e4SmiodOn the H8/300 platform, each subsection is zero-padded to a word
30293d8817e4Smiodboundary (two bytes).
30303d8817e4SmiodThe same is true on the Renesas SH.
30313d8817e4Smiod@end ifset
30323d8817e4Smiod@ifset I960
30333d8817e4Smiod@c FIXME section padding (alignment)?
30343d8817e4Smiod@c Rich Pixley says padding here depends on target obj code format; that
30353d8817e4Smiod@c doesn't seem particularly useful to say without further elaboration,
30363d8817e4Smiod@c so for now I say nothing about it.  If this is a generic BFD issue,
30373d8817e4Smiod@c these paragraphs might need to vanish from this manual, and be
30383d8817e4Smiod@c discussed in BFD chapter of binutils (or some such).
30393d8817e4Smiod@end ifset
30403d8817e4Smiod@end ifclear
30413d8817e4Smiod
30423d8817e4SmiodSubsections appear in your object file in numeric order, lowest numbered
30433d8817e4Smiodto highest.  (All this to be compatible with other people's assemblers.)
30443d8817e4SmiodThe object file contains no representation of subsections; @code{@value{LD}} and
30453d8817e4Smiodother programs that manipulate object files see no trace of them.
30463d8817e4SmiodThey just see all your text subsections as a text section, and all your
30473d8817e4Smioddata subsections as a data section.
30483d8817e4Smiod
30493d8817e4SmiodTo specify which subsection you want subsequent statements assembled
30503d8817e4Smiodinto, use a numeric argument to specify it, in a @samp{.text
30513d8817e4Smiod@var{expression}} or a @samp{.data @var{expression}} statement.
30523d8817e4Smiod@ifset COFF
30533d8817e4Smiod@ifset GENERIC
30543d8817e4SmiodWhen generating COFF output, you
30553d8817e4Smiod@end ifset
30563d8817e4Smiod@ifclear GENERIC
30573d8817e4SmiodYou
30583d8817e4Smiod@end ifclear
30593d8817e4Smiodcan also use an extra subsection
30603d8817e4Smiodargument with arbitrary named sections: @samp{.section @var{name},
30613d8817e4Smiod@var{expression}}.
30623d8817e4Smiod@end ifset
30633d8817e4Smiod@ifset ELF
30643d8817e4Smiod@ifset GENERIC
30653d8817e4SmiodWhen generating ELF output, you
30663d8817e4Smiod@end ifset
30673d8817e4Smiod@ifclear GENERIC
30683d8817e4SmiodYou
30693d8817e4Smiod@end ifclear
30703d8817e4Smiodcan also use the @code{.subsection} directive (@pxref{SubSection})
30713d8817e4Smiodto specify a subsection: @samp{.subsection @var{expression}}.
30723d8817e4Smiod@end ifset
30733d8817e4Smiod@var{Expression} should be an absolute expression.
30743d8817e4Smiod(@xref{Expressions}.)  If you just say @samp{.text} then @samp{.text 0}
30753d8817e4Smiodis assumed.  Likewise @samp{.data} means @samp{.data 0}.  Assembly
30763d8817e4Smiodbegins in @code{text 0}.  For instance:
30773d8817e4Smiod@smallexample
30783d8817e4Smiod.text 0     # The default subsection is text 0 anyway.
30793d8817e4Smiod.ascii "This lives in the first text subsection. *"
30803d8817e4Smiod.text 1
30813d8817e4Smiod.ascii "But this lives in the second text subsection."
30823d8817e4Smiod.data 0
30833d8817e4Smiod.ascii "This lives in the data section,"
30843d8817e4Smiod.ascii "in the first data subsection."
30853d8817e4Smiod.text 0
30863d8817e4Smiod.ascii "This lives in the first text section,"
30873d8817e4Smiod.ascii "immediately following the asterisk (*)."
30883d8817e4Smiod@end smallexample
30893d8817e4Smiod
30903d8817e4SmiodEach section has a @dfn{location counter} incremented by one for every byte
30913d8817e4Smiodassembled into that section.  Because subsections are merely a convenience
30923d8817e4Smiodrestricted to @command{@value{AS}} there is no concept of a subsection location
30933d8817e4Smiodcounter.  There is no way to directly manipulate a location counter---but the
30943d8817e4Smiod@code{.align} directive changes it, and any label definition captures its
30953d8817e4Smiodcurrent value.  The location counter of the section where statements are being
30963d8817e4Smiodassembled is said to be the @dfn{active} location counter.
30973d8817e4Smiod
30983d8817e4Smiod@node bss
30993d8817e4Smiod@section bss Section
31003d8817e4Smiod
31013d8817e4Smiod@cindex bss section
31023d8817e4Smiod@cindex common variable storage
31033d8817e4SmiodThe bss section is used for local common variable storage.
31043d8817e4SmiodYou may allocate address space in the bss section, but you may
31053d8817e4Smiodnot dictate data to load into it before your program executes.  When
31063d8817e4Smiodyour program starts running, all the contents of the bss
31073d8817e4Smiodsection are zeroed bytes.
31083d8817e4Smiod
31093d8817e4SmiodThe @code{.lcomm} pseudo-op defines a symbol in the bss section; see
31103d8817e4Smiod@ref{Lcomm,,@code{.lcomm}}.
31113d8817e4Smiod
31123d8817e4SmiodThe @code{.comm} pseudo-op may be used to declare a common symbol, which is
31133d8817e4Smiodanother form of uninitialized symbol; see @xref{Comm,,@code{.comm}}.
31143d8817e4Smiod
31153d8817e4Smiod@ifset GENERIC
31163d8817e4SmiodWhen assembling for a target which supports multiple sections, such as ELF or
31173d8817e4SmiodCOFF, you may switch into the @code{.bss} section and define symbols as usual;
31183d8817e4Smiodsee @ref{Section,,@code{.section}}.  You may only assemble zero values into the
31193d8817e4Smiodsection.  Typically the section will only contain symbol definitions and
31203d8817e4Smiod@code{.skip} directives (@pxref{Skip,,@code{.skip}}).
31213d8817e4Smiod@end ifset
31223d8817e4Smiod
31233d8817e4Smiod@node Symbols
31243d8817e4Smiod@chapter Symbols
31253d8817e4Smiod
31263d8817e4Smiod@cindex symbols
31273d8817e4SmiodSymbols are a central concept: the programmer uses symbols to name
31283d8817e4Smiodthings, the linker uses symbols to link, and the debugger uses symbols
31293d8817e4Smiodto debug.
31303d8817e4Smiod
31313d8817e4Smiod@quotation
31323d8817e4Smiod@cindex debuggers, and symbol order
31333d8817e4Smiod@emph{Warning:} @command{@value{AS}} does not place symbols in the object file in
31343d8817e4Smiodthe same order they were declared.  This may break some debuggers.
31353d8817e4Smiod@end quotation
31363d8817e4Smiod
31373d8817e4Smiod@menu
31383d8817e4Smiod* Labels::                      Labels
31393d8817e4Smiod* Setting Symbols::             Giving Symbols Other Values
31403d8817e4Smiod* Symbol Names::                Symbol Names
31413d8817e4Smiod* Dot::                         The Special Dot Symbol
31423d8817e4Smiod* Symbol Attributes::           Symbol Attributes
31433d8817e4Smiod@end menu
31443d8817e4Smiod
31453d8817e4Smiod@node Labels
31463d8817e4Smiod@section Labels
31473d8817e4Smiod
31483d8817e4Smiod@cindex labels
31493d8817e4SmiodA @dfn{label} is written as a symbol immediately followed by a colon
31503d8817e4Smiod@samp{:}.  The symbol then represents the current value of the
31513d8817e4Smiodactive location counter, and is, for example, a suitable instruction
31523d8817e4Smiodoperand.  You are warned if you use the same symbol to represent two
31533d8817e4Smioddifferent locations: the first definition overrides any other
31543d8817e4Smioddefinitions.
31553d8817e4Smiod
31563d8817e4Smiod@ifset HPPA
31573d8817e4SmiodOn the HPPA, the usual form for a label need not be immediately followed by a
31583d8817e4Smiodcolon, but instead must start in column zero.  Only one label may be defined on
31593d8817e4Smioda single line.  To work around this, the HPPA version of @command{@value{AS}} also
31603d8817e4Smiodprovides a special directive @code{.label} for defining labels more flexibly.
31613d8817e4Smiod@end ifset
31623d8817e4Smiod
31633d8817e4Smiod@node Setting Symbols
31643d8817e4Smiod@section Giving Symbols Other Values
31653d8817e4Smiod
31663d8817e4Smiod@cindex assigning values to symbols
31673d8817e4Smiod@cindex symbol values, assigning
31683d8817e4SmiodA symbol can be given an arbitrary value by writing a symbol, followed
31693d8817e4Smiodby an equals sign @samp{=}, followed by an expression
31703d8817e4Smiod(@pxref{Expressions}).  This is equivalent to using the @code{.set}
31713d8817e4Smioddirective.  @xref{Set,,@code{.set}}.  In the same way, using a double
31723d8817e4Smiodequals sign @samp{=}@samp{=} here represents an equivalent of the
31733d8817e4Smiod@code{.eqv} directive.  @xref{Eqv,,@code{.eqv}}.
31743d8817e4Smiod
31753d8817e4Smiod@node Symbol Names
31763d8817e4Smiod@section Symbol Names
31773d8817e4Smiod
31783d8817e4Smiod@cindex symbol names
31793d8817e4Smiod@cindex names, symbol
31803d8817e4Smiod@ifclear SPECIAL-SYMS
31813d8817e4SmiodSymbol names begin with a letter or with one of @samp{._}.  On most
31823d8817e4Smiodmachines, you can also use @code{$} in symbol names; exceptions are
31833d8817e4Smiodnoted in @ref{Machine Dependencies}.  That character may be followed by any
31843d8817e4Smiodstring of digits, letters, dollar signs (unless otherwise noted in
31853d8817e4Smiod@ref{Machine Dependencies}), and underscores.
31863d8817e4Smiod@end ifclear
31873d8817e4Smiod@ifset SPECIAL-SYMS
31883d8817e4Smiod@ifset H8
31893d8817e4SmiodSymbol names begin with a letter or with one of @samp{._}.  On the
31903d8817e4SmiodRenesas SH you can also use @code{$} in symbol names.  That
31913d8817e4Smiodcharacter may be followed by any string of digits, letters, dollar signs (save
31923d8817e4Smiodon the H8/300), and underscores.
31933d8817e4Smiod@end ifset
31943d8817e4Smiod@end ifset
31953d8817e4Smiod
31963d8817e4SmiodCase of letters is significant: @code{foo} is a different symbol name
31973d8817e4Smiodthan @code{Foo}.
31983d8817e4Smiod
31993d8817e4SmiodEach symbol has exactly one name.  Each name in an assembly language program
32003d8817e4Smiodrefers to exactly one symbol.  You may use that symbol name any number of times
32013d8817e4Smiodin a program.
32023d8817e4Smiod
32033d8817e4Smiod@subheading Local Symbol Names
32043d8817e4Smiod
32053d8817e4Smiod@cindex local symbol names
32063d8817e4Smiod@cindex symbol names, local
32073d8817e4Smiod@cindex temporary symbol names
32083d8817e4Smiod@cindex symbol names, temporary
32093d8817e4SmiodLocal symbols help compilers and programmers use names temporarily.
32103d8817e4SmiodThey create symbols which are guaranteed to be unique over the entire scope of
32113d8817e4Smiodthe input source code and which can be referred to by a simple notation.
32123d8817e4SmiodTo define a local symbol, write a label of the form @samp{@b{N}:} (where @b{N}
32133d8817e4Smiodrepresents any positive integer).  To refer to the most recent previous
32143d8817e4Smioddefinition of that symbol write @samp{@b{N}b}, using the same number as when
32153d8817e4Smiodyou defined the label.  To refer to the next definition of a local label, write
32163d8817e4Smiod@samp{@b{N}f}--- The @samp{b} stands for``backwards'' and the @samp{f} stands
32173d8817e4Smiodfor ``forwards''.
32183d8817e4Smiod
32193d8817e4SmiodThere is no restriction on how you can use these labels, and you can reuse them
32203d8817e4Smiodtoo.  So that it is possible to repeatedly define the same local label (using
32213d8817e4Smiodthe same number @samp{@b{N}}), although you can only refer to the most recently
32223d8817e4Smioddefined local label of that number (for a backwards reference) or the next
32233d8817e4Smioddefinition of a specific local label for a forward reference.  It is also worth
32243d8817e4Smiodnoting that the first 10 local labels (@samp{@b{0:}}@dots{}@samp{@b{9:}}) are
32253d8817e4Smiodimplemented in a slightly more efficient manner than the others.
32263d8817e4Smiod
32273d8817e4SmiodHere is an example:
32283d8817e4Smiod
32293d8817e4Smiod@smallexample
32303d8817e4Smiod1:        branch 1f
32313d8817e4Smiod2:        branch 1b
32323d8817e4Smiod1:        branch 2f
32333d8817e4Smiod2:        branch 1b
32343d8817e4Smiod@end smallexample
32353d8817e4Smiod
32363d8817e4SmiodWhich is the equivalent of:
32373d8817e4Smiod
32383d8817e4Smiod@smallexample
32393d8817e4Smiodlabel_1:  branch label_3
32403d8817e4Smiodlabel_2:  branch label_1
32413d8817e4Smiodlabel_3:  branch label_4
32423d8817e4Smiodlabel_4:  branch label_3
32433d8817e4Smiod@end smallexample
32443d8817e4Smiod
32453d8817e4SmiodLocal symbol names are only a notational device.  They are immediately
32463d8817e4Smiodtransformed into more conventional symbol names before the assembler uses them.
32473d8817e4SmiodThe symbol names stored in the symbol table, appearing in error messages and
32483d8817e4Smiodoptionally emitted to the object file.  The names are constructed using these
32493d8817e4Smiodparts:
32503d8817e4Smiod
32513d8817e4Smiod@table @code
32523d8817e4Smiod@item L
32533d8817e4SmiodAll local labels begin with @samp{L}. Normally both @command{@value{AS}} and
32543d8817e4Smiod@code{@value{LD}} forget symbols that start with @samp{L}. These labels are
32553d8817e4Smiodused for symbols you are never intended to see.  If you use the
32563d8817e4Smiod@samp{-L} option then @command{@value{AS}} retains these symbols in the
32573d8817e4Smiodobject file. If you also instruct @code{@value{LD}} to retain these symbols,
32583d8817e4Smiodyou may use them in debugging.
32593d8817e4Smiod
32603d8817e4Smiod@item @var{number}
32613d8817e4SmiodThis is the number that was used in the local label definition.  So if the
32623d8817e4Smiodlabel is written @samp{55:} then the number is @samp{55}.
32633d8817e4Smiod
32643d8817e4Smiod@item @kbd{C-B}
32653d8817e4SmiodThis unusual character is included so you do not accidentally invent a symbol
32663d8817e4Smiodof the same name.  The character has ASCII value of @samp{\002} (control-B).
32673d8817e4Smiod
32683d8817e4Smiod@item @emph{ordinal number}
32693d8817e4SmiodThis is a serial number to keep the labels distinct.  The first definition of
32703d8817e4Smiod@samp{0:} gets the number @samp{1}.  The 15th definition of @samp{0:} gets the
32713d8817e4Smiodnumber @samp{15}, and so on.  Likewise the first definition of @samp{1:} gets
32723d8817e4Smiodthe number @samp{1} and its 15th defintion gets @samp{15} as well.
32733d8817e4Smiod@end table
32743d8817e4Smiod
32753d8817e4SmiodSo for example, the first @code{1:} is named @code{L1@kbd{C-B}1}, the 44th
32763d8817e4Smiod@code{3:} is named @code{L3@kbd{C-B}44}.
32773d8817e4Smiod
32783d8817e4Smiod@subheading Dollar Local Labels
32793d8817e4Smiod@cindex dollar local symbols
32803d8817e4Smiod
32813d8817e4Smiod@code{@value{AS}} also supports an even more local form of local labels called
32823d8817e4Smioddollar labels.  These labels go out of scope (ie they become undefined) as soon
32833d8817e4Smiodas a non-local label is defined.  Thus they remain valid for only a small
32843d8817e4Smiodregion of the input source code.  Normal local labels, by contrast, remain in
32853d8817e4Smiodscope for the entire file, or until they are redefined by another occurrence of
32863d8817e4Smiodthe same local label.
32873d8817e4Smiod
32883d8817e4SmiodDollar labels are defined in exactly the same way as ordinary local labels,
32893d8817e4Smiodexcept that instead of being terminated by a colon, they are terminated by a
32903d8817e4Smioddollar sign.  eg @samp{@b{55$}}.
32913d8817e4Smiod
32923d8817e4SmiodThey can also be distinguished from ordinary local labels by their transformed
32933d8817e4Smiodname which uses ASCII character @samp{\001} (control-A) as the magic character
32943d8817e4Smiodto distinguish them from ordinary labels.  Thus the 5th defintion of @samp{6$}
32953d8817e4Smiodis named @samp{L6@kbd{C-A}5}.
32963d8817e4Smiod
32973d8817e4Smiod@node Dot
32983d8817e4Smiod@section The Special Dot Symbol
32993d8817e4Smiod
33003d8817e4Smiod@cindex dot (symbol)
33013d8817e4Smiod@cindex @code{.} (symbol)
33023d8817e4Smiod@cindex current address
33033d8817e4Smiod@cindex location counter
33043d8817e4SmiodThe special symbol @samp{.} refers to the current address that
33053d8817e4Smiod@command{@value{AS}} is assembling into.  Thus, the expression @samp{melvin:
33063d8817e4Smiod.long .} defines @code{melvin} to contain its own address.
33073d8817e4SmiodAssigning a value to @code{.} is treated the same as a @code{.org}
33083d8817e4Smioddirective.  Thus, the expression @samp{.=.+4} is the same as saying
33093d8817e4Smiod@ifclear no-space-dir
33103d8817e4Smiod@samp{.space 4}.
33113d8817e4Smiod@end ifclear
33123d8817e4Smiod
33133d8817e4Smiod@node Symbol Attributes
33143d8817e4Smiod@section Symbol Attributes
33153d8817e4Smiod
33163d8817e4Smiod@cindex symbol attributes
33173d8817e4Smiod@cindex attributes, symbol
33183d8817e4SmiodEvery symbol has, as well as its name, the attributes ``Value'' and
33193d8817e4Smiod``Type''.  Depending on output format, symbols can also have auxiliary
33203d8817e4Smiodattributes.
33213d8817e4Smiod@ifset INTERNALS
33223d8817e4SmiodThe detailed definitions are in @file{a.out.h}.
33233d8817e4Smiod@end ifset
33243d8817e4Smiod
33253d8817e4SmiodIf you use a symbol without defining it, @command{@value{AS}} assumes zero for
33263d8817e4Smiodall these attributes, and probably won't warn you.  This makes the
33273d8817e4Smiodsymbol an externally defined symbol, which is generally what you
33283d8817e4Smiodwould want.
33293d8817e4Smiod
33303d8817e4Smiod@menu
33313d8817e4Smiod* Symbol Value::                Value
33323d8817e4Smiod* Symbol Type::                 Type
33333d8817e4Smiod@ifset aout-bout
33343d8817e4Smiod@ifset GENERIC
33353d8817e4Smiod* a.out Symbols::               Symbol Attributes: @code{a.out}
33363d8817e4Smiod@end ifset
33373d8817e4Smiod@ifclear GENERIC
33383d8817e4Smiod@ifclear BOUT
33393d8817e4Smiod* a.out Symbols::               Symbol Attributes: @code{a.out}
33403d8817e4Smiod@end ifclear
33413d8817e4Smiod@ifset BOUT
33423d8817e4Smiod* a.out Symbols::               Symbol Attributes: @code{a.out}, @code{b.out}
33433d8817e4Smiod@end ifset
33443d8817e4Smiod@end ifclear
33453d8817e4Smiod@end ifset
33463d8817e4Smiod@ifset COFF
33473d8817e4Smiod* COFF Symbols::                Symbol Attributes for COFF
33483d8817e4Smiod@end ifset
33493d8817e4Smiod@ifset SOM
33503d8817e4Smiod* SOM Symbols::                Symbol Attributes for SOM
33513d8817e4Smiod@end ifset
33523d8817e4Smiod@end menu
33533d8817e4Smiod
33543d8817e4Smiod@node Symbol Value
33553d8817e4Smiod@subsection Value
33563d8817e4Smiod
33573d8817e4Smiod@cindex value of a symbol
33583d8817e4Smiod@cindex symbol value
33593d8817e4SmiodThe value of a symbol is (usually) 32 bits.  For a symbol which labels a
33603d8817e4Smiodlocation in the text, data, bss or absolute sections the value is the
33613d8817e4Smiodnumber of addresses from the start of that section to the label.
33623d8817e4SmiodNaturally for text, data and bss sections the value of a symbol changes
33633d8817e4Smiodas @code{@value{LD}} changes section base addresses during linking.  Absolute
33643d8817e4Smiodsymbols' values do not change during linking: that is why they are
33653d8817e4Smiodcalled absolute.
33663d8817e4Smiod
33673d8817e4SmiodThe value of an undefined symbol is treated in a special way.  If it is
33683d8817e4Smiod0 then the symbol is not defined in this assembler source file, and
33693d8817e4Smiod@code{@value{LD}} tries to determine its value from other files linked into the
33703d8817e4Smiodsame program.  You make this kind of symbol simply by mentioning a symbol
33713d8817e4Smiodname without defining it.  A non-zero value represents a @code{.comm}
33723d8817e4Smiodcommon declaration.  The value is how much common storage to reserve, in
33733d8817e4Smiodbytes (addresses).  The symbol refers to the first address of the
33743d8817e4Smiodallocated storage.
33753d8817e4Smiod
33763d8817e4Smiod@node Symbol Type
33773d8817e4Smiod@subsection Type
33783d8817e4Smiod
33793d8817e4Smiod@cindex type of a symbol
33803d8817e4Smiod@cindex symbol type
33813d8817e4SmiodThe type attribute of a symbol contains relocation (section)
33823d8817e4Smiodinformation, any flag settings indicating that a symbol is external, and
33833d8817e4Smiod(optionally), other information for linkers and debuggers.  The exact
33843d8817e4Smiodformat depends on the object-code output format in use.
33853d8817e4Smiod
33863d8817e4Smiod@ifset aout-bout
33873d8817e4Smiod@ifclear GENERIC
33883d8817e4Smiod@ifset BOUT
33893d8817e4Smiod@c The following avoids a "widow" subsection title.  @group would be
33903d8817e4Smiod@c better if it were available outside examples.
33913d8817e4Smiod@need 1000
33923d8817e4Smiod@node a.out Symbols
33933d8817e4Smiod@subsection Symbol Attributes: @code{a.out}, @code{b.out}
33943d8817e4Smiod
33953d8817e4Smiod@cindex @code{b.out} symbol attributes
33963d8817e4Smiod@cindex symbol attributes, @code{b.out}
33973d8817e4SmiodThese symbol attributes appear only when @command{@value{AS}} is configured for
33983d8817e4Smiodone of the Berkeley-descended object output formats---@code{a.out} or
33993d8817e4Smiod@code{b.out}.
34003d8817e4Smiod
34013d8817e4Smiod@end ifset
34023d8817e4Smiod@ifclear BOUT
34033d8817e4Smiod@node a.out Symbols
34043d8817e4Smiod@subsection Symbol Attributes: @code{a.out}
34053d8817e4Smiod
34063d8817e4Smiod@cindex @code{a.out} symbol attributes
34073d8817e4Smiod@cindex symbol attributes, @code{a.out}
34083d8817e4Smiod
34093d8817e4Smiod@end ifclear
34103d8817e4Smiod@end ifclear
34113d8817e4Smiod@ifset GENERIC
34123d8817e4Smiod@node a.out Symbols
34133d8817e4Smiod@subsection Symbol Attributes: @code{a.out}
34143d8817e4Smiod
34153d8817e4Smiod@cindex @code{a.out} symbol attributes
34163d8817e4Smiod@cindex symbol attributes, @code{a.out}
34173d8817e4Smiod
34183d8817e4Smiod@end ifset
34193d8817e4Smiod@menu
34203d8817e4Smiod* Symbol Desc::                 Descriptor
34213d8817e4Smiod* Symbol Other::                Other
34223d8817e4Smiod@end menu
34233d8817e4Smiod
34243d8817e4Smiod@node Symbol Desc
34253d8817e4Smiod@subsubsection Descriptor
34263d8817e4Smiod
34273d8817e4Smiod@cindex descriptor, of @code{a.out} symbol
34283d8817e4SmiodThis is an arbitrary 16-bit value.  You may establish a symbol's
34293d8817e4Smioddescriptor value by using a @code{.desc} statement
34303d8817e4Smiod(@pxref{Desc,,@code{.desc}}).  A descriptor value means nothing to
34313d8817e4Smiod@command{@value{AS}}.
34323d8817e4Smiod
34333d8817e4Smiod@node Symbol Other
34343d8817e4Smiod@subsubsection Other
34353d8817e4Smiod
34363d8817e4Smiod@cindex other attribute, of @code{a.out} symbol
34373d8817e4SmiodThis is an arbitrary 8-bit value.  It means nothing to @command{@value{AS}}.
34383d8817e4Smiod@end ifset
34393d8817e4Smiod
34403d8817e4Smiod@ifset COFF
34413d8817e4Smiod@node COFF Symbols
34423d8817e4Smiod@subsection Symbol Attributes for COFF
34433d8817e4Smiod
34443d8817e4Smiod@cindex COFF symbol attributes
34453d8817e4Smiod@cindex symbol attributes, COFF
34463d8817e4Smiod
34473d8817e4SmiodThe COFF format supports a multitude of auxiliary symbol attributes;
34483d8817e4Smiodlike the primary symbol attributes, they are set between @code{.def} and
34493d8817e4Smiod@code{.endef} directives.
34503d8817e4Smiod
34513d8817e4Smiod@subsubsection Primary Attributes
34523d8817e4Smiod
34533d8817e4Smiod@cindex primary attributes, COFF symbols
34543d8817e4SmiodThe symbol name is set with @code{.def}; the value and type,
34553d8817e4Smiodrespectively, with @code{.val} and @code{.type}.
34563d8817e4Smiod
34573d8817e4Smiod@subsubsection Auxiliary Attributes
34583d8817e4Smiod
34593d8817e4Smiod@cindex auxiliary attributes, COFF symbols
34603d8817e4SmiodThe @command{@value{AS}} directives @code{.dim}, @code{.line}, @code{.scl},
34613d8817e4Smiod@code{.size}, @code{.tag}, and @code{.weak} can generate auxiliary symbol
34623d8817e4Smiodtable information for COFF.
34633d8817e4Smiod@end ifset
34643d8817e4Smiod
34653d8817e4Smiod@ifset SOM
34663d8817e4Smiod@node SOM Symbols
34673d8817e4Smiod@subsection Symbol Attributes for SOM
34683d8817e4Smiod
34693d8817e4Smiod@cindex SOM symbol attributes
34703d8817e4Smiod@cindex symbol attributes, SOM
34713d8817e4Smiod
34723d8817e4SmiodThe SOM format for the HPPA supports a multitude of symbol attributes set with
34733d8817e4Smiodthe @code{.EXPORT} and @code{.IMPORT} directives.
34743d8817e4Smiod
34753d8817e4SmiodThe attributes are described in @cite{HP9000 Series 800 Assembly
34763d8817e4SmiodLanguage Reference Manual} (HP 92432-90001) under the @code{IMPORT} and
34773d8817e4Smiod@code{EXPORT} assembler directive documentation.
34783d8817e4Smiod@end ifset
34793d8817e4Smiod
34803d8817e4Smiod@node Expressions
34813d8817e4Smiod@chapter Expressions
34823d8817e4Smiod
34833d8817e4Smiod@cindex expressions
34843d8817e4Smiod@cindex addresses
34853d8817e4Smiod@cindex numeric values
34863d8817e4SmiodAn @dfn{expression} specifies an address or numeric value.
34873d8817e4SmiodWhitespace may precede and/or follow an expression.
34883d8817e4Smiod
34893d8817e4SmiodThe result of an expression must be an absolute number, or else an offset into
34903d8817e4Smioda particular section.  If an expression is not absolute, and there is not
34913d8817e4Smiodenough information when @command{@value{AS}} sees the expression to know its
34923d8817e4Smiodsection, a second pass over the source program might be necessary to interpret
34933d8817e4Smiodthe expression---but the second pass is currently not implemented.
34943d8817e4Smiod@command{@value{AS}} aborts with an error message in this situation.
34953d8817e4Smiod
34963d8817e4Smiod@menu
34973d8817e4Smiod* Empty Exprs::                 Empty Expressions
34983d8817e4Smiod* Integer Exprs::               Integer Expressions
34993d8817e4Smiod@end menu
35003d8817e4Smiod
35013d8817e4Smiod@node Empty Exprs
35023d8817e4Smiod@section Empty Expressions
35033d8817e4Smiod
35043d8817e4Smiod@cindex empty expressions
35053d8817e4Smiod@cindex expressions, empty
35063d8817e4SmiodAn empty expression has no value: it is just whitespace or null.
35073d8817e4SmiodWherever an absolute expression is required, you may omit the
35083d8817e4Smiodexpression, and @command{@value{AS}} assumes a value of (absolute) 0.  This
35093d8817e4Smiodis compatible with other assemblers.
35103d8817e4Smiod
35113d8817e4Smiod@node Integer Exprs
35123d8817e4Smiod@section Integer Expressions
35133d8817e4Smiod
35143d8817e4Smiod@cindex integer expressions
35153d8817e4Smiod@cindex expressions, integer
35163d8817e4SmiodAn @dfn{integer expression} is one or more @emph{arguments} delimited
35173d8817e4Smiodby @emph{operators}.
35183d8817e4Smiod
35193d8817e4Smiod@menu
35203d8817e4Smiod* Arguments::                   Arguments
35213d8817e4Smiod* Operators::                   Operators
35223d8817e4Smiod* Prefix Ops::                  Prefix Operators
35233d8817e4Smiod* Infix Ops::                   Infix Operators
35243d8817e4Smiod@end menu
35253d8817e4Smiod
35263d8817e4Smiod@node Arguments
35273d8817e4Smiod@subsection Arguments
35283d8817e4Smiod
35293d8817e4Smiod@cindex expression arguments
35303d8817e4Smiod@cindex arguments in expressions
35313d8817e4Smiod@cindex operands in expressions
35323d8817e4Smiod@cindex arithmetic operands
35333d8817e4Smiod@dfn{Arguments} are symbols, numbers or subexpressions.  In other
35343d8817e4Smiodcontexts arguments are sometimes called ``arithmetic operands''.  In
35353d8817e4Smiodthis manual, to avoid confusing them with the ``instruction operands'' of
35363d8817e4Smiodthe machine language, we use the term ``argument'' to refer to parts of
35373d8817e4Smiodexpressions only, reserving the word ``operand'' to refer only to machine
35383d8817e4Smiodinstruction operands.
35393d8817e4Smiod
35403d8817e4SmiodSymbols are evaluated to yield @{@var{section} @var{NNN}@} where
35413d8817e4Smiod@var{section} is one of text, data, bss, absolute,
35423d8817e4Smiodor undefined.  @var{NNN} is a signed, 2's complement 32 bit
35433d8817e4Smiodinteger.
35443d8817e4Smiod
35453d8817e4SmiodNumbers are usually integers.
35463d8817e4Smiod
35473d8817e4SmiodA number can be a flonum or bignum.  In this case, you are warned
35483d8817e4Smiodthat only the low order 32 bits are used, and @command{@value{AS}} pretends
35493d8817e4Smiodthese 32 bits are an integer.  You may write integer-manipulating
35503d8817e4Smiodinstructions that act on exotic constants, compatible with other
35513d8817e4Smiodassemblers.
35523d8817e4Smiod
35533d8817e4Smiod@cindex subexpressions
35543d8817e4SmiodSubexpressions are a left parenthesis @samp{(} followed by an integer
35553d8817e4Smiodexpression, followed by a right parenthesis @samp{)}; or a prefix
35563d8817e4Smiodoperator followed by an argument.
35573d8817e4Smiod
35583d8817e4Smiod@node Operators
35593d8817e4Smiod@subsection Operators
35603d8817e4Smiod
35613d8817e4Smiod@cindex operators, in expressions
35623d8817e4Smiod@cindex arithmetic functions
35633d8817e4Smiod@cindex functions, in expressions
35643d8817e4Smiod@dfn{Operators} are arithmetic functions, like @code{+} or @code{%}.  Prefix
35653d8817e4Smiodoperators are followed by an argument.  Infix operators appear
35663d8817e4Smiodbetween their arguments.  Operators may be preceded and/or followed by
35673d8817e4Smiodwhitespace.
35683d8817e4Smiod
35693d8817e4Smiod@node Prefix Ops
35703d8817e4Smiod@subsection Prefix Operator
35713d8817e4Smiod
35723d8817e4Smiod@cindex prefix operators
35733d8817e4Smiod@command{@value{AS}} has the following @dfn{prefix operators}.  They each take
35743d8817e4Smiodone argument, which must be absolute.
35753d8817e4Smiod
35763d8817e4Smiod@c the tex/end tex stuff surrounding this small table is meant to make
35773d8817e4Smiod@c it align, on the printed page, with the similar table in the next
35783d8817e4Smiod@c section (which is inside an enumerate).
35793d8817e4Smiod@tex
35803d8817e4Smiod\global\advance\leftskip by \itemindent
35813d8817e4Smiod@end tex
35823d8817e4Smiod
35833d8817e4Smiod@table @code
35843d8817e4Smiod@item -
35853d8817e4Smiod@dfn{Negation}.  Two's complement negation.
35863d8817e4Smiod@item ~
35873d8817e4Smiod@dfn{Complementation}.  Bitwise not.
35883d8817e4Smiod@end table
35893d8817e4Smiod
35903d8817e4Smiod@tex
35913d8817e4Smiod\global\advance\leftskip by -\itemindent
35923d8817e4Smiod@end tex
35933d8817e4Smiod
35943d8817e4Smiod@node Infix Ops
35953d8817e4Smiod@subsection Infix Operators
35963d8817e4Smiod
35973d8817e4Smiod@cindex infix operators
35983d8817e4Smiod@cindex operators, permitted arguments
35993d8817e4Smiod@dfn{Infix operators} take two arguments, one on either side.  Operators
36003d8817e4Smiodhave precedence, but operations with equal precedence are performed left
36013d8817e4Smiodto right.  Apart from @code{+} or @option{-}, both arguments must be
36023d8817e4Smiodabsolute, and the result is absolute.
36033d8817e4Smiod
36043d8817e4Smiod@enumerate
36053d8817e4Smiod@cindex operator precedence
36063d8817e4Smiod@cindex precedence of operators
36073d8817e4Smiod
36083d8817e4Smiod@item
36093d8817e4SmiodHighest Precedence
36103d8817e4Smiod
36113d8817e4Smiod@table @code
36123d8817e4Smiod@item *
36133d8817e4Smiod@dfn{Multiplication}.
36143d8817e4Smiod
36153d8817e4Smiod@item /
36163d8817e4Smiod@dfn{Division}.  Truncation is the same as the C operator @samp{/}
36173d8817e4Smiod
36183d8817e4Smiod@item %
36193d8817e4Smiod@dfn{Remainder}.
36203d8817e4Smiod
36213d8817e4Smiod@item <<
36223d8817e4Smiod@dfn{Shift Left}.  Same as the C operator @samp{<<}.
36233d8817e4Smiod
36243d8817e4Smiod@item >>
36253d8817e4Smiod@dfn{Shift Right}.  Same as the C operator @samp{>>}.
36263d8817e4Smiod@end table
36273d8817e4Smiod
36283d8817e4Smiod@item
36293d8817e4SmiodIntermediate precedence
36303d8817e4Smiod
36313d8817e4Smiod@table @code
36323d8817e4Smiod@item |
36333d8817e4Smiod
36343d8817e4Smiod@dfn{Bitwise Inclusive Or}.
36353d8817e4Smiod
36363d8817e4Smiod@item &
36373d8817e4Smiod@dfn{Bitwise And}.
36383d8817e4Smiod
36393d8817e4Smiod@item ^
36403d8817e4Smiod@dfn{Bitwise Exclusive Or}.
36413d8817e4Smiod
36423d8817e4Smiod@item !
36433d8817e4Smiod@dfn{Bitwise Or Not}.
36443d8817e4Smiod@end table
36453d8817e4Smiod
36463d8817e4Smiod@item
36473d8817e4SmiodLow Precedence
36483d8817e4Smiod
36493d8817e4Smiod@table @code
36503d8817e4Smiod@cindex addition, permitted arguments
36513d8817e4Smiod@cindex plus, permitted arguments
36523d8817e4Smiod@cindex arguments for addition
36533d8817e4Smiod@item +
36543d8817e4Smiod@dfn{Addition}.  If either argument is absolute, the result has the section of
36553d8817e4Smiodthe other argument.  You may not add together arguments from different
36563d8817e4Smiodsections.
36573d8817e4Smiod
36583d8817e4Smiod@cindex subtraction, permitted arguments
36593d8817e4Smiod@cindex minus, permitted arguments
36603d8817e4Smiod@cindex arguments for subtraction
36613d8817e4Smiod@item -
36623d8817e4Smiod@dfn{Subtraction}.  If the right argument is absolute, the
36633d8817e4Smiodresult has the section of the left argument.
36643d8817e4SmiodIf both arguments are in the same section, the result is absolute.
36653d8817e4SmiodYou may not subtract arguments from different sections.
36663d8817e4Smiod@c FIXME is there still something useful to say about undefined - undefined ?
36673d8817e4Smiod
36683d8817e4Smiod@cindex comparison expressions
36693d8817e4Smiod@cindex expressions, comparison
36703d8817e4Smiod@item  ==
36713d8817e4Smiod@dfn{Is Equal To}
36723d8817e4Smiod@item <>
36733d8817e4Smiod@itemx !=
36743d8817e4Smiod@dfn{Is Not Equal To}
36753d8817e4Smiod@item <
36763d8817e4Smiod@dfn{Is Less Than}
36773d8817e4Smiod@item >
36783d8817e4Smiod@dfn{Is Greater Than}
36793d8817e4Smiod@item >=
36803d8817e4Smiod@dfn{Is Greater Than Or Equal To}
36813d8817e4Smiod@item <=
36823d8817e4Smiod@dfn{Is Less Than Or Equal To}
36833d8817e4Smiod
36843d8817e4SmiodThe comparison operators can be used as infix operators.  A true results has a
36853d8817e4Smiodvalue of -1 whereas a false result has a value of 0.   Note, these operators
36863d8817e4Smiodperform signed comparisons.
36873d8817e4Smiod@end table
36883d8817e4Smiod
36893d8817e4Smiod@item Lowest Precedence
36903d8817e4Smiod
36913d8817e4Smiod@table @code
36923d8817e4Smiod@item &&
36933d8817e4Smiod@dfn{Logical And}.
36943d8817e4Smiod
36953d8817e4Smiod@item ||
36963d8817e4Smiod@dfn{Logical Or}.
36973d8817e4Smiod
36983d8817e4SmiodThese two logical operations can be used to combine the results of sub
36993d8817e4Smiodexpressions.  Note, unlike the comparison operators a true result returns a
37003d8817e4Smiodvalue of 1 but a false results does still return 0.  Also note that the logical
37013d8817e4Smiodor operator has a slightly lower precedence than logical and.
37023d8817e4Smiod
37033d8817e4Smiod@end table
37043d8817e4Smiod@end enumerate
37053d8817e4Smiod
37063d8817e4SmiodIn short, it's only meaningful to add or subtract the @emph{offsets} in an
37073d8817e4Smiodaddress; you can only have a defined section in one of the two arguments.
37083d8817e4Smiod
37093d8817e4Smiod@node Pseudo Ops
37103d8817e4Smiod@chapter Assembler Directives
37113d8817e4Smiod
37123d8817e4Smiod@cindex directives, machine independent
37133d8817e4Smiod@cindex pseudo-ops, machine independent
37143d8817e4Smiod@cindex machine independent directives
37153d8817e4SmiodAll assembler directives have names that begin with a period (@samp{.}).
37163d8817e4SmiodThe rest of the name is letters, usually in lower case.
37173d8817e4Smiod
37183d8817e4SmiodThis chapter discusses directives that are available regardless of the
37193d8817e4Smiodtarget machine configuration for the @sc{gnu} assembler.
37203d8817e4Smiod@ifset GENERIC
37213d8817e4SmiodSome machine configurations provide additional directives.
37223d8817e4Smiod@xref{Machine Dependencies}.
37233d8817e4Smiod@end ifset
37243d8817e4Smiod@ifclear GENERIC
37253d8817e4Smiod@ifset machine-directives
37263d8817e4Smiod@xref{Machine Dependencies} for additional directives.
37273d8817e4Smiod@end ifset
37283d8817e4Smiod@end ifclear
37293d8817e4Smiod
37303d8817e4Smiod@menu
37313d8817e4Smiod* Abort::                       @code{.abort}
37323d8817e4Smiod@ifset COFF
37333d8817e4Smiod* ABORT::                       @code{.ABORT}
37343d8817e4Smiod@end ifset
37353d8817e4Smiod
37363d8817e4Smiod* Align::                       @code{.align @var{abs-expr} , @var{abs-expr}}
37373d8817e4Smiod* Altmacro::                    @code{.altmacro}
37383d8817e4Smiod* Ascii::                       @code{.ascii "@var{string}"}@dots{}
37393d8817e4Smiod* Asciz::                       @code{.asciz "@var{string}"}@dots{}
37403d8817e4Smiod* Balign::                      @code{.balign @var{abs-expr} , @var{abs-expr}}
37413d8817e4Smiod* Byte::                        @code{.byte @var{expressions}}
37423d8817e4Smiod* Comm::                        @code{.comm @var{symbol} , @var{length} }
37433d8817e4Smiod
37443d8817e4Smiod* CFI directives::		@code{.cfi_startproc}, @code{.cfi_endproc}, etc.
37453d8817e4Smiod
37463d8817e4Smiod* Data::                        @code{.data @var{subsection}}
37473d8817e4Smiod@ifset COFF
37483d8817e4Smiod* Def::                         @code{.def @var{name}}
37493d8817e4Smiod@end ifset
37503d8817e4Smiod@ifset aout-bout
37513d8817e4Smiod* Desc::                        @code{.desc @var{symbol}, @var{abs-expression}}
37523d8817e4Smiod@end ifset
37533d8817e4Smiod@ifset COFF
37543d8817e4Smiod* Dim::                         @code{.dim}
37553d8817e4Smiod@end ifset
37563d8817e4Smiod
37573d8817e4Smiod* Double::                      @code{.double @var{flonums}}
37583d8817e4Smiod* Eject::                       @code{.eject}
37593d8817e4Smiod* Else::                        @code{.else}
37603d8817e4Smiod* Elseif::                      @code{.elseif}
37613d8817e4Smiod* End::				@code{.end}
37623d8817e4Smiod@ifset COFF
37633d8817e4Smiod* Endef::                       @code{.endef}
37643d8817e4Smiod@end ifset
37653d8817e4Smiod
37663d8817e4Smiod* Endfunc::                     @code{.endfunc}
37673d8817e4Smiod* Endif::                       @code{.endif}
37683d8817e4Smiod* Equ::                         @code{.equ @var{symbol}, @var{expression}}
37693d8817e4Smiod* Equiv::                       @code{.equiv @var{symbol}, @var{expression}}
37703d8817e4Smiod* Eqv::                         @code{.eqv @var{symbol}, @var{expression}}
37713d8817e4Smiod* Err::				@code{.err}
37723d8817e4Smiod* Error::			@code{.error @var{string}}
37733d8817e4Smiod* Exitm::			@code{.exitm}
37743d8817e4Smiod* Extern::                      @code{.extern}
37753d8817e4Smiod* Fail::			@code{.fail}
37763d8817e4Smiod@ifclear no-file-dir
37773d8817e4Smiod* File::                        @code{.file @var{string}}
37783d8817e4Smiod@end ifclear
37793d8817e4Smiod
37803d8817e4Smiod* Fill::                        @code{.fill @var{repeat} , @var{size} , @var{value}}
37813d8817e4Smiod* Float::                       @code{.float @var{flonums}}
37823d8817e4Smiod* Func::                        @code{.func}
37833d8817e4Smiod* Global::                      @code{.global @var{symbol}}, @code{.globl @var{symbol}}
37843d8817e4Smiod@ifset ELF
37853d8817e4Smiod* Hidden::                      @code{.hidden @var{names}}
37863d8817e4Smiod@end ifset
37873d8817e4Smiod
37883d8817e4Smiod* hword::                       @code{.hword @var{expressions}}
37893d8817e4Smiod* Ident::                       @code{.ident}
37903d8817e4Smiod* If::                          @code{.if @var{absolute expression}}
37913d8817e4Smiod* Incbin::                      @code{.incbin "@var{file}"[,@var{skip}[,@var{count}]]}
37923d8817e4Smiod* Include::                     @code{.include "@var{file}"}
37933d8817e4Smiod* Int::                         @code{.int @var{expressions}}
37943d8817e4Smiod@ifset ELF
37953d8817e4Smiod* Internal::                    @code{.internal @var{names}}
37963d8817e4Smiod@end ifset
37973d8817e4Smiod
37983d8817e4Smiod* Irp::				@code{.irp @var{symbol},@var{values}}@dots{}
37993d8817e4Smiod* Irpc::			@code{.irpc @var{symbol},@var{values}}@dots{}
38003d8817e4Smiod* Lcomm::                       @code{.lcomm @var{symbol} , @var{length}}
38013d8817e4Smiod* Lflags::                      @code{.lflags}
38023d8817e4Smiod@ifclear no-line-dir
38033d8817e4Smiod* Line::                        @code{.line @var{line-number}}
38043d8817e4Smiod@end ifclear
38053d8817e4Smiod
38063d8817e4Smiod* Linkonce::			@code{.linkonce [@var{type}]}
38073d8817e4Smiod* List::                        @code{.list}
38083d8817e4Smiod* Ln::                          @code{.ln @var{line-number}}
38093d8817e4Smiod
38103d8817e4Smiod* LNS directives::              @code{.file}, @code{.loc}, etc.
38113d8817e4Smiod
38123d8817e4Smiod* Long::                        @code{.long @var{expressions}}
38133d8817e4Smiod@ignore
38143d8817e4Smiod* Lsym::                        @code{.lsym @var{symbol}, @var{expression}}
38153d8817e4Smiod@end ignore
38163d8817e4Smiod
38173d8817e4Smiod* Macro::			@code{.macro @var{name} @var{args}}@dots{}
38183d8817e4Smiod* MRI::				@code{.mri @var{val}}
38193d8817e4Smiod* Noaltmacro::                  @code{.noaltmacro}
38203d8817e4Smiod* Nolist::                      @code{.nolist}
38213d8817e4Smiod* Octa::                        @code{.octa @var{bignums}}
38223d8817e4Smiod* Org::                         @code{.org @var{new-lc} , @var{fill}}
38233d8817e4Smiod* P2align::                     @code{.p2align @var{abs-expr} , @var{abs-expr}}
38243d8817e4Smiod@ifset ELF
38253d8817e4Smiod* PopSection::                  @code{.popsection}
38263d8817e4Smiod* Previous::                    @code{.previous}
38273d8817e4Smiod@end ifset
38283d8817e4Smiod
38293d8817e4Smiod* Print::			@code{.print @var{string}}
38303d8817e4Smiod@ifset ELF
38313d8817e4Smiod* Protected::                   @code{.protected @var{names}}
38323d8817e4Smiod@end ifset
38333d8817e4Smiod
38343d8817e4Smiod* Psize::                       @code{.psize @var{lines}, @var{columns}}
38353d8817e4Smiod* Purgem::			@code{.purgem @var{name}}
38363d8817e4Smiod@ifset ELF
38373d8817e4Smiod* PushSection::                 @code{.pushsection @var{name}}
38383d8817e4Smiod@end ifset
38393d8817e4Smiod
38403d8817e4Smiod* Quad::                        @code{.quad @var{bignums}}
38413d8817e4Smiod* Rept::			@code{.rept @var{count}}
38423d8817e4Smiod* Sbttl::                       @code{.sbttl "@var{subheading}"}
38433d8817e4Smiod@ifset COFF
38443d8817e4Smiod* Scl::                         @code{.scl @var{class}}
38453d8817e4Smiod@end ifset
38463d8817e4Smiod@ifset COFF-ELF
38473d8817e4Smiod* Section::                     @code{.section @var{name}}
38483d8817e4Smiod@end ifset
38493d8817e4Smiod
38503d8817e4Smiod* Set::                         @code{.set @var{symbol}, @var{expression}}
38513d8817e4Smiod* Short::                       @code{.short @var{expressions}}
38523d8817e4Smiod* Single::                      @code{.single @var{flonums}}
38533d8817e4Smiod@ifset COFF-ELF
38543d8817e4Smiod* Size::                        @code{.size [@var{name} , @var{expression}]}
38553d8817e4Smiod@end ifset
38563d8817e4Smiod
38573d8817e4Smiod* Skip::                        @code{.skip @var{size} , @var{fill}}
38583d8817e4Smiod* Sleb128::			@code{.sleb128 @var{expressions}}
38593d8817e4Smiod* Space::                       @code{.space @var{size} , @var{fill}}
38603d8817e4Smiod@ifset have-stabs
38613d8817e4Smiod* Stab::                        @code{.stabd, .stabn, .stabs}
38623d8817e4Smiod@end ifset
38633d8817e4Smiod
38643d8817e4Smiod* String::                      @code{.string "@var{str}"}
38653d8817e4Smiod* Struct::			@code{.struct @var{expression}}
38663d8817e4Smiod@ifset ELF
38673d8817e4Smiod* SubSection::                  @code{.subsection}
38683d8817e4Smiod* Symver::                      @code{.symver @var{name},@var{name2@@nodename}}
38693d8817e4Smiod@end ifset
38703d8817e4Smiod
38713d8817e4Smiod@ifset COFF
38723d8817e4Smiod* Tag::                         @code{.tag @var{structname}}
38733d8817e4Smiod@end ifset
38743d8817e4Smiod
38753d8817e4Smiod* Text::                        @code{.text @var{subsection}}
38763d8817e4Smiod* Title::                       @code{.title "@var{heading}"}
38773d8817e4Smiod@ifset COFF-ELF
38783d8817e4Smiod* Type::                        @code{.type <@var{int} | @var{name} , @var{type description}>}
38793d8817e4Smiod@end ifset
38803d8817e4Smiod
38813d8817e4Smiod* Uleb128::                     @code{.uleb128 @var{expressions}}
38823d8817e4Smiod@ifset COFF
38833d8817e4Smiod* Val::                         @code{.val @var{addr}}
38843d8817e4Smiod@end ifset
38853d8817e4Smiod
38863d8817e4Smiod@ifset ELF
38873d8817e4Smiod* Version::                     @code{.version "@var{string}"}
38883d8817e4Smiod* VTableEntry::                 @code{.vtable_entry @var{table}, @var{offset}}
38893d8817e4Smiod* VTableInherit::               @code{.vtable_inherit @var{child}, @var{parent}}
38903d8817e4Smiod@end ifset
38913d8817e4Smiod
38923d8817e4Smiod* Warning::			@code{.warning @var{string}}
38933d8817e4Smiod* Weak::                        @code{.weak @var{names}}
38943d8817e4Smiod* Weakref::                     @code{.weakref @var{alias}, @var{symbol}}
38953d8817e4Smiod* Word::                        @code{.word @var{expressions}}
38963d8817e4Smiod* Deprecated::                  Deprecated Directives
38973d8817e4Smiod@end menu
38983d8817e4Smiod
38993d8817e4Smiod@node Abort
39003d8817e4Smiod@section @code{.abort}
39013d8817e4Smiod
39023d8817e4Smiod@cindex @code{abort} directive
39033d8817e4Smiod@cindex stopping the assembly
39043d8817e4SmiodThis directive stops the assembly immediately.  It is for
39053d8817e4Smiodcompatibility with other assemblers.  The original idea was that the
39063d8817e4Smiodassembly language source would be piped into the assembler.  If the sender
39073d8817e4Smiodof the source quit, it could use this directive tells @command{@value{AS}} to
39083d8817e4Smiodquit also.  One day @code{.abort} will not be supported.
39093d8817e4Smiod
39103d8817e4Smiod@ifset COFF
39113d8817e4Smiod@node ABORT
39123d8817e4Smiod@section @code{.ABORT}
39133d8817e4Smiod
39143d8817e4Smiod@cindex @code{ABORT} directive
39153d8817e4SmiodWhen producing COFF output, @command{@value{AS}} accepts this directive as a
39163d8817e4Smiodsynonym for @samp{.abort}.
39173d8817e4Smiod
39183d8817e4Smiod@ifset BOUT
39193d8817e4SmiodWhen producing @code{b.out} output, @command{@value{AS}} accepts this directive,
39203d8817e4Smiodbut ignores it.
39213d8817e4Smiod@end ifset
39223d8817e4Smiod@end ifset
39233d8817e4Smiod
39243d8817e4Smiod@node Align
39253d8817e4Smiod@section @code{.align @var{abs-expr}, @var{abs-expr}, @var{abs-expr}}
39263d8817e4Smiod
39273d8817e4Smiod@cindex padding the location counter
39283d8817e4Smiod@cindex @code{align} directive
39293d8817e4SmiodPad the location counter (in the current subsection) to a particular storage
39303d8817e4Smiodboundary.  The first expression (which must be absolute) is the alignment
39313d8817e4Smiodrequired, as described below.
39323d8817e4Smiod
39333d8817e4SmiodThe second expression (also absolute) gives the fill value to be stored in the
39343d8817e4Smiodpadding bytes.  It (and the comma) may be omitted.  If it is omitted, the
39353d8817e4Smiodpadding bytes are normally zero.  However, on some systems, if the section is
39363d8817e4Smiodmarked as containing code and the fill value is omitted, the space is filled
39373d8817e4Smiodwith no-op instructions.
39383d8817e4Smiod
39393d8817e4SmiodThe third expression is also absolute, and is also optional.  If it is present,
39403d8817e4Smiodit is the maximum number of bytes that should be skipped by this alignment
39413d8817e4Smioddirective.  If doing the alignment would require skipping more bytes than the
39423d8817e4Smiodspecified maximum, then the alignment is not done at all.  You can omit the
39433d8817e4Smiodfill value (the second argument) entirely by simply using two commas after the
39443d8817e4Smiodrequired alignment; this can be useful if you want the alignment to be filled
39453d8817e4Smiodwith no-op instructions when appropriate.
39463d8817e4Smiod
39473d8817e4SmiodThe way the required alignment is specified varies from system to system.
39483d8817e4SmiodFor the arc, hppa, i386 using ELF, i860, iq2000, m68k, or32,
39493d8817e4Smiods390, sparc, tic4x, tic80 and xtensa, the first expression is the
39503d8817e4Smiodalignment request in bytes.  For example @samp{.align 8} advances
39513d8817e4Smiodthe location counter until it is a multiple of 8.  If the location counter
39523d8817e4Smiodis already a multiple of 8, no change is needed.  For the tic54x, the
39533d8817e4Smiodfirst expression is the alignment request in words.
39543d8817e4Smiod
39553d8817e4SmiodFor other systems, including the i386 using a.out format, and the arm and
39563d8817e4Smiodstrongarm, it is the
39573d8817e4Smiodnumber of low-order zero bits the location counter must have after
39583d8817e4Smiodadvancement.  For example @samp{.align 3} advances the location
39593d8817e4Smiodcounter until it a multiple of 8.  If the location counter is already a
39603d8817e4Smiodmultiple of 8, no change is needed.
39613d8817e4Smiod
39623d8817e4SmiodThis inconsistency is due to the different behaviors of the various
39633d8817e4Smiodnative assemblers for these systems which GAS must emulate.
39643d8817e4SmiodGAS also provides @code{.balign} and @code{.p2align} directives,
39653d8817e4Smioddescribed later, which have a consistent behavior across all
39663d8817e4Smiodarchitectures (but are specific to GAS).
39673d8817e4Smiod
39683d8817e4Smiod@node Ascii
39693d8817e4Smiod@section @code{.ascii "@var{string}"}@dots{}
39703d8817e4Smiod
39713d8817e4Smiod@cindex @code{ascii} directive
39723d8817e4Smiod@cindex string literals
39733d8817e4Smiod@code{.ascii} expects zero or more string literals (@pxref{Strings})
39743d8817e4Smiodseparated by commas.  It assembles each string (with no automatic
39753d8817e4Smiodtrailing zero byte) into consecutive addresses.
39763d8817e4Smiod
39773d8817e4Smiod@node Asciz
39783d8817e4Smiod@section @code{.asciz "@var{string}"}@dots{}
39793d8817e4Smiod
39803d8817e4Smiod@cindex @code{asciz} directive
39813d8817e4Smiod@cindex zero-terminated strings
39823d8817e4Smiod@cindex null-terminated strings
39833d8817e4Smiod@code{.asciz} is just like @code{.ascii}, but each string is followed by
39843d8817e4Smioda zero byte.  The ``z'' in @samp{.asciz} stands for ``zero''.
39853d8817e4Smiod
39863d8817e4Smiod@node Balign
39873d8817e4Smiod@section @code{.balign[wl] @var{abs-expr}, @var{abs-expr}, @var{abs-expr}}
39883d8817e4Smiod
39893d8817e4Smiod@cindex padding the location counter given number of bytes
39903d8817e4Smiod@cindex @code{balign} directive
39913d8817e4SmiodPad the location counter (in the current subsection) to a particular
39923d8817e4Smiodstorage boundary.  The first expression (which must be absolute) is the
39933d8817e4Smiodalignment request in bytes.  For example @samp{.balign 8} advances
39943d8817e4Smiodthe location counter until it is a multiple of 8.  If the location counter
39953d8817e4Smiodis already a multiple of 8, no change is needed.
39963d8817e4Smiod
39973d8817e4SmiodThe second expression (also absolute) gives the fill value to be stored in the
39983d8817e4Smiodpadding bytes.  It (and the comma) may be omitted.  If it is omitted, the
39993d8817e4Smiodpadding bytes are normally zero.  However, on some systems, if the section is
40003d8817e4Smiodmarked as containing code and the fill value is omitted, the space is filled
40013d8817e4Smiodwith no-op instructions.
40023d8817e4Smiod
40033d8817e4SmiodThe third expression is also absolute, and is also optional.  If it is present,
40043d8817e4Smiodit is the maximum number of bytes that should be skipped by this alignment
40053d8817e4Smioddirective.  If doing the alignment would require skipping more bytes than the
40063d8817e4Smiodspecified maximum, then the alignment is not done at all.  You can omit the
40073d8817e4Smiodfill value (the second argument) entirely by simply using two commas after the
40083d8817e4Smiodrequired alignment; this can be useful if you want the alignment to be filled
40093d8817e4Smiodwith no-op instructions when appropriate.
40103d8817e4Smiod
40113d8817e4Smiod@cindex @code{balignw} directive
40123d8817e4Smiod@cindex @code{balignl} directive
40133d8817e4SmiodThe @code{.balignw} and @code{.balignl} directives are variants of the
40143d8817e4Smiod@code{.balign} directive.  The @code{.balignw} directive treats the fill
40153d8817e4Smiodpattern as a two byte word value.  The @code{.balignl} directives treats the
40163d8817e4Smiodfill pattern as a four byte longword value.  For example, @code{.balignw
40173d8817e4Smiod4,0x368d} will align to a multiple of 4.  If it skips two bytes, they will be
40183d8817e4Smiodfilled in with the value 0x368d (the exact placement of the bytes depends upon
40193d8817e4Smiodthe endianness of the processor).  If it skips 1 or 3 bytes, the fill value is
40203d8817e4Smiodundefined.
40213d8817e4Smiod
40223d8817e4Smiod@node Byte
40233d8817e4Smiod@section @code{.byte @var{expressions}}
40243d8817e4Smiod
40253d8817e4Smiod@cindex @code{byte} directive
40263d8817e4Smiod@cindex integers, one byte
40273d8817e4Smiod@code{.byte} expects zero or more expressions, separated by commas.
40283d8817e4SmiodEach expression is assembled into the next byte.
40293d8817e4Smiod
40303d8817e4Smiod@node Comm
40313d8817e4Smiod@section @code{.comm @var{symbol} , @var{length} }
40323d8817e4Smiod
40333d8817e4Smiod@cindex @code{comm} directive
40343d8817e4Smiod@cindex symbol, common
40353d8817e4Smiod@code{.comm} declares a common symbol named @var{symbol}.  When linking, a
40363d8817e4Smiodcommon symbol in one object file may be merged with a defined or common symbol
40373d8817e4Smiodof the same name in another object file.  If @code{@value{LD}} does not see a
40383d8817e4Smioddefinition for the symbol--just one or more common symbols--then it will
40393d8817e4Smiodallocate @var{length} bytes of uninitialized memory.  @var{length} must be an
40403d8817e4Smiodabsolute expression.  If @code{@value{LD}} sees multiple common symbols with
40413d8817e4Smiodthe same name, and they do not all have the same size, it will allocate space
40423d8817e4Smiodusing the largest size.
40433d8817e4Smiod
40443d8817e4Smiod@ifset ELF
40453d8817e4SmiodWhen using ELF, the @code{.comm} directive takes an optional third argument.
40463d8817e4SmiodThis is the desired alignment of the symbol, specified as a byte boundary (for
40473d8817e4Smiodexample, an alignment of 16 means that the least significant 4 bits of the
40483d8817e4Smiodaddress should be zero).  The alignment must be an absolute expression, and it
40493d8817e4Smiodmust be a power of two.  If @code{@value{LD}} allocates uninitialized memory
40503d8817e4Smiodfor the common symbol, it will use the alignment when placing the symbol.  If
40513d8817e4Smiodno alignment is specified, @command{@value{AS}} will set the alignment to the
40523d8817e4Smiodlargest power of two less than or equal to the size of the symbol, up to a
40533d8817e4Smiodmaximum of 16.
40543d8817e4Smiod@end ifset
40553d8817e4Smiod
40563d8817e4Smiod@ifset HPPA
40573d8817e4SmiodThe syntax for @code{.comm} differs slightly on the HPPA.  The syntax is
40583d8817e4Smiod@samp{@var{symbol} .comm, @var{length}}; @var{symbol} is optional.
40593d8817e4Smiod@end ifset
40603d8817e4Smiod
40613d8817e4Smiod@node CFI directives
40623d8817e4Smiod@section @code{.cfi_startproc}
40633d8817e4Smiod@cindex @code{cfi_startproc} directive
40643d8817e4Smiod@code{.cfi_startproc} is used at the beginning of each function that
40653d8817e4Smiodshould have an entry in @code{.eh_frame}. It initializes some internal
40663d8817e4Smioddata structures and emits architecture dependent initial CFI instructions.
40673d8817e4SmiodDon't forget to close the function by
40683d8817e4Smiod@code{.cfi_endproc}.
40693d8817e4Smiod
40703d8817e4Smiod@section @code{.cfi_endproc}
40713d8817e4Smiod@cindex @code{cfi_endproc} directive
40723d8817e4Smiod@code{.cfi_endproc} is used at the end of a function where it closes its
40733d8817e4Smiodunwind entry previously opened by
40743d8817e4Smiod@code{.cfi_startproc}. and emits it to @code{.eh_frame}.
40753d8817e4Smiod
40763d8817e4Smiod@section @code{.cfi_def_cfa @var{register}, @var{offset}}
40773d8817e4Smiod@code{.cfi_def_cfa} defines a rule for computing CFA as: @i{take
40783d8817e4Smiodaddress from @var{register} and add @var{offset} to it}.
40793d8817e4Smiod
40803d8817e4Smiod@section @code{.cfi_def_cfa_register @var{register}}
40813d8817e4Smiod@code{.cfi_def_cfa_register} modifies a rule for computing CFA. From
40823d8817e4Smiodnow on @var{register} will be used instead of the old one. Offset
40833d8817e4Smiodremains the same.
40843d8817e4Smiod
40853d8817e4Smiod@section @code{.cfi_def_cfa_offset @var{offset}}
40863d8817e4Smiod@code{.cfi_def_cfa_offset} modifies a rule for computing CFA. Register
40873d8817e4Smiodremains the same, but @var{offset} is new. Note that it is the
40883d8817e4Smiodabsolute offset that will be added to a defined register to compute
40893d8817e4SmiodCFA address.
40903d8817e4Smiod
40913d8817e4Smiod@section @code{.cfi_adjust_cfa_offset @var{offset}}
40923d8817e4SmiodSame as @code{.cfi_def_cfa_offset} but @var{offset} is a relative
40933d8817e4Smiodvalue that is added/substracted from the previous offset.
40943d8817e4Smiod
40953d8817e4Smiod@section @code{.cfi_offset @var{register}, @var{offset}}
40963d8817e4SmiodPrevious value of @var{register} is saved at offset @var{offset} from
40973d8817e4SmiodCFA.
40983d8817e4Smiod
40993d8817e4Smiod@section @code{.cfi_rel_offset @var{register}, @var{offset}}
41003d8817e4SmiodPrevious value of @var{register} is saved at offset @var{offset} from
41013d8817e4Smiodthe current CFA register.  This is transformed to @code{.cfi_offset}
41023d8817e4Smiodusing the known displacement of the CFA register from the CFA.
41033d8817e4SmiodThis is often easier to use, because the number will match the
41043d8817e4Smiodcode it's annotating.
41053d8817e4Smiod
41063d8817e4Smiod@section @code{.cfi_signal_frame}
41073d8817e4SmiodMark current function as signal trampoline.
41083d8817e4Smiod
41093d8817e4Smiod@section @code{.cfi_window_save}
41103d8817e4SmiodSPARC register window has been saved.
41113d8817e4Smiod
41123d8817e4Smiod@section @code{.cfi_escape} @var{expression}[, @dots{}]
41133d8817e4SmiodAllows the user to add arbitrary bytes to the unwind info.  One
41143d8817e4Smiodmight use this to add OS-specific CFI opcodes, or generic CFI
41153d8817e4Smiodopcodes that GAS does not yet support.
41163d8817e4Smiod
41173d8817e4Smiod@node LNS directives
41183d8817e4Smiod@section @code{.file @var{fileno} @var{filename}}
41193d8817e4Smiod@cindex @code{file} directive
41203d8817e4SmiodWhen emitting dwarf2 line number information @code{.file} assigns filenames
41213d8817e4Smiodto the @code{.debug_line} file name table.  The @var{fileno} operand should
41223d8817e4Smiodbe a unique positive integer to use as the index of the entry in the table.
41233d8817e4SmiodThe @var{filename} operand is a C string literal.
41243d8817e4Smiod
41253d8817e4SmiodThe detail of filename indicies is exposed to the user because the filename
41263d8817e4Smiodtable is shared with the @code{.debug_info} section of the dwarf2 debugging
41273d8817e4Smiodinformation, and thus the user must know the exact indicies that table
41283d8817e4Smiodentries will have.
41293d8817e4Smiod
41303d8817e4Smiod@section @code{.loc @var{fileno} @var{lineno} [@var{column}] [@var{options}]}
41313d8817e4Smiod@cindex @code{loc} directive
41323d8817e4SmiodThe @code{.loc} directive will add row to the @code{.debug_line} line
41333d8817e4Smiodnumber matrix corresponding to the immediately following assembly
41343d8817e4Smiodinstruction.  The @var{fileno}, @var{lineno}, and optional @var{column}
41353d8817e4Smiodarguments will be applied to the @code{.debug_line} state machine before
41363d8817e4Smiodthe row is added.
41373d8817e4Smiod
41383d8817e4SmiodThe @var{options} are a sequence of the following tokens in any order:
41393d8817e4Smiod
41403d8817e4Smiod@table @code
41413d8817e4Smiod@item basic_block
41423d8817e4SmiodThis option will set the @code{basic_block} register in the
41433d8817e4Smiod@code{.debug_line} state machine to @code{true}.
41443d8817e4Smiod
41453d8817e4Smiod@item prologue_end
41463d8817e4SmiodThis option will set the @code{prologue_end} register in the
41473d8817e4Smiod@code{.debug_line} state machine to @code{true}.
41483d8817e4Smiod
41493d8817e4Smiod@item epilogue_begin
41503d8817e4SmiodThis option will set the @code{epilogue_begin} register in the
41513d8817e4Smiod@code{.debug_line} state machine to @code{true}.
41523d8817e4Smiod
41533d8817e4Smiod@item is_stmt @var{value}
41543d8817e4SmiodThis option will set the @code{is_stmt} register in the
41553d8817e4Smiod@code{.debug_line} state machine to @code{value}, which must be
41563d8817e4Smiodeither 0 or 1.
41573d8817e4Smiod
41583d8817e4Smiod@item isa @var{value}
41593d8817e4SmiodThis directive will set the @code{isa} register in the @code{.debug_line}
41603d8817e4Smiodstate machine to @var{value}, which must be an unsigned integer.
41613d8817e4Smiod
41623d8817e4Smiod@end table
41633d8817e4Smiod
41643d8817e4Smiod@section @code{.loc_mark_blocks @var{enable}}
41653d8817e4Smiod@cindex @code{loc_mark_blocks} directive
41663d8817e4SmiodThe @code{.loc_mark_blocks} directive makes the assembler emit an entry
41673d8817e4Smiodto the @code{.debug_line} line number matrix with the @code{basic_block}
41683d8817e4Smiodregister in the state machine set whenever a code label is seen.
41693d8817e4SmiodThe @var{enable} argument should be either 1 or 0, to enable or disable
41703d8817e4Smiodthis function respectively.
41713d8817e4Smiod
41723d8817e4Smiod@node Data
41733d8817e4Smiod@section @code{.data @var{subsection}}
41743d8817e4Smiod
41753d8817e4Smiod@cindex @code{data} directive
41763d8817e4Smiod@code{.data} tells @command{@value{AS}} to assemble the following statements onto the
41773d8817e4Smiodend of the data subsection numbered @var{subsection} (which is an
41783d8817e4Smiodabsolute expression).  If @var{subsection} is omitted, it defaults
41793d8817e4Smiodto zero.
41803d8817e4Smiod
41813d8817e4Smiod@ifset COFF
41823d8817e4Smiod@node Def
41833d8817e4Smiod@section @code{.def @var{name}}
41843d8817e4Smiod
41853d8817e4Smiod@cindex @code{def} directive
41863d8817e4Smiod@cindex COFF symbols, debugging
41873d8817e4Smiod@cindex debugging COFF symbols
41883d8817e4SmiodBegin defining debugging information for a symbol @var{name}; the
41893d8817e4Smioddefinition extends until the @code{.endef} directive is encountered.
41903d8817e4Smiod@ifset BOUT
41913d8817e4Smiod
41923d8817e4SmiodThis directive is only observed when @command{@value{AS}} is configured for COFF
41933d8817e4Smiodformat output; when producing @code{b.out}, @samp{.def} is recognized,
41943d8817e4Smiodbut ignored.
41953d8817e4Smiod@end ifset
41963d8817e4Smiod@end ifset
41973d8817e4Smiod
41983d8817e4Smiod@ifset aout-bout
41993d8817e4Smiod@node Desc
42003d8817e4Smiod@section @code{.desc @var{symbol}, @var{abs-expression}}
42013d8817e4Smiod
42023d8817e4Smiod@cindex @code{desc} directive
42033d8817e4Smiod@cindex COFF symbol descriptor
42043d8817e4Smiod@cindex symbol descriptor, COFF
42053d8817e4SmiodThis directive sets the descriptor of the symbol (@pxref{Symbol Attributes})
42063d8817e4Smiodto the low 16 bits of an absolute expression.
42073d8817e4Smiod
42083d8817e4Smiod@ifset COFF
42093d8817e4SmiodThe @samp{.desc} directive is not available when @command{@value{AS}} is
42103d8817e4Smiodconfigured for COFF output; it is only for @code{a.out} or @code{b.out}
42113d8817e4Smiodobject format.  For the sake of compatibility, @command{@value{AS}} accepts
42123d8817e4Smiodit, but produces no output, when configured for COFF.
42133d8817e4Smiod@end ifset
42143d8817e4Smiod@end ifset
42153d8817e4Smiod
42163d8817e4Smiod@ifset COFF
42173d8817e4Smiod@node Dim
42183d8817e4Smiod@section @code{.dim}
42193d8817e4Smiod
42203d8817e4Smiod@cindex @code{dim} directive
42213d8817e4Smiod@cindex COFF auxiliary symbol information
42223d8817e4Smiod@cindex auxiliary symbol information, COFF
42233d8817e4SmiodThis directive is generated by compilers to include auxiliary debugging
42243d8817e4Smiodinformation in the symbol table.  It is only permitted inside
42253d8817e4Smiod@code{.def}/@code{.endef} pairs.
42263d8817e4Smiod@ifset BOUT
42273d8817e4Smiod
42283d8817e4Smiod@samp{.dim} is only meaningful when generating COFF format output; when
42293d8817e4Smiod@command{@value{AS}} is generating @code{b.out}, it accepts this directive but
42303d8817e4Smiodignores it.
42313d8817e4Smiod@end ifset
42323d8817e4Smiod@end ifset
42333d8817e4Smiod
42343d8817e4Smiod@node Double
42353d8817e4Smiod@section @code{.double @var{flonums}}
42363d8817e4Smiod
42373d8817e4Smiod@cindex @code{double} directive
42383d8817e4Smiod@cindex floating point numbers (double)
42393d8817e4Smiod@code{.double} expects zero or more flonums, separated by commas.  It
42403d8817e4Smiodassembles floating point numbers.
42413d8817e4Smiod@ifset GENERIC
42423d8817e4SmiodThe exact kind of floating point numbers emitted depends on how
42433d8817e4Smiod@command{@value{AS}} is configured.  @xref{Machine Dependencies}.
42443d8817e4Smiod@end ifset
42453d8817e4Smiod@ifclear GENERIC
42463d8817e4Smiod@ifset IEEEFLOAT
42473d8817e4SmiodOn the @value{TARGET} family @samp{.double} emits 64-bit floating-point numbers
42483d8817e4Smiodin @sc{ieee} format.
42493d8817e4Smiod@end ifset
42503d8817e4Smiod@end ifclear
42513d8817e4Smiod
42523d8817e4Smiod@node Eject
42533d8817e4Smiod@section @code{.eject}
42543d8817e4Smiod
42553d8817e4Smiod@cindex @code{eject} directive
42563d8817e4Smiod@cindex new page, in listings
42573d8817e4Smiod@cindex page, in listings
42583d8817e4Smiod@cindex listing control: new page
42593d8817e4SmiodForce a page break at this point, when generating assembly listings.
42603d8817e4Smiod
42613d8817e4Smiod@node Else
42623d8817e4Smiod@section @code{.else}
42633d8817e4Smiod
42643d8817e4Smiod@cindex @code{else} directive
42653d8817e4Smiod@code{.else} is part of the @command{@value{AS}} support for conditional
42663d8817e4Smiodassembly; @pxref{If,,@code{.if}}.  It marks the beginning of a section
42673d8817e4Smiodof code to be assembled if the condition for the preceding @code{.if}
42683d8817e4Smiodwas false.
42693d8817e4Smiod
42703d8817e4Smiod@node Elseif
42713d8817e4Smiod@section @code{.elseif}
42723d8817e4Smiod
42733d8817e4Smiod@cindex @code{elseif} directive
42743d8817e4Smiod@code{.elseif} is part of the @command{@value{AS}} support for conditional
42753d8817e4Smiodassembly; @pxref{If,,@code{.if}}.  It is shorthand for beginning a new
42763d8817e4Smiod@code{.if} block that would otherwise fill the entire @code{.else} section.
42773d8817e4Smiod
42783d8817e4Smiod@node End
42793d8817e4Smiod@section @code{.end}
42803d8817e4Smiod
42813d8817e4Smiod@cindex @code{end} directive
42823d8817e4Smiod@code{.end} marks the end of the assembly file.  @command{@value{AS}} does not
42833d8817e4Smiodprocess anything in the file past the @code{.end} directive.
42843d8817e4Smiod
42853d8817e4Smiod@ifset COFF
42863d8817e4Smiod@node Endef
42873d8817e4Smiod@section @code{.endef}
42883d8817e4Smiod
42893d8817e4Smiod@cindex @code{endef} directive
42903d8817e4SmiodThis directive flags the end of a symbol definition begun with
42913d8817e4Smiod@code{.def}.
42923d8817e4Smiod@ifset BOUT
42933d8817e4Smiod
42943d8817e4Smiod@samp{.endef} is only meaningful when generating COFF format output; if
42953d8817e4Smiod@command{@value{AS}} is configured to generate @code{b.out}, it accepts this
42963d8817e4Smioddirective but ignores it.
42973d8817e4Smiod@end ifset
42983d8817e4Smiod@end ifset
42993d8817e4Smiod
43003d8817e4Smiod@node Endfunc
43013d8817e4Smiod@section @code{.endfunc}
43023d8817e4Smiod@cindex @code{endfunc} directive
43033d8817e4Smiod@code{.endfunc} marks the end of a function specified with @code{.func}.
43043d8817e4Smiod
43053d8817e4Smiod@node Endif
43063d8817e4Smiod@section @code{.endif}
43073d8817e4Smiod
43083d8817e4Smiod@cindex @code{endif} directive
43093d8817e4Smiod@code{.endif} is part of the @command{@value{AS}} support for conditional assembly;
43103d8817e4Smiodit marks the end of a block of code that is only assembled
43113d8817e4Smiodconditionally.  @xref{If,,@code{.if}}.
43123d8817e4Smiod
43133d8817e4Smiod@node Equ
43143d8817e4Smiod@section @code{.equ @var{symbol}, @var{expression}}
43153d8817e4Smiod
43163d8817e4Smiod@cindex @code{equ} directive
43173d8817e4Smiod@cindex assigning values to symbols
43183d8817e4Smiod@cindex symbols, assigning values to
43193d8817e4SmiodThis directive sets the value of @var{symbol} to @var{expression}.
43203d8817e4SmiodIt is synonymous with @samp{.set}; @pxref{Set,,@code{.set}}.
43213d8817e4Smiod
43223d8817e4Smiod@ifset HPPA
43233d8817e4SmiodThe syntax for @code{equ} on the HPPA is
43243d8817e4Smiod@samp{@var{symbol} .equ @var{expression}}.
43253d8817e4Smiod@end ifset
43263d8817e4Smiod
43273d8817e4Smiod@ifset Z80
43283d8817e4SmiodThe syntax for @code{equ} on the Z80 is
43293d8817e4Smiod@samp{@var{symbol} equ @var{expression}}.
43303d8817e4SmiodOn the Z80 it is an eror if @var{symbol} is already defined,
43313d8817e4Smiodbut the symbol is not protected from later redefinition,
43323d8817e4Smiodcompare @xref{Equiv}.
43333d8817e4Smiod@end ifset
43343d8817e4Smiod
43353d8817e4Smiod@node Equiv
43363d8817e4Smiod@section @code{.equiv @var{symbol}, @var{expression}}
43373d8817e4Smiod@cindex @code{equiv} directive
43383d8817e4SmiodThe @code{.equiv} directive is like @code{.equ} and @code{.set}, except that
43393d8817e4Smiodthe assembler will signal an error if @var{symbol} is already defined.  Note a
43403d8817e4Smiodsymbol which has been referenced but not actually defined is considered to be
43413d8817e4Smiodundefined.
43423d8817e4Smiod
43433d8817e4SmiodExcept for the contents of the error message, this is roughly equivalent to
43443d8817e4Smiod@smallexample
43453d8817e4Smiod.ifdef SYM
43463d8817e4Smiod.err
43473d8817e4Smiod.endif
43483d8817e4Smiod.equ SYM,VAL
43493d8817e4Smiod@end smallexample
43503d8817e4Smiodplus it protects the symbol from later redefinition.
43513d8817e4Smiod
43523d8817e4Smiod@node Eqv
43533d8817e4Smiod@section @code{.eqv @var{symbol}, @var{expression}}
43543d8817e4Smiod@cindex @code{eqv} directive
43553d8817e4SmiodThe @code{.eqv} directive is like @code{.equiv}, but no attempt is made to
43563d8817e4Smiodevaluate the expression or any part of it immediately.  Instead each time
43573d8817e4Smiodthe resulting symbol is used in an expression, a snapshot of its current
43583d8817e4Smiodvalue is taken.
43593d8817e4Smiod
43603d8817e4Smiod@node Err
43613d8817e4Smiod@section @code{.err}
43623d8817e4Smiod@cindex @code{err} directive
43633d8817e4SmiodIf @command{@value{AS}} assembles a @code{.err} directive, it will print an error
43643d8817e4Smiodmessage and, unless the @option{-Z} option was used, it will not generate an
43653d8817e4Smiodobject file.  This can be used to signal an error in conditionally compiled code.
43663d8817e4Smiod
43673d8817e4Smiod@node Error
43683d8817e4Smiod@section @code{.error "@var{string}"}
43693d8817e4Smiod@cindex error directive
43703d8817e4Smiod
43713d8817e4SmiodSimilarly to @code{.err}, this directive emits an error, but you can specify a
43723d8817e4Smiodstring that will be emitted as the error message.  If you don't specify the
43733d8817e4Smiodmessage, it defaults to @code{".error directive invoked in source file"}.
43743d8817e4Smiod@xref{Errors, ,Error and Warning Messages}.
43753d8817e4Smiod
43763d8817e4Smiod@smallexample
43773d8817e4Smiod .error "This code has not been assembled and tested."
43783d8817e4Smiod@end smallexample
43793d8817e4Smiod
43803d8817e4Smiod@node Exitm
43813d8817e4Smiod@section @code{.exitm}
43823d8817e4SmiodExit early from the current macro definition.  @xref{Macro}.
43833d8817e4Smiod
43843d8817e4Smiod@node Extern
43853d8817e4Smiod@section @code{.extern}
43863d8817e4Smiod
43873d8817e4Smiod@cindex @code{extern} directive
43883d8817e4Smiod@code{.extern} is accepted in the source program---for compatibility
43893d8817e4Smiodwith other assemblers---but it is ignored.  @command{@value{AS}} treats
43903d8817e4Smiodall undefined symbols as external.
43913d8817e4Smiod
43923d8817e4Smiod@node Fail
43933d8817e4Smiod@section @code{.fail @var{expression}}
43943d8817e4Smiod
43953d8817e4Smiod@cindex @code{fail} directive
43963d8817e4SmiodGenerates an error or a warning.  If the value of the @var{expression} is 500
43973d8817e4Smiodor more, @command{@value{AS}} will print a warning message.  If the value is less
43983d8817e4Smiodthan 500, @command{@value{AS}} will print an error message.  The message will
43993d8817e4Smiodinclude the value of @var{expression}.  This can occasionally be useful inside
44003d8817e4Smiodcomplex nested macros or conditional assembly.
44013d8817e4Smiod
44023d8817e4Smiod@ifclear no-file-dir
44033d8817e4Smiod@node File
44043d8817e4Smiod@section @code{.file @var{string}}
44053d8817e4Smiod
44063d8817e4Smiod@cindex @code{file} directive
44073d8817e4Smiod@cindex logical file name
44083d8817e4Smiod@cindex file name, logical
44093d8817e4Smiod@code{.file} tells @command{@value{AS}} that we are about to start a new logical
44103d8817e4Smiodfile.  @var{string} is the new file name.  In general, the filename is
44113d8817e4Smiodrecognized whether or not it is surrounded by quotes @samp{"}; but if you wish
44123d8817e4Smiodto specify an empty file name, you must give the quotes--@code{""}.  This
44133d8817e4Smiodstatement may go away in future: it is only recognized to be compatible with
44143d8817e4Smiodold @command{@value{AS}} programs.
44153d8817e4Smiod@end ifclear
44163d8817e4Smiod
44173d8817e4Smiod@node Fill
44183d8817e4Smiod@section @code{.fill @var{repeat} , @var{size} , @var{value}}
44193d8817e4Smiod
44203d8817e4Smiod@cindex @code{fill} directive
44213d8817e4Smiod@cindex writing patterns in memory
44223d8817e4Smiod@cindex patterns, writing in memory
44233d8817e4Smiod@var{repeat}, @var{size} and @var{value} are absolute expressions.
44243d8817e4SmiodThis emits @var{repeat} copies of @var{size} bytes.  @var{Repeat}
44253d8817e4Smiodmay be zero or more.  @var{Size} may be zero or more, but if it is
44263d8817e4Smiodmore than 8, then it is deemed to have the value 8, compatible with
44273d8817e4Smiodother people's assemblers.  The contents of each @var{repeat} bytes
44283d8817e4Smiodis taken from an 8-byte number.  The highest order 4 bytes are
44293d8817e4Smiodzero.  The lowest order 4 bytes are @var{value} rendered in the
44303d8817e4Smiodbyte-order of an integer on the computer @command{@value{AS}} is assembling for.
44313d8817e4SmiodEach @var{size} bytes in a repetition is taken from the lowest order
44323d8817e4Smiod@var{size} bytes of this number.  Again, this bizarre behavior is
44333d8817e4Smiodcompatible with other people's assemblers.
44343d8817e4Smiod
44353d8817e4Smiod@var{size} and @var{value} are optional.
44363d8817e4SmiodIf the second comma and @var{value} are absent, @var{value} is
44373d8817e4Smiodassumed zero.  If the first comma and following tokens are absent,
44383d8817e4Smiod@var{size} is assumed to be 1.
44393d8817e4Smiod
44403d8817e4Smiod@node Float
44413d8817e4Smiod@section @code{.float @var{flonums}}
44423d8817e4Smiod
44433d8817e4Smiod@cindex floating point numbers (single)
44443d8817e4Smiod@cindex @code{float} directive
44453d8817e4SmiodThis directive assembles zero or more flonums, separated by commas.  It
44463d8817e4Smiodhas the same effect as @code{.single}.
44473d8817e4Smiod@ifset GENERIC
44483d8817e4SmiodThe exact kind of floating point numbers emitted depends on how
44493d8817e4Smiod@command{@value{AS}} is configured.
44503d8817e4Smiod@xref{Machine Dependencies}.
44513d8817e4Smiod@end ifset
44523d8817e4Smiod@ifclear GENERIC
44533d8817e4Smiod@ifset IEEEFLOAT
44543d8817e4SmiodOn the @value{TARGET} family, @code{.float} emits 32-bit floating point numbers
44553d8817e4Smiodin @sc{ieee} format.
44563d8817e4Smiod@end ifset
44573d8817e4Smiod@end ifclear
44583d8817e4Smiod
44593d8817e4Smiod@node Func
44603d8817e4Smiod@section @code{.func @var{name}[,@var{label}]}
44613d8817e4Smiod@cindex @code{func} directive
44623d8817e4Smiod@code{.func} emits debugging information to denote function @var{name}, and
44633d8817e4Smiodis ignored unless the file is assembled with debugging enabled.
44643d8817e4SmiodOnly @samp{--gstabs[+]} is currently supported.
44653d8817e4Smiod@var{label} is the entry point of the function and if omitted @var{name}
44663d8817e4Smiodprepended with the @samp{leading char} is used.
44673d8817e4Smiod@samp{leading char} is usually @code{_} or nothing, depending on the target.
44683d8817e4SmiodAll functions are currently defined to have @code{void} return type.
44693d8817e4SmiodThe function must be terminated with @code{.endfunc}.
44703d8817e4Smiod
44713d8817e4Smiod@node Global
44723d8817e4Smiod@section @code{.global @var{symbol}}, @code{.globl @var{symbol}}
44733d8817e4Smiod
44743d8817e4Smiod@cindex @code{global} directive
44753d8817e4Smiod@cindex symbol, making visible to linker
44763d8817e4Smiod@code{.global} makes the symbol visible to @code{@value{LD}}.  If you define
44773d8817e4Smiod@var{symbol} in your partial program, its value is made available to
44783d8817e4Smiodother partial programs that are linked with it.  Otherwise,
44793d8817e4Smiod@var{symbol} takes its attributes from a symbol of the same name
44803d8817e4Smiodfrom another file linked into the same program.
44813d8817e4Smiod
44823d8817e4SmiodBoth spellings (@samp{.globl} and @samp{.global}) are accepted, for
44833d8817e4Smiodcompatibility with other assemblers.
44843d8817e4Smiod
44853d8817e4Smiod@ifset HPPA
44863d8817e4SmiodOn the HPPA, @code{.global} is not always enough to make it accessible to other
44873d8817e4Smiodpartial programs.  You may need the HPPA-only @code{.EXPORT} directive as well.
44883d8817e4Smiod@xref{HPPA Directives,, HPPA Assembler Directives}.
44893d8817e4Smiod@end ifset
44903d8817e4Smiod
44913d8817e4Smiod@ifset ELF
44923d8817e4Smiod@node Hidden
44933d8817e4Smiod@section @code{.hidden @var{names}}
44943d8817e4Smiod
44953d8817e4Smiod@cindex @code{hidden} directive
44963d8817e4Smiod@cindex visibility
44973d8817e4SmiodThis is one of the ELF visibility directives.  The other two are
44983d8817e4Smiod@code{.internal} (@pxref{Internal,,@code{.internal}}) and
44993d8817e4Smiod@code{.protected} (@pxref{Protected,,@code{.protected}}).
45003d8817e4Smiod
45013d8817e4SmiodThis directive overrides the named symbols default visibility (which is set by
45023d8817e4Smiodtheir binding: local, global or weak).  The directive sets the visibility to
45033d8817e4Smiod@code{hidden} which means that the symbols are not visible to other components.
45043d8817e4SmiodSuch symbols are always considered to be @code{protected} as well.
45053d8817e4Smiod@end ifset
45063d8817e4Smiod
45073d8817e4Smiod@node hword
45083d8817e4Smiod@section @code{.hword @var{expressions}}
45093d8817e4Smiod
45103d8817e4Smiod@cindex @code{hword} directive
45113d8817e4Smiod@cindex integers, 16-bit
45123d8817e4Smiod@cindex numbers, 16-bit
45133d8817e4Smiod@cindex sixteen bit integers
45143d8817e4SmiodThis expects zero or more @var{expressions}, and emits
45153d8817e4Smioda 16 bit number for each.
45163d8817e4Smiod
45173d8817e4Smiod@ifset GENERIC
45183d8817e4SmiodThis directive is a synonym for @samp{.short}; depending on the target
45193d8817e4Smiodarchitecture, it may also be a synonym for @samp{.word}.
45203d8817e4Smiod@end ifset
45213d8817e4Smiod@ifclear GENERIC
45223d8817e4Smiod@ifset W32
45233d8817e4SmiodThis directive is a synonym for @samp{.short}.
45243d8817e4Smiod@end ifset
45253d8817e4Smiod@ifset W16
45263d8817e4SmiodThis directive is a synonym for both @samp{.short} and @samp{.word}.
45273d8817e4Smiod@end ifset
45283d8817e4Smiod@end ifclear
45293d8817e4Smiod
45303d8817e4Smiod@node Ident
45313d8817e4Smiod@section @code{.ident}
45323d8817e4Smiod
45333d8817e4Smiod@cindex @code{ident} directive
45343d8817e4Smiod
45353d8817e4SmiodThis directive is used by some assemblers to place tags in object files.  The
45363d8817e4Smiodbehavior of this directive varies depending on the target.  When using the
45373d8817e4Smioda.out object file format, @command{@value{AS}} simply accepts the directive for
45383d8817e4Smiodsource-file compatibility with existing assemblers, but does not emit anything
45393d8817e4Smiodfor it.  When using COFF, comments are emitted to the @code{.comment} or
45403d8817e4Smiod@code{.rdata} section, depending on the target.  When using ELF, comments are
45413d8817e4Smiodemitted to the @code{.comment} section.
45423d8817e4Smiod
45433d8817e4Smiod@node If
45443d8817e4Smiod@section @code{.if @var{absolute expression}}
45453d8817e4Smiod
45463d8817e4Smiod@cindex conditional assembly
45473d8817e4Smiod@cindex @code{if} directive
45483d8817e4Smiod@code{.if} marks the beginning of a section of code which is only
45493d8817e4Smiodconsidered part of the source program being assembled if the argument
45503d8817e4Smiod(which must be an @var{absolute expression}) is non-zero.  The end of
45513d8817e4Smiodthe conditional section of code must be marked by @code{.endif}
45523d8817e4Smiod(@pxref{Endif,,@code{.endif}}); optionally, you may include code for the
45533d8817e4Smiodalternative condition, flagged by @code{.else} (@pxref{Else,,@code{.else}}).
45543d8817e4SmiodIf you have several conditions to check, @code{.elseif} may be used to avoid
45553d8817e4Smiodnesting blocks if/else within each subsequent @code{.else} block.
45563d8817e4Smiod
45573d8817e4SmiodThe following variants of @code{.if} are also supported:
45583d8817e4Smiod@table @code
45593d8817e4Smiod@cindex @code{ifdef} directive
45603d8817e4Smiod@item .ifdef @var{symbol}
45613d8817e4SmiodAssembles the following section of code if the specified @var{symbol}
45623d8817e4Smiodhas been defined.  Note a symbol which has been referenced but not yet defined
45633d8817e4Smiodis considered to be undefined.
45643d8817e4Smiod
45653d8817e4Smiod@cindex @code{ifb} directive
45663d8817e4Smiod@item .ifb @var{text}
45673d8817e4SmiodAssembles the following section of code if the operand is blank (empty).
45683d8817e4Smiod
45693d8817e4Smiod@cindex @code{ifc} directive
45703d8817e4Smiod@item .ifc @var{string1},@var{string2}
45713d8817e4SmiodAssembles the following section of code if the two strings are the same.  The
45723d8817e4Smiodstrings may be optionally quoted with single quotes.  If they are not quoted,
45733d8817e4Smiodthe first string stops at the first comma, and the second string stops at the
45743d8817e4Smiodend of the line.  Strings which contain whitespace should be quoted.  The
45753d8817e4Smiodstring comparison is case sensitive.
45763d8817e4Smiod
45773d8817e4Smiod@cindex @code{ifeq} directive
45783d8817e4Smiod@item .ifeq @var{absolute expression}
45793d8817e4SmiodAssembles the following section of code if the argument is zero.
45803d8817e4Smiod
45813d8817e4Smiod@cindex @code{ifeqs} directive
45823d8817e4Smiod@item .ifeqs @var{string1},@var{string2}
45833d8817e4SmiodAnother form of @code{.ifc}.  The strings must be quoted using double quotes.
45843d8817e4Smiod
45853d8817e4Smiod@cindex @code{ifge} directive
45863d8817e4Smiod@item .ifge @var{absolute expression}
45873d8817e4SmiodAssembles the following section of code if the argument is greater than or
45883d8817e4Smiodequal to zero.
45893d8817e4Smiod
45903d8817e4Smiod@cindex @code{ifgt} directive
45913d8817e4Smiod@item .ifgt @var{absolute expression}
45923d8817e4SmiodAssembles the following section of code if the argument is greater than zero.
45933d8817e4Smiod
45943d8817e4Smiod@cindex @code{ifle} directive
45953d8817e4Smiod@item .ifle @var{absolute expression}
45963d8817e4SmiodAssembles the following section of code if the argument is less than or equal
45973d8817e4Smiodto zero.
45983d8817e4Smiod
45993d8817e4Smiod@cindex @code{iflt} directive
46003d8817e4Smiod@item .iflt @var{absolute expression}
46013d8817e4SmiodAssembles the following section of code if the argument is less than zero.
46023d8817e4Smiod
46033d8817e4Smiod@cindex @code{ifnb} directive
46043d8817e4Smiod@item .ifnb @var{text}
46053d8817e4SmiodLike @code{.ifb}, but the sense of the test is reversed: this assembles the
46063d8817e4Smiodfollowing section of code if the operand is non-blank (non-empty).
46073d8817e4Smiod
46083d8817e4Smiod@cindex @code{ifnc} directive
46093d8817e4Smiod@item .ifnc @var{string1},@var{string2}.
46103d8817e4SmiodLike @code{.ifc}, but the sense of the test is reversed: this assembles the
46113d8817e4Smiodfollowing section of code if the two strings are not the same.
46123d8817e4Smiod
46133d8817e4Smiod@cindex @code{ifndef} directive
46143d8817e4Smiod@cindex @code{ifnotdef} directive
46153d8817e4Smiod@item .ifndef @var{symbol}
46163d8817e4Smiod@itemx .ifnotdef @var{symbol}
46173d8817e4SmiodAssembles the following section of code if the specified @var{symbol}
46183d8817e4Smiodhas not been defined.  Both spelling variants are equivalent.  Note a symbol
46193d8817e4Smiodwhich has been referenced but not yet defined is considered to be undefined.
46203d8817e4Smiod
46213d8817e4Smiod@cindex @code{ifne} directive
46223d8817e4Smiod@item .ifne @var{absolute expression}
46233d8817e4SmiodAssembles the following section of code if the argument is not equal to zero
46243d8817e4Smiod(in other words, this is equivalent to @code{.if}).
46253d8817e4Smiod
46263d8817e4Smiod@cindex @code{ifnes} directive
46273d8817e4Smiod@item .ifnes @var{string1},@var{string2}
46283d8817e4SmiodLike @code{.ifeqs}, but the sense of the test is reversed: this assembles the
46293d8817e4Smiodfollowing section of code if the two strings are not the same.
46303d8817e4Smiod@end table
46313d8817e4Smiod
46323d8817e4Smiod@node Incbin
46333d8817e4Smiod@section @code{.incbin "@var{file}"[,@var{skip}[,@var{count}]]}
46343d8817e4Smiod
46353d8817e4Smiod@cindex @code{incbin} directive
46363d8817e4Smiod@cindex binary files, including
46373d8817e4SmiodThe @code{incbin} directive includes @var{file} verbatim at the current
46383d8817e4Smiodlocation. You can control the search paths used with the @samp{-I} command-line
46393d8817e4Smiodoption (@pxref{Invoking,,Command-Line Options}).  Quotation marks are required
46403d8817e4Smiodaround @var{file}.
46413d8817e4Smiod
46423d8817e4SmiodThe @var{skip} argument skips a number of bytes from the start of the
46433d8817e4Smiod@var{file}.  The @var{count} argument indicates the maximum number of bytes to
46443d8817e4Smiodread.  Note that the data is not aligned in any way, so it is the user's
46453d8817e4Smiodresponsibility to make sure that proper alignment is provided both before and
46463d8817e4Smiodafter the @code{incbin} directive.
46473d8817e4Smiod
46483d8817e4Smiod@node Include
46493d8817e4Smiod@section @code{.include "@var{file}"}
46503d8817e4Smiod
46513d8817e4Smiod@cindex @code{include} directive
46523d8817e4Smiod@cindex supporting files, including
46533d8817e4Smiod@cindex files, including
46543d8817e4SmiodThis directive provides a way to include supporting files at specified
46553d8817e4Smiodpoints in your source program.  The code from @var{file} is assembled as
46563d8817e4Smiodif it followed the point of the @code{.include}; when the end of the
46573d8817e4Smiodincluded file is reached, assembly of the original file continues.  You
46583d8817e4Smiodcan control the search paths used with the @samp{-I} command-line option
46593d8817e4Smiod(@pxref{Invoking,,Command-Line Options}).  Quotation marks are required
46603d8817e4Smiodaround @var{file}.
46613d8817e4Smiod
46623d8817e4Smiod@node Int
46633d8817e4Smiod@section @code{.int @var{expressions}}
46643d8817e4Smiod
46653d8817e4Smiod@cindex @code{int} directive
46663d8817e4Smiod@cindex integers, 32-bit
46673d8817e4SmiodExpect zero or more @var{expressions}, of any section, separated by commas.
46683d8817e4SmiodFor each expression, emit a number that, at run time, is the value of that
46693d8817e4Smiodexpression.  The byte order and bit size of the number depends on what kind
46703d8817e4Smiodof target the assembly is for.
46713d8817e4Smiod
46723d8817e4Smiod@ifclear GENERIC
46733d8817e4Smiod@ifset H8
46743d8817e4SmiodOn most forms of the H8/300, @code{.int} emits 16-bit
46753d8817e4Smiodintegers.  On the H8/300H and the Renesas SH, however, @code{.int} emits
46763d8817e4Smiod32-bit integers.
46773d8817e4Smiod@end ifset
46783d8817e4Smiod@end ifclear
46793d8817e4Smiod
46803d8817e4Smiod@ifset ELF
46813d8817e4Smiod@node Internal
46823d8817e4Smiod@section @code{.internal @var{names}}
46833d8817e4Smiod
46843d8817e4Smiod@cindex @code{internal} directive
46853d8817e4Smiod@cindex visibility
46863d8817e4SmiodThis is one of the ELF visibility directives.  The other two are
46873d8817e4Smiod@code{.hidden} (@pxref{Hidden,,@code{.hidden}}) and
46883d8817e4Smiod@code{.protected} (@pxref{Protected,,@code{.protected}}).
46893d8817e4Smiod
46903d8817e4SmiodThis directive overrides the named symbols default visibility (which is set by
46913d8817e4Smiodtheir binding: local, global or weak).  The directive sets the visibility to
46923d8817e4Smiod@code{internal} which means that the symbols are considered to be @code{hidden}
46933d8817e4Smiod(i.e., not visible to other components), and that some extra, processor specific
46943d8817e4Smiodprocessing must also be performed upon the  symbols as well.
46953d8817e4Smiod@end ifset
46963d8817e4Smiod
46973d8817e4Smiod@node Irp
46983d8817e4Smiod@section @code{.irp @var{symbol},@var{values}}@dots{}
46993d8817e4Smiod
47003d8817e4Smiod@cindex @code{irp} directive
47013d8817e4SmiodEvaluate a sequence of statements assigning different values to @var{symbol}.
47023d8817e4SmiodThe sequence of statements starts at the @code{.irp} directive, and is
47033d8817e4Smiodterminated by an @code{.endr} directive.  For each @var{value}, @var{symbol} is
47043d8817e4Smiodset to @var{value}, and the sequence of statements is assembled.  If no
47053d8817e4Smiod@var{value} is listed, the sequence of statements is assembled once, with
47063d8817e4Smiod@var{symbol} set to the null string.  To refer to @var{symbol} within the
47073d8817e4Smiodsequence of statements, use @var{\symbol}.
47083d8817e4Smiod
47093d8817e4SmiodFor example, assembling
47103d8817e4Smiod
47113d8817e4Smiod@example
47123d8817e4Smiod        .irp    param,1,2,3
47133d8817e4Smiod        move    d\param,sp@@-
47143d8817e4Smiod        .endr
47153d8817e4Smiod@end example
47163d8817e4Smiod
47173d8817e4Smiodis equivalent to assembling
47183d8817e4Smiod
47193d8817e4Smiod@example
47203d8817e4Smiod        move    d1,sp@@-
47213d8817e4Smiod        move    d2,sp@@-
47223d8817e4Smiod        move    d3,sp@@-
47233d8817e4Smiod@end example
47243d8817e4Smiod
47253d8817e4SmiodFor some caveats with the spelling of @var{symbol}, see also the discussion
47263d8817e4Smiodat @xref{Macro}.
47273d8817e4Smiod
47283d8817e4Smiod@node Irpc
47293d8817e4Smiod@section @code{.irpc @var{symbol},@var{values}}@dots{}
47303d8817e4Smiod
47313d8817e4Smiod@cindex @code{irpc} directive
47323d8817e4SmiodEvaluate a sequence of statements assigning different values to @var{symbol}.
47333d8817e4SmiodThe sequence of statements starts at the @code{.irpc} directive, and is
47343d8817e4Smiodterminated by an @code{.endr} directive.  For each character in @var{value},
47353d8817e4Smiod@var{symbol} is set to the character, and the sequence of statements is
47363d8817e4Smiodassembled.  If no @var{value} is listed, the sequence of statements is
47373d8817e4Smiodassembled once, with @var{symbol} set to the null string.  To refer to
47383d8817e4Smiod@var{symbol} within the sequence of statements, use @var{\symbol}.
47393d8817e4Smiod
47403d8817e4SmiodFor example, assembling
47413d8817e4Smiod
47423d8817e4Smiod@example
47433d8817e4Smiod        .irpc    param,123
47443d8817e4Smiod        move    d\param,sp@@-
47453d8817e4Smiod        .endr
47463d8817e4Smiod@end example
47473d8817e4Smiod
47483d8817e4Smiodis equivalent to assembling
47493d8817e4Smiod
47503d8817e4Smiod@example
47513d8817e4Smiod        move    d1,sp@@-
47523d8817e4Smiod        move    d2,sp@@-
47533d8817e4Smiod        move    d3,sp@@-
47543d8817e4Smiod@end example
47553d8817e4Smiod
47563d8817e4SmiodFor some caveats with the spelling of @var{symbol}, see also the discussion
47573d8817e4Smiodat @xref{Macro}.
47583d8817e4Smiod
47593d8817e4Smiod@node Lcomm
47603d8817e4Smiod@section @code{.lcomm @var{symbol} , @var{length}}
47613d8817e4Smiod
47623d8817e4Smiod@cindex @code{lcomm} directive
47633d8817e4Smiod@cindex local common symbols
47643d8817e4Smiod@cindex symbols, local common
47653d8817e4SmiodReserve @var{length} (an absolute expression) bytes for a local common
47663d8817e4Smioddenoted by @var{symbol}.  The section and value of @var{symbol} are
47673d8817e4Smiodthose of the new local common.  The addresses are allocated in the bss
47683d8817e4Smiodsection, so that at run-time the bytes start off zeroed.  @var{Symbol}
47693d8817e4Smiodis not declared global (@pxref{Global,,@code{.global}}), so is normally
47703d8817e4Smiodnot visible to @code{@value{LD}}.
47713d8817e4Smiod
47723d8817e4Smiod@ifset GENERIC
47733d8817e4SmiodSome targets permit a third argument to be used with @code{.lcomm}.  This
47743d8817e4Smiodargument specifies the desired alignment of the symbol in the bss section.
47753d8817e4Smiod@end ifset
47763d8817e4Smiod
47773d8817e4Smiod@ifset HPPA
47783d8817e4SmiodThe syntax for @code{.lcomm} differs slightly on the HPPA.  The syntax is
47793d8817e4Smiod@samp{@var{symbol} .lcomm, @var{length}}; @var{symbol} is optional.
47803d8817e4Smiod@end ifset
47813d8817e4Smiod
47823d8817e4Smiod@node Lflags
47833d8817e4Smiod@section @code{.lflags}
47843d8817e4Smiod
47853d8817e4Smiod@cindex @code{lflags} directive (ignored)
47863d8817e4Smiod@command{@value{AS}} accepts this directive, for compatibility with other
47873d8817e4Smiodassemblers, but ignores it.
47883d8817e4Smiod
47893d8817e4Smiod@ifclear no-line-dir
47903d8817e4Smiod@node Line
47913d8817e4Smiod@section @code{.line @var{line-number}}
47923d8817e4Smiod
47933d8817e4Smiod@cindex @code{line} directive
47943d8817e4Smiod@end ifclear
47953d8817e4Smiod@ifset no-line-dir
47963d8817e4Smiod@node Ln
47973d8817e4Smiod@section @code{.ln @var{line-number}}
47983d8817e4Smiod
47993d8817e4Smiod@cindex @code{ln} directive
48003d8817e4Smiod@end ifset
48013d8817e4Smiod@cindex logical line number
48023d8817e4Smiod@ifset aout-bout
48033d8817e4SmiodChange the logical line number.  @var{line-number} must be an absolute
48043d8817e4Smiodexpression.  The next line has that logical line number.  Therefore any other
48053d8817e4Smiodstatements on the current line (after a statement separator character) are
48063d8817e4Smiodreported as on logical line number @var{line-number} @minus{} 1.  One day
48073d8817e4Smiod@command{@value{AS}} will no longer support this directive: it is recognized only
48083d8817e4Smiodfor compatibility with existing assembler programs.
48093d8817e4Smiod
48103d8817e4Smiod@end ifset
48113d8817e4Smiod
48123d8817e4Smiod@ifclear no-line-dir
48133d8817e4SmiodEven though this is a directive associated with the @code{a.out} or
48143d8817e4Smiod@code{b.out} object-code formats, @command{@value{AS}} still recognizes it
48153d8817e4Smiodwhen producing COFF output, and treats @samp{.line} as though it
48163d8817e4Smiodwere the COFF @samp{.ln} @emph{if} it is found outside a
48173d8817e4Smiod@code{.def}/@code{.endef} pair.
48183d8817e4Smiod
48193d8817e4SmiodInside a @code{.def}, @samp{.line} is, instead, one of the directives
48203d8817e4Smiodused by compilers to generate auxiliary symbol information for
48213d8817e4Smioddebugging.
48223d8817e4Smiod@end ifclear
48233d8817e4Smiod
48243d8817e4Smiod@node Linkonce
48253d8817e4Smiod@section @code{.linkonce [@var{type}]}
48263d8817e4Smiod@cindex COMDAT
48273d8817e4Smiod@cindex @code{linkonce} directive
48283d8817e4Smiod@cindex common sections
48293d8817e4SmiodMark the current section so that the linker only includes a single copy of it.
48303d8817e4SmiodThis may be used to include the same section in several different object files,
48313d8817e4Smiodbut ensure that the linker will only include it once in the final output file.
48323d8817e4SmiodThe @code{.linkonce} pseudo-op must be used for each instance of the section.
48333d8817e4SmiodDuplicate sections are detected based on the section name, so it should be
48343d8817e4Smiodunique.
48353d8817e4Smiod
48363d8817e4SmiodThis directive is only supported by a few object file formats; as of this
48373d8817e4Smiodwriting, the only object file format which supports it is the Portable
48383d8817e4SmiodExecutable format used on Windows NT.
48393d8817e4Smiod
48403d8817e4SmiodThe @var{type} argument is optional.  If specified, it must be one of the
48413d8817e4Smiodfollowing strings.  For example:
48423d8817e4Smiod@smallexample
48433d8817e4Smiod.linkonce same_size
48443d8817e4Smiod@end smallexample
48453d8817e4SmiodNot all types may be supported on all object file formats.
48463d8817e4Smiod
48473d8817e4Smiod@table @code
48483d8817e4Smiod@item discard
48493d8817e4SmiodSilently discard duplicate sections.  This is the default.
48503d8817e4Smiod
48513d8817e4Smiod@item one_only
48523d8817e4SmiodWarn if there are duplicate sections, but still keep only one copy.
48533d8817e4Smiod
48543d8817e4Smiod@item same_size
48553d8817e4SmiodWarn if any of the duplicates have different sizes.
48563d8817e4Smiod
48573d8817e4Smiod@item same_contents
48583d8817e4SmiodWarn if any of the duplicates do not have exactly the same contents.
48593d8817e4Smiod@end table
48603d8817e4Smiod
48613d8817e4Smiod@node Ln
48623d8817e4Smiod@section @code{.ln @var{line-number}}
48633d8817e4Smiod
48643d8817e4Smiod@cindex @code{ln} directive
48653d8817e4Smiod@ifclear no-line-dir
48663d8817e4Smiod@samp{.ln} is a synonym for @samp{.line}.
48673d8817e4Smiod@end ifclear
48683d8817e4Smiod@ifset no-line-dir
48693d8817e4SmiodTell @command{@value{AS}} to change the logical line number.  @var{line-number}
48703d8817e4Smiodmust be an absolute expression.  The next line has that logical
48713d8817e4Smiodline number, so any other statements on the current line (after a
48723d8817e4Smiodstatement separator character @code{;}) are reported as on logical
48733d8817e4Smiodline number @var{line-number} @minus{} 1.
48743d8817e4Smiod@ifset BOUT
48753d8817e4Smiod
48763d8817e4SmiodThis directive is accepted, but ignored, when @command{@value{AS}} is
48773d8817e4Smiodconfigured for @code{b.out}; its effect is only associated with COFF
48783d8817e4Smiodoutput format.
48793d8817e4Smiod@end ifset
48803d8817e4Smiod@end ifset
48813d8817e4Smiod
48823d8817e4Smiod@node MRI
48833d8817e4Smiod@section @code{.mri @var{val}}
48843d8817e4Smiod
48853d8817e4Smiod@cindex @code{mri} directive
48863d8817e4Smiod@cindex MRI mode, temporarily
48873d8817e4SmiodIf @var{val} is non-zero, this tells @command{@value{AS}} to enter MRI mode.  If
48883d8817e4Smiod@var{val} is zero, this tells @command{@value{AS}} to exit MRI mode.  This change
48893d8817e4Smiodaffects code assembled until the next @code{.mri} directive, or until the end
48903d8817e4Smiodof the file.  @xref{M, MRI mode, MRI mode}.
48913d8817e4Smiod
48923d8817e4Smiod@node List
48933d8817e4Smiod@section @code{.list}
48943d8817e4Smiod
48953d8817e4Smiod@cindex @code{list} directive
48963d8817e4Smiod@cindex listing control, turning on
48973d8817e4SmiodControl (in conjunction with the @code{.nolist} directive) whether or
48983d8817e4Smiodnot assembly listings are generated.  These two directives maintain an
48993d8817e4Smiodinternal counter (which is zero initially).   @code{.list} increments the
49003d8817e4Smiodcounter, and @code{.nolist} decrements it.  Assembly listings are
49013d8817e4Smiodgenerated whenever the counter is greater than zero.
49023d8817e4Smiod
49033d8817e4SmiodBy default, listings are disabled.  When you enable them (with the
49043d8817e4Smiod@samp{-a} command line option; @pxref{Invoking,,Command-Line Options}),
49053d8817e4Smiodthe initial value of the listing counter is one.
49063d8817e4Smiod
49073d8817e4Smiod@node Long
49083d8817e4Smiod@section @code{.long @var{expressions}}
49093d8817e4Smiod
49103d8817e4Smiod@cindex @code{long} directive
49113d8817e4Smiod@code{.long} is the same as @samp{.int}, @pxref{Int,,@code{.int}}.
49123d8817e4Smiod
49133d8817e4Smiod@ignore
49143d8817e4Smiod@c no one seems to know what this is for or whether this description is
49153d8817e4Smiod@c what it really ought to do
49163d8817e4Smiod@node Lsym
49173d8817e4Smiod@section @code{.lsym @var{symbol}, @var{expression}}
49183d8817e4Smiod
49193d8817e4Smiod@cindex @code{lsym} directive
49203d8817e4Smiod@cindex symbol, not referenced in assembly
49213d8817e4Smiod@code{.lsym} creates a new symbol named @var{symbol}, but does not put it in
49223d8817e4Smiodthe hash table, ensuring it cannot be referenced by name during the
49233d8817e4Smiodrest of the assembly.  This sets the attributes of the symbol to be
49243d8817e4Smiodthe same as the expression value:
49253d8817e4Smiod@smallexample
49263d8817e4Smiod@var{other} = @var{descriptor} = 0
49273d8817e4Smiod@var{type} = @r{(section of @var{expression})}
49283d8817e4Smiod@var{value} = @var{expression}
49293d8817e4Smiod@end smallexample
49303d8817e4Smiod@noindent
49313d8817e4SmiodThe new symbol is not flagged as external.
49323d8817e4Smiod@end ignore
49333d8817e4Smiod
49343d8817e4Smiod@node Macro
49353d8817e4Smiod@section @code{.macro}
49363d8817e4Smiod
49373d8817e4Smiod@cindex macros
49383d8817e4SmiodThe commands @code{.macro} and @code{.endm} allow you to define macros that
49393d8817e4Smiodgenerate assembly output.  For example, this definition specifies a macro
49403d8817e4Smiod@code{sum} that puts a sequence of numbers into memory:
49413d8817e4Smiod
49423d8817e4Smiod@example
49433d8817e4Smiod        .macro  sum from=0, to=5
49443d8817e4Smiod        .long   \from
49453d8817e4Smiod        .if     \to-\from
49463d8817e4Smiod        sum     "(\from+1)",\to
49473d8817e4Smiod        .endif
49483d8817e4Smiod        .endm
49493d8817e4Smiod@end example
49503d8817e4Smiod
49513d8817e4Smiod@noindent
49523d8817e4SmiodWith that definition, @samp{SUM 0,5} is equivalent to this assembly input:
49533d8817e4Smiod
49543d8817e4Smiod@example
49553d8817e4Smiod        .long   0
49563d8817e4Smiod        .long   1
49573d8817e4Smiod        .long   2
49583d8817e4Smiod        .long   3
49593d8817e4Smiod        .long   4
49603d8817e4Smiod        .long   5
49613d8817e4Smiod@end example
49623d8817e4Smiod
49633d8817e4Smiod@ftable @code
49643d8817e4Smiod@item .macro @var{macname}
49653d8817e4Smiod@itemx .macro @var{macname} @var{macargs} @dots{}
49663d8817e4Smiod@cindex @code{macro} directive
49673d8817e4SmiodBegin the definition of a macro called @var{macname}.  If your macro
49683d8817e4Smioddefinition requires arguments, specify their names after the macro name,
49693d8817e4Smiodseparated by commas or spaces.  You can qualify the macro argument to
49703d8817e4Smiodindicate whether all invocations must specify a non-blank value (through
49713d8817e4Smiod@samp{:@code{req}}), or whether it takes all of the remaining arguments
49723d8817e4Smiod(through @samp{:@code{vararg}}).  You can supply a default value for any
49733d8817e4Smiodmacro argument by following the name with @samp{=@var{deflt}}.  You
49743d8817e4Smiodcannot define two macros with the same @var{macname} unless it has been
49753d8817e4Smiodsubject to the @code{.purgem} directive (@xref{Purgem}.) between the two
49763d8817e4Smioddefinitions.  For example, these are all valid @code{.macro} statements:
49773d8817e4Smiod
49783d8817e4Smiod@table @code
49793d8817e4Smiod@item .macro comm
49803d8817e4SmiodBegin the definition of a macro called @code{comm}, which takes no
49813d8817e4Smiodarguments.
49823d8817e4Smiod
49833d8817e4Smiod@item .macro plus1 p, p1
49843d8817e4Smiod@itemx .macro plus1 p p1
49853d8817e4SmiodEither statement begins the definition of a macro called @code{plus1},
49863d8817e4Smiodwhich takes two arguments; within the macro definition, write
49873d8817e4Smiod@samp{\p} or @samp{\p1} to evaluate the arguments.
49883d8817e4Smiod
49893d8817e4Smiod@item .macro reserve_str p1=0 p2
49903d8817e4SmiodBegin the definition of a macro called @code{reserve_str}, with two
49913d8817e4Smiodarguments.  The first argument has a default value, but not the second.
49923d8817e4SmiodAfter the definition is complete, you can call the macro either as
49933d8817e4Smiod@samp{reserve_str @var{a},@var{b}} (with @samp{\p1} evaluating to
49943d8817e4Smiod@var{a} and @samp{\p2} evaluating to @var{b}), or as @samp{reserve_str
49953d8817e4Smiod,@var{b}} (with @samp{\p1} evaluating as the default, in this case
49963d8817e4Smiod@samp{0}, and @samp{\p2} evaluating to @var{b}).
49973d8817e4Smiod@end table
49983d8817e4Smiod
49993d8817e4Smiod@item .macro m p1:req, p2=0, p3:vararg
50003d8817e4SmiodBegin the definition of a macro called @code{m}, with at least three
50013d8817e4Smiodarguments.  The first argument must always have a value specified, but
50023d8817e4Smiodnot the second, which instead has a default value. The third formal
50033d8817e4Smiodwill get assigned all remaining arguments specified at invocation time.
50043d8817e4Smiod
50053d8817e4SmiodWhen you call a macro, you can specify the argument values either by
50063d8817e4Smiodposition, or by keyword.  For example, @samp{sum 9,17} is equivalent to
50073d8817e4Smiod@samp{sum to=17, from=9}.
50083d8817e4Smiod
50093d8817e4SmiodNote that since each of the @var{macargs} can be an identifier exactly
50103d8817e4Smiodas any other one permitted by the target architecture, there may be
50113d8817e4Smiodoccasional problems if the target hand-crafts special meanings to certain
50123d8817e4Smiodcharacters when they occur in a special position.  For example, if colon
50133d8817e4Smiod(@code{:}) is generally permitted to be part of a symbol name, but the
50143d8817e4Smiodarchitecture specific code special-cases it when occuring as the final
50153d8817e4Smiodcharacter of a symbol (to denote a label), then the macro parameter
50163d8817e4Smiodreplacement code will have no way of knowing that and consider the whole
50173d8817e4Smiodconstruct (including the colon) an identifier, and check only this
50183d8817e4Smiodidentifier for being the subject to parameter substitution.  In this
50193d8817e4Smiodexample, besides the potential of just separating identifier and colon
50203d8817e4Smiodby white space, using alternate macro syntax (@xref{Altmacro}.) and
50213d8817e4Smiodampersand (@code{&}) as the character to separate literal text from macro
50223d8817e4Smiodparameters (or macro parameters from one another) would provide a way to
50233d8817e4Smiodachieve the same effect:
50243d8817e4Smiod
50253d8817e4Smiod@example
50263d8817e4Smiod	.altmacro
50273d8817e4Smiod	.macro label l
50283d8817e4Smiodl&:
50293d8817e4Smiod	.endm
50303d8817e4Smiod@end example
50313d8817e4Smiod
50323d8817e4SmiodThis applies identically to the identifiers used in @code{.irp} (@xref{Irp}.)
50333d8817e4Smiodand @code{.irpc} (@xref{Irpc}.).
50343d8817e4Smiod
50353d8817e4Smiod@item .endm
50363d8817e4Smiod@cindex @code{endm} directive
50373d8817e4SmiodMark the end of a macro definition.
50383d8817e4Smiod
50393d8817e4Smiod@item .exitm
50403d8817e4Smiod@cindex @code{exitm} directive
50413d8817e4SmiodExit early from the current macro definition.
50423d8817e4Smiod
50433d8817e4Smiod@cindex number of macros executed
50443d8817e4Smiod@cindex macros, count executed
50453d8817e4Smiod@item \@@
50463d8817e4Smiod@command{@value{AS}} maintains a counter of how many macros it has
50473d8817e4Smiodexecuted in this pseudo-variable; you can copy that number to your
50483d8817e4Smiodoutput with @samp{\@@}, but @emph{only within a macro definition}.
50493d8817e4Smiod
50503d8817e4Smiod@item LOCAL @var{name} [ , @dots{} ]
50513d8817e4Smiod@emph{Warning: @code{LOCAL} is only available if you select ``alternate
50523d8817e4Smiodmacro syntax'' with @samp{--alternate} or @code{.altmacro}.}
50533d8817e4Smiod@xref{Altmacro,,@code{.altmacro}}.
50543d8817e4Smiod@end ftable
50553d8817e4Smiod
50563d8817e4Smiod@node Altmacro
50573d8817e4Smiod@section @code{.altmacro}
50583d8817e4SmiodEnable alternate macro mode, enabling:
50593d8817e4Smiod
50603d8817e4Smiod@ftable @code
50613d8817e4Smiod@item LOCAL @var{name} [ , @dots{} ]
50623d8817e4SmiodOne additional directive, @code{LOCAL}, is available.  It is used to
50633d8817e4Smiodgenerate a string replacement for each of the @var{name} arguments, and
50643d8817e4Smiodreplace any instances of @var{name} in each macro expansion.  The
50653d8817e4Smiodreplacement string is unique in the assembly, and different for each
50663d8817e4Smiodseparate macro expansion.  @code{LOCAL} allows you to write macros that
50673d8817e4Smioddefine symbols, without fear of conflict between separate macro expansions.
50683d8817e4Smiod
50693d8817e4Smiod@item String delimiters
50703d8817e4SmiodYou can write strings delimited in these other ways besides
50713d8817e4Smiod@code{"@var{string}"}:
50723d8817e4Smiod
50733d8817e4Smiod@table @code
50743d8817e4Smiod@item '@var{string}'
50753d8817e4SmiodYou can delimit strings with single-quote charaters.
50763d8817e4Smiod
50773d8817e4Smiod@item <@var{string}>
50783d8817e4SmiodYou can delimit strings with matching angle brackets.
50793d8817e4Smiod@end table
50803d8817e4Smiod
50813d8817e4Smiod@item single-character string escape
50823d8817e4SmiodTo include any single character literally in a string (even if the
50833d8817e4Smiodcharacter would otherwise have some special meaning), you can prefix the
50843d8817e4Smiodcharacter with @samp{!} (an exclamation mark).  For example, you can
50853d8817e4Smiodwrite @samp{<4.3 !> 5.4!!>} to get the literal text @samp{4.3 > 5.4!}.
50863d8817e4Smiod
50873d8817e4Smiod@item Expression results as strings
50883d8817e4SmiodYou can write @samp{%@var{expr}} to evaluate the expression @var{expr}
50893d8817e4Smiodand use the result as a string.
50903d8817e4Smiod@end ftable
50913d8817e4Smiod
50923d8817e4Smiod@node Noaltmacro
50933d8817e4Smiod@section @code{.noaltmacro}
50943d8817e4SmiodDisable alternate macro mode.  @ref{Altmacro}
50953d8817e4Smiod
50963d8817e4Smiod@node Nolist
50973d8817e4Smiod@section @code{.nolist}
50983d8817e4Smiod
50993d8817e4Smiod@cindex @code{nolist} directive
51003d8817e4Smiod@cindex listing control, turning off
51013d8817e4SmiodControl (in conjunction with the @code{.list} directive) whether or
51023d8817e4Smiodnot assembly listings are generated.  These two directives maintain an
51033d8817e4Smiodinternal counter (which is zero initially).   @code{.list} increments the
51043d8817e4Smiodcounter, and @code{.nolist} decrements it.  Assembly listings are
51053d8817e4Smiodgenerated whenever the counter is greater than zero.
51063d8817e4Smiod
51073d8817e4Smiod@node Octa
51083d8817e4Smiod@section @code{.octa @var{bignums}}
51093d8817e4Smiod
51103d8817e4Smiod@c FIXME: double size emitted for "octa" on i960, others?  Or warn?
51113d8817e4Smiod@cindex @code{octa} directive
51123d8817e4Smiod@cindex integer, 16-byte
51133d8817e4Smiod@cindex sixteen byte integer
51143d8817e4SmiodThis directive expects zero or more bignums, separated by commas.  For each
51153d8817e4Smiodbignum, it emits a 16-byte integer.
51163d8817e4Smiod
51173d8817e4SmiodThe term ``octa'' comes from contexts in which a ``word'' is two bytes;
51183d8817e4Smiodhence @emph{octa}-word for 16 bytes.
51193d8817e4Smiod
51203d8817e4Smiod@node Org
51213d8817e4Smiod@section @code{.org @var{new-lc} , @var{fill}}
51223d8817e4Smiod
51233d8817e4Smiod@cindex @code{org} directive
51243d8817e4Smiod@cindex location counter, advancing
51253d8817e4Smiod@cindex advancing location counter
51263d8817e4Smiod@cindex current address, advancing
51273d8817e4SmiodAdvance the location counter of the current section to
51283d8817e4Smiod@var{new-lc}.  @var{new-lc} is either an absolute expression or an
51293d8817e4Smiodexpression with the same section as the current subsection.  That is,
51303d8817e4Smiodyou can't use @code{.org} to cross sections: if @var{new-lc} has the
51313d8817e4Smiodwrong section, the @code{.org} directive is ignored.  To be compatible
51323d8817e4Smiodwith former assemblers, if the section of @var{new-lc} is absolute,
51333d8817e4Smiod@command{@value{AS}} issues a warning, then pretends the section of @var{new-lc}
51343d8817e4Smiodis the same as the current subsection.
51353d8817e4Smiod
51363d8817e4Smiod@code{.org} may only increase the location counter, or leave it
51373d8817e4Smiodunchanged; you cannot use @code{.org} to move the location counter
51383d8817e4Smiodbackwards.
51393d8817e4Smiod
51403d8817e4Smiod@c double negative used below "not undefined" because this is a specific
51413d8817e4Smiod@c reference to "undefined" (as SEG_UNKNOWN is called in this manual)
51423d8817e4Smiod@c section. doc@cygnus.com 18feb91
51433d8817e4SmiodBecause @command{@value{AS}} tries to assemble programs in one pass, @var{new-lc}
51443d8817e4Smiodmay not be undefined.  If you really detest this restriction we eagerly await
51453d8817e4Smioda chance to share your improved assembler.
51463d8817e4Smiod
51473d8817e4SmiodBeware that the origin is relative to the start of the section, not
51483d8817e4Smiodto the start of the subsection.  This is compatible with other
51493d8817e4Smiodpeople's assemblers.
51503d8817e4Smiod
51513d8817e4SmiodWhen the location counter (of the current subsection) is advanced, the
51523d8817e4Smiodintervening bytes are filled with @var{fill} which should be an
51533d8817e4Smiodabsolute expression.  If the comma and @var{fill} are omitted,
51543d8817e4Smiod@var{fill} defaults to zero.
51553d8817e4Smiod
51563d8817e4Smiod@node P2align
51573d8817e4Smiod@section @code{.p2align[wl] @var{abs-expr}, @var{abs-expr}, @var{abs-expr}}
51583d8817e4Smiod
51593d8817e4Smiod@cindex padding the location counter given a power of two
51603d8817e4Smiod@cindex @code{p2align} directive
51613d8817e4SmiodPad the location counter (in the current subsection) to a particular
51623d8817e4Smiodstorage boundary.  The first expression (which must be absolute) is the
51633d8817e4Smiodnumber of low-order zero bits the location counter must have after
51643d8817e4Smiodadvancement.  For example @samp{.p2align 3} advances the location
51653d8817e4Smiodcounter until it a multiple of 8.  If the location counter is already a
51663d8817e4Smiodmultiple of 8, no change is needed.
51673d8817e4Smiod
51683d8817e4SmiodThe second expression (also absolute) gives the fill value to be stored in the
51693d8817e4Smiodpadding bytes.  It (and the comma) may be omitted.  If it is omitted, the
51703d8817e4Smiodpadding bytes are normally zero.  However, on some systems, if the section is
51713d8817e4Smiodmarked as containing code and the fill value is omitted, the space is filled
51723d8817e4Smiodwith no-op instructions.
51733d8817e4Smiod
51743d8817e4SmiodThe third expression is also absolute, and is also optional.  If it is present,
51753d8817e4Smiodit is the maximum number of bytes that should be skipped by this alignment
51763d8817e4Smioddirective.  If doing the alignment would require skipping more bytes than the
51773d8817e4Smiodspecified maximum, then the alignment is not done at all.  You can omit the
51783d8817e4Smiodfill value (the second argument) entirely by simply using two commas after the
51793d8817e4Smiodrequired alignment; this can be useful if you want the alignment to be filled
51803d8817e4Smiodwith no-op instructions when appropriate.
51813d8817e4Smiod
51823d8817e4Smiod@cindex @code{p2alignw} directive
51833d8817e4Smiod@cindex @code{p2alignl} directive
51843d8817e4SmiodThe @code{.p2alignw} and @code{.p2alignl} directives are variants of the
51853d8817e4Smiod@code{.p2align} directive.  The @code{.p2alignw} directive treats the fill
51863d8817e4Smiodpattern as a two byte word value.  The @code{.p2alignl} directives treats the
51873d8817e4Smiodfill pattern as a four byte longword value.  For example, @code{.p2alignw
51883d8817e4Smiod2,0x368d} will align to a multiple of 4.  If it skips two bytes, they will be
51893d8817e4Smiodfilled in with the value 0x368d (the exact placement of the bytes depends upon
51903d8817e4Smiodthe endianness of the processor).  If it skips 1 or 3 bytes, the fill value is
51913d8817e4Smiodundefined.
51923d8817e4Smiod
51933d8817e4Smiod@ifset ELF
51943d8817e4Smiod@node Previous
51953d8817e4Smiod@section @code{.previous}
51963d8817e4Smiod
51973d8817e4Smiod@cindex @code{previous} directive
51983d8817e4Smiod@cindex Section Stack
51993d8817e4SmiodThis is one of the ELF section stack manipulation directives.  The others are
52003d8817e4Smiod@code{.section} (@pxref{Section}), @code{.subsection} (@pxref{SubSection}),
52013d8817e4Smiod@code{.pushsection} (@pxref{PushSection}), and @code{.popsection}
52023d8817e4Smiod(@pxref{PopSection}).
52033d8817e4Smiod
52043d8817e4SmiodThis directive swaps the current section (and subsection) with most recently
52053d8817e4Smiodreferenced section (and subsection) prior to this one.  Multiple
52063d8817e4Smiod@code{.previous} directives in a row will flip between two sections (and their
52073d8817e4Smiodsubsections).
52083d8817e4Smiod
52093d8817e4SmiodIn terms of the section stack, this directive swaps the current section with
52103d8817e4Smiodthe top section on the section stack.
52113d8817e4Smiod@end ifset
52123d8817e4Smiod
52133d8817e4Smiod@ifset ELF
52143d8817e4Smiod@node PopSection
52153d8817e4Smiod@section @code{.popsection}
52163d8817e4Smiod
52173d8817e4Smiod@cindex @code{popsection} directive
52183d8817e4Smiod@cindex Section Stack
52193d8817e4SmiodThis is one of the ELF section stack manipulation directives.  The others are
52203d8817e4Smiod@code{.section} (@pxref{Section}), @code{.subsection} (@pxref{SubSection}),
52213d8817e4Smiod@code{.pushsection} (@pxref{PushSection}), and @code{.previous}
52223d8817e4Smiod(@pxref{Previous}).
52233d8817e4Smiod
52243d8817e4SmiodThis directive replaces the current section (and subsection) with the top
52253d8817e4Smiodsection (and subsection) on the section stack.  This section is popped off the
52263d8817e4Smiodstack.
52273d8817e4Smiod@end ifset
52283d8817e4Smiod
52293d8817e4Smiod@node Print
52303d8817e4Smiod@section @code{.print @var{string}}
52313d8817e4Smiod
52323d8817e4Smiod@cindex @code{print} directive
52333d8817e4Smiod@command{@value{AS}} will print @var{string} on the standard output during
52343d8817e4Smiodassembly.  You must put @var{string} in double quotes.
52353d8817e4Smiod
52363d8817e4Smiod@ifset ELF
52373d8817e4Smiod@node Protected
52383d8817e4Smiod@section @code{.protected @var{names}}
52393d8817e4Smiod
52403d8817e4Smiod@cindex @code{protected} directive
52413d8817e4Smiod@cindex visibility
52423d8817e4SmiodThis is one of the ELF visibility directives.  The other two are
52433d8817e4Smiod@code{.hidden} (@pxref{Hidden}) and @code{.internal} (@pxref{Internal}).
52443d8817e4Smiod
52453d8817e4SmiodThis directive overrides the named symbols default visibility (which is set by
52463d8817e4Smiodtheir binding: local, global or weak).  The directive sets the visibility to
52473d8817e4Smiod@code{protected} which means that any references to the symbols from within the
52483d8817e4Smiodcomponents that defines them must be resolved to the definition in that
52493d8817e4Smiodcomponent, even if a definition in another component would normally preempt
52503d8817e4Smiodthis.
52513d8817e4Smiod@end ifset
52523d8817e4Smiod
52533d8817e4Smiod@node Psize
52543d8817e4Smiod@section @code{.psize @var{lines} , @var{columns}}
52553d8817e4Smiod
52563d8817e4Smiod@cindex @code{psize} directive
52573d8817e4Smiod@cindex listing control: paper size
52583d8817e4Smiod@cindex paper size, for listings
52593d8817e4SmiodUse this directive to declare the number of lines---and, optionally, the
52603d8817e4Smiodnumber of columns---to use for each page, when generating listings.
52613d8817e4Smiod
52623d8817e4SmiodIf you do not use @code{.psize}, listings use a default line-count
52633d8817e4Smiodof 60.  You may omit the comma and @var{columns} specification; the
52643d8817e4Smioddefault width is 200 columns.
52653d8817e4Smiod
52663d8817e4Smiod@command{@value{AS}} generates formfeeds whenever the specified number of
52673d8817e4Smiodlines is exceeded (or whenever you explicitly request one, using
52683d8817e4Smiod@code{.eject}).
52693d8817e4Smiod
52703d8817e4SmiodIf you specify @var{lines} as @code{0}, no formfeeds are generated save
52713d8817e4Smiodthose explicitly specified with @code{.eject}.
52723d8817e4Smiod
52733d8817e4Smiod@node Purgem
52743d8817e4Smiod@section @code{.purgem @var{name}}
52753d8817e4Smiod
52763d8817e4Smiod@cindex @code{purgem} directive
52773d8817e4SmiodUndefine the macro @var{name}, so that later uses of the string will not be
52783d8817e4Smiodexpanded.  @xref{Macro}.
52793d8817e4Smiod
52803d8817e4Smiod@ifset ELF
52813d8817e4Smiod@node PushSection
52823d8817e4Smiod@section @code{.pushsection @var{name} , @var{subsection}}
52833d8817e4Smiod
52843d8817e4Smiod@cindex @code{pushsection} directive
52853d8817e4Smiod@cindex Section Stack
52863d8817e4SmiodThis is one of the ELF section stack manipulation directives.  The others are
52873d8817e4Smiod@code{.section} (@pxref{Section}), @code{.subsection} (@pxref{SubSection}),
52883d8817e4Smiod@code{.popsection} (@pxref{PopSection}), and @code{.previous}
52893d8817e4Smiod(@pxref{Previous}).
52903d8817e4Smiod
52913d8817e4SmiodThis directive pushes the current section (and subsection) onto the
52923d8817e4Smiodtop of the section stack, and then replaces the current section and
52933d8817e4Smiodsubsection with @code{name} and @code{subsection}.
52943d8817e4Smiod@end ifset
52953d8817e4Smiod
52963d8817e4Smiod@node Quad
52973d8817e4Smiod@section @code{.quad @var{bignums}}
52983d8817e4Smiod
52993d8817e4Smiod@cindex @code{quad} directive
53003d8817e4Smiod@code{.quad} expects zero or more bignums, separated by commas.  For
53013d8817e4Smiodeach bignum, it emits
53023d8817e4Smiod@ifclear bignum-16
53033d8817e4Smiodan 8-byte integer.  If the bignum won't fit in 8 bytes, it prints a
53043d8817e4Smiodwarning message; and just takes the lowest order 8 bytes of the bignum.
53053d8817e4Smiod@cindex eight-byte integer
53063d8817e4Smiod@cindex integer, 8-byte
53073d8817e4Smiod
53083d8817e4SmiodThe term ``quad'' comes from contexts in which a ``word'' is two bytes;
53093d8817e4Smiodhence @emph{quad}-word for 8 bytes.
53103d8817e4Smiod@end ifclear
53113d8817e4Smiod@ifset bignum-16
53123d8817e4Smioda 16-byte integer.  If the bignum won't fit in 16 bytes, it prints a
53133d8817e4Smiodwarning message; and just takes the lowest order 16 bytes of the bignum.
53143d8817e4Smiod@cindex sixteen-byte integer
53153d8817e4Smiod@cindex integer, 16-byte
53163d8817e4Smiod@end ifset
53173d8817e4Smiod
53183d8817e4Smiod@node Rept
53193d8817e4Smiod@section @code{.rept @var{count}}
53203d8817e4Smiod
53213d8817e4Smiod@cindex @code{rept} directive
53223d8817e4SmiodRepeat the sequence of lines between the @code{.rept} directive and the next
53233d8817e4Smiod@code{.endr} directive @var{count} times.
53243d8817e4Smiod
53253d8817e4SmiodFor example, assembling
53263d8817e4Smiod
53273d8817e4Smiod@example
53283d8817e4Smiod        .rept   3
53293d8817e4Smiod        .long   0
53303d8817e4Smiod        .endr
53313d8817e4Smiod@end example
53323d8817e4Smiod
53333d8817e4Smiodis equivalent to assembling
53343d8817e4Smiod
53353d8817e4Smiod@example
53363d8817e4Smiod        .long   0
53373d8817e4Smiod        .long   0
53383d8817e4Smiod        .long   0
53393d8817e4Smiod@end example
53403d8817e4Smiod
53413d8817e4Smiod@node Sbttl
53423d8817e4Smiod@section @code{.sbttl "@var{subheading}"}
53433d8817e4Smiod
53443d8817e4Smiod@cindex @code{sbttl} directive
53453d8817e4Smiod@cindex subtitles for listings
53463d8817e4Smiod@cindex listing control: subtitle
53473d8817e4SmiodUse @var{subheading} as the title (third line, immediately after the
53483d8817e4Smiodtitle line) when generating assembly listings.
53493d8817e4Smiod
53503d8817e4SmiodThis directive affects subsequent pages, as well as the current page if
53513d8817e4Smiodit appears within ten lines of the top of a page.
53523d8817e4Smiod
53533d8817e4Smiod@ifset COFF
53543d8817e4Smiod@node Scl
53553d8817e4Smiod@section @code{.scl @var{class}}
53563d8817e4Smiod
53573d8817e4Smiod@cindex @code{scl} directive
53583d8817e4Smiod@cindex symbol storage class (COFF)
53593d8817e4Smiod@cindex COFF symbol storage class
53603d8817e4SmiodSet the storage-class value for a symbol.  This directive may only be
53613d8817e4Smiodused inside a @code{.def}/@code{.endef} pair.  Storage class may flag
53623d8817e4Smiodwhether a symbol is static or external, or it may record further
53633d8817e4Smiodsymbolic debugging information.
53643d8817e4Smiod@ifset BOUT
53653d8817e4Smiod
53663d8817e4SmiodThe @samp{.scl} directive is primarily associated with COFF output; when
53673d8817e4Smiodconfigured to generate @code{b.out} output format, @command{@value{AS}}
53683d8817e4Smiodaccepts this directive but ignores it.
53693d8817e4Smiod@end ifset
53703d8817e4Smiod@end ifset
53713d8817e4Smiod
53723d8817e4Smiod@ifset COFF-ELF
53733d8817e4Smiod@node Section
53743d8817e4Smiod@section @code{.section @var{name}}
53753d8817e4Smiod
53763d8817e4Smiod@cindex named section
53773d8817e4SmiodUse the @code{.section} directive to assemble the following code into a section
53783d8817e4Smiodnamed @var{name}.
53793d8817e4Smiod
53803d8817e4SmiodThis directive is only supported for targets that actually support arbitrarily
53813d8817e4Smiodnamed sections; on @code{a.out} targets, for example, it is not accepted, even
53823d8817e4Smiodwith a standard @code{a.out} section name.
53833d8817e4Smiod
53843d8817e4Smiod@ifset COFF
53853d8817e4Smiod@ifset ELF
53863d8817e4Smiod@c only print the extra heading if both COFF and ELF are set
53873d8817e4Smiod@subheading COFF Version
53883d8817e4Smiod@end ifset
53893d8817e4Smiod
53903d8817e4Smiod@cindex @code{section} directive (COFF version)
53913d8817e4SmiodFor COFF targets, the @code{.section} directive is used in one of the following
53923d8817e4Smiodways:
53933d8817e4Smiod
53943d8817e4Smiod@smallexample
53953d8817e4Smiod.section @var{name}[, "@var{flags}"]
53963d8817e4Smiod.section @var{name}[, @var{subsegment}]
53973d8817e4Smiod@end smallexample
53983d8817e4Smiod
53993d8817e4SmiodIf the optional argument is quoted, it is taken as flags to use for the
54003d8817e4Smiodsection.  Each flag is a single character.  The following flags are recognized:
54013d8817e4Smiod@table @code
54023d8817e4Smiod@item b
54033d8817e4Smiodbss section (uninitialized data)
54043d8817e4Smiod@item n
54053d8817e4Smiodsection is not loaded
54063d8817e4Smiod@item w
54073d8817e4Smiodwritable section
54083d8817e4Smiod@item d
54093d8817e4Smioddata section
54103d8817e4Smiod@item r
54113d8817e4Smiodread-only section
54123d8817e4Smiod@item x
54133d8817e4Smiodexecutable section
54143d8817e4Smiod@item s
54153d8817e4Smiodshared section (meaningful for PE targets)
54163d8817e4Smiod@item a
54173d8817e4Smiodignored.  (For compatibility with the ELF version)
54183d8817e4Smiod@end table
54193d8817e4Smiod
54203d8817e4SmiodIf no flags are specified, the default flags depend upon the section name.  If
54213d8817e4Smiodthe section name is not recognized, the default will be for the section to be
54223d8817e4Smiodloaded and writable.  Note the @code{n} and @code{w} flags remove attributes
54233d8817e4Smiodfrom the section, rather than adding them, so if they are used on their own it
54243d8817e4Smiodwill be as if no flags had been specified at all.
54253d8817e4Smiod
54263d8817e4SmiodIf the optional argument to the @code{.section} directive is not quoted, it is
54273d8817e4Smiodtaken as a subsegment number (@pxref{Sub-Sections}).
54283d8817e4Smiod@end ifset
54293d8817e4Smiod
54303d8817e4Smiod@ifset ELF
54313d8817e4Smiod@ifset COFF
54323d8817e4Smiod@c only print the extra heading if both COFF and ELF are set
54333d8817e4Smiod@subheading ELF Version
54343d8817e4Smiod@end ifset
54353d8817e4Smiod
54363d8817e4Smiod@cindex Section Stack
54373d8817e4SmiodThis is one of the ELF section stack manipulation directives.  The others are
54383d8817e4Smiod@code{.subsection} (@pxref{SubSection}), @code{.pushsection}
54393d8817e4Smiod(@pxref{PushSection}), @code{.popsection} (@pxref{PopSection}), and
54403d8817e4Smiod@code{.previous} (@pxref{Previous}).
54413d8817e4Smiod
54423d8817e4Smiod@cindex @code{section} directive (ELF version)
54433d8817e4SmiodFor ELF targets, the @code{.section} directive is used like this:
54443d8817e4Smiod
54453d8817e4Smiod@smallexample
54463d8817e4Smiod.section @var{name} [, "@var{flags}"[, @@@var{type}[,@var{flag_specific_arguments}]]]
54473d8817e4Smiod@end smallexample
54483d8817e4Smiod
54493d8817e4SmiodThe optional @var{flags} argument is a quoted string which may contain any
54503d8817e4Smiodcombination of the following characters:
54513d8817e4Smiod@table @code
54523d8817e4Smiod@item a
54533d8817e4Smiodsection is allocatable
54543d8817e4Smiod@item w
54553d8817e4Smiodsection is writable
54563d8817e4Smiod@item x
54573d8817e4Smiodsection is executable
54583d8817e4Smiod@item M
54593d8817e4Smiodsection is mergeable
54603d8817e4Smiod@item S
54613d8817e4Smiodsection contains zero terminated strings
54623d8817e4Smiod@item G
54633d8817e4Smiodsection is a member of a section group
54643d8817e4Smiod@item T
54653d8817e4Smiodsection is used for thread-local-storage
54663d8817e4Smiod@end table
54673d8817e4Smiod
54683d8817e4SmiodThe optional @var{type} argument may contain one of the following constants:
54693d8817e4Smiod@table @code
54703d8817e4Smiod@item @@progbits
54713d8817e4Smiodsection contains data
54723d8817e4Smiod@item @@nobits
54733d8817e4Smiodsection does not contain data (i.e., section only occupies space)
54743d8817e4Smiod@item @@note
54753d8817e4Smiodsection contains data which is used by things other than the program
54763d8817e4Smiod@item @@init_array
54773d8817e4Smiodsection contains an array of pointers to init functions
54783d8817e4Smiod@item @@fini_array
54793d8817e4Smiodsection contains an array of pointers to finish functions
54803d8817e4Smiod@item @@preinit_array
54813d8817e4Smiodsection contains an array of pointers to pre-init functions
54823d8817e4Smiod@end table
54833d8817e4Smiod
54843d8817e4SmiodMany targets only support the first three section types.
54853d8817e4Smiod
54863d8817e4SmiodNote on targets where the @code{@@} character is the start of a comment (eg
54873d8817e4SmiodARM) then another character is used instead.  For example the ARM port uses the
54883d8817e4Smiod@code{%} character.
54893d8817e4Smiod
54903d8817e4SmiodIf @var{flags} contains the @code{M} symbol then the @var{type} argument must
54913d8817e4Smiodbe specified as well as an extra argument - @var{entsize} - like this:
54923d8817e4Smiod
54933d8817e4Smiod@smallexample
54943d8817e4Smiod.section @var{name} , "@var{flags}"M, @@@var{type}, @var{entsize}
54953d8817e4Smiod@end smallexample
54963d8817e4Smiod
54973d8817e4SmiodSections with the @code{M} flag but not @code{S} flag must contain fixed size
54983d8817e4Smiodconstants, each @var{entsize} octets long. Sections with both @code{M} and
54993d8817e4Smiod@code{S} must contain zero terminated strings where each character is
55003d8817e4Smiod@var{entsize} bytes long. The linker may remove duplicates within sections with
55013d8817e4Smiodthe same name, same entity size and same flags.  @var{entsize} must be an
55023d8817e4Smiodabsolute expression.
55033d8817e4Smiod
55043d8817e4SmiodIf @var{flags} contains the @code{G} symbol then the @var{type} argument must
55053d8817e4Smiodbe present along with an additional field like this:
55063d8817e4Smiod
55073d8817e4Smiod@smallexample
55083d8817e4Smiod.section @var{name} , "@var{flags}"G, @@@var{type}, @var{GroupName}[, @var{linkage}]
55093d8817e4Smiod@end smallexample
55103d8817e4Smiod
55113d8817e4SmiodThe @var{GroupName} field specifies the name of the section group to which this
55123d8817e4Smiodparticular section belongs.  The optional linkage field can contain:
55133d8817e4Smiod@table @code
55143d8817e4Smiod@item comdat
55153d8817e4Smiodindicates that only one copy of this section should be retained
55163d8817e4Smiod@item .gnu.linkonce
55173d8817e4Smiodan alias for comdat
55183d8817e4Smiod@end table
55193d8817e4Smiod
55203d8817e4SmiodNote - if both the @var{M} and @var{G} flags are present then the fields for
55213d8817e4Smiodthe Merge flag should come first, like this:
55223d8817e4Smiod
55233d8817e4Smiod@smallexample
55243d8817e4Smiod.section @var{name} , "@var{flags}"MG, @@@var{type}, @var{entsize}, @var{GroupName}[, @var{linkage}]
55253d8817e4Smiod@end smallexample
55263d8817e4Smiod
55273d8817e4SmiodIf no flags are specified, the default flags depend upon the section name.  If
55283d8817e4Smiodthe section name is not recognized, the default will be for the section to have
55293d8817e4Smiodnone of the above flags: it will not be allocated in memory, nor writable, nor
55303d8817e4Smiodexecutable.  The section will contain data.
55313d8817e4Smiod
55323d8817e4SmiodFor ELF targets, the assembler supports another type of @code{.section}
55333d8817e4Smioddirective for compatibility with the Solaris assembler:
55343d8817e4Smiod
55353d8817e4Smiod@smallexample
55363d8817e4Smiod.section "@var{name}"[, @var{flags}...]
55373d8817e4Smiod@end smallexample
55383d8817e4Smiod
55393d8817e4SmiodNote that the section name is quoted.  There may be a sequence of comma
55403d8817e4Smiodseparated flags:
55413d8817e4Smiod@table @code
55423d8817e4Smiod@item #alloc
55433d8817e4Smiodsection is allocatable
55443d8817e4Smiod@item #write
55453d8817e4Smiodsection is writable
55463d8817e4Smiod@item #execinstr
55473d8817e4Smiodsection is executable
55483d8817e4Smiod@item #tls
55493d8817e4Smiodsection is used for thread local storage
55503d8817e4Smiod@end table
55513d8817e4Smiod
55523d8817e4SmiodThis directive replaces the current section and subsection.  See the
55533d8817e4Smiodcontents of the gas testsuite directory @code{gas/testsuite/gas/elf} for
55543d8817e4Smiodsome examples of how this directive and the other section stack directives
55553d8817e4Smiodwork.
55563d8817e4Smiod@end ifset
55573d8817e4Smiod@end ifset
55583d8817e4Smiod
55593d8817e4Smiod@node Set
55603d8817e4Smiod@section @code{.set @var{symbol}, @var{expression}}
55613d8817e4Smiod
55623d8817e4Smiod@cindex @code{set} directive
55633d8817e4Smiod@cindex symbol value, setting
55643d8817e4SmiodSet the value of @var{symbol} to @var{expression}.  This
55653d8817e4Smiodchanges @var{symbol}'s value and type to conform to
55663d8817e4Smiod@var{expression}.  If @var{symbol} was flagged as external, it remains
55673d8817e4Smiodflagged (@pxref{Symbol Attributes}).
55683d8817e4Smiod
55693d8817e4SmiodYou may @code{.set} a symbol many times in the same assembly.
55703d8817e4Smiod
55713d8817e4SmiodIf you @code{.set} a global symbol, the value stored in the object
55723d8817e4Smiodfile is the last value stored into it.
55733d8817e4Smiod
55743d8817e4Smiod@ifset HPPA
55753d8817e4SmiodThe syntax for @code{set} on the HPPA is
55763d8817e4Smiod@samp{@var{symbol} .set @var{expression}}.
55773d8817e4Smiod@end ifset
55783d8817e4Smiod
55793d8817e4Smiod@ifset Z80
55803d8817e4SmiodOn Z80 @code{set} is a real instruction, use
55813d8817e4Smiod@samp{@var{symbol} defl @var{expression}} instead.
55823d8817e4Smiod@end ifset
55833d8817e4Smiod
55843d8817e4Smiod@node Short
55853d8817e4Smiod@section @code{.short @var{expressions}}
55863d8817e4Smiod
55873d8817e4Smiod@cindex @code{short} directive
55883d8817e4Smiod@ifset GENERIC
55893d8817e4Smiod@code{.short} is normally the same as @samp{.word}.
55903d8817e4Smiod@xref{Word,,@code{.word}}.
55913d8817e4Smiod
55923d8817e4SmiodIn some configurations, however, @code{.short} and @code{.word} generate
55933d8817e4Smiodnumbers of different lengths; @pxref{Machine Dependencies}.
55943d8817e4Smiod@end ifset
55953d8817e4Smiod@ifclear GENERIC
55963d8817e4Smiod@ifset W16
55973d8817e4Smiod@code{.short} is the same as @samp{.word}.  @xref{Word,,@code{.word}}.
55983d8817e4Smiod@end ifset
55993d8817e4Smiod@ifset W32
56003d8817e4SmiodThis expects zero or more @var{expressions}, and emits
56013d8817e4Smioda 16 bit number for each.
56023d8817e4Smiod@end ifset
56033d8817e4Smiod@end ifclear
56043d8817e4Smiod
56053d8817e4Smiod@node Single
56063d8817e4Smiod@section @code{.single @var{flonums}}
56073d8817e4Smiod
56083d8817e4Smiod@cindex @code{single} directive
56093d8817e4Smiod@cindex floating point numbers (single)
56103d8817e4SmiodThis directive assembles zero or more flonums, separated by commas.  It
56113d8817e4Smiodhas the same effect as @code{.float}.
56123d8817e4Smiod@ifset GENERIC
56133d8817e4SmiodThe exact kind of floating point numbers emitted depends on how
56143d8817e4Smiod@command{@value{AS}} is configured.  @xref{Machine Dependencies}.
56153d8817e4Smiod@end ifset
56163d8817e4Smiod@ifclear GENERIC
56173d8817e4Smiod@ifset IEEEFLOAT
56183d8817e4SmiodOn the @value{TARGET} family, @code{.single} emits 32-bit floating point
56193d8817e4Smiodnumbers in @sc{ieee} format.
56203d8817e4Smiod@end ifset
56213d8817e4Smiod@end ifclear
56223d8817e4Smiod
56233d8817e4Smiod@ifset COFF-ELF
56243d8817e4Smiod@node Size
56253d8817e4Smiod@section @code{.size}
56263d8817e4Smiod
56273d8817e4SmiodThis directive is used to set the size associated with a symbol.
56283d8817e4Smiod
56293d8817e4Smiod@ifset COFF
56303d8817e4Smiod@ifset ELF
56313d8817e4Smiod@c only print the extra heading if both COFF and ELF are set
56323d8817e4Smiod@subheading COFF Version
56333d8817e4Smiod@end ifset
56343d8817e4Smiod
56353d8817e4Smiod@cindex @code{size} directive (COFF version)
56363d8817e4SmiodFor COFF targets, the @code{.size} directive is only permitted inside
56373d8817e4Smiod@code{.def}/@code{.endef} pairs.  It is used like this:
56383d8817e4Smiod
56393d8817e4Smiod@smallexample
56403d8817e4Smiod.size @var{expression}
56413d8817e4Smiod@end smallexample
56423d8817e4Smiod
56433d8817e4Smiod@ifset BOUT
56443d8817e4Smiod@samp{.size} is only meaningful when generating COFF format output; when
56453d8817e4Smiod@command{@value{AS}} is generating @code{b.out}, it accepts this directive but
56463d8817e4Smiodignores it.
56473d8817e4Smiod@end ifset
56483d8817e4Smiod@end ifset
56493d8817e4Smiod
56503d8817e4Smiod@ifset ELF
56513d8817e4Smiod@ifset COFF
56523d8817e4Smiod@c only print the extra heading if both COFF and ELF are set
56533d8817e4Smiod@subheading ELF Version
56543d8817e4Smiod@end ifset
56553d8817e4Smiod
56563d8817e4Smiod@cindex @code{size} directive (ELF version)
56573d8817e4SmiodFor ELF targets, the @code{.size} directive is used like this:
56583d8817e4Smiod
56593d8817e4Smiod@smallexample
56603d8817e4Smiod.size @var{name} , @var{expression}
56613d8817e4Smiod@end smallexample
56623d8817e4Smiod
56633d8817e4SmiodThis directive sets the size associated with a symbol @var{name}.
56643d8817e4SmiodThe size in bytes is computed from @var{expression} which can make use of label
56653d8817e4Smiodarithmetic.  This directive is typically used to set the size of function
56663d8817e4Smiodsymbols.
56673d8817e4Smiod@end ifset
56683d8817e4Smiod@end ifset
56693d8817e4Smiod
56703d8817e4Smiod@node Sleb128
56713d8817e4Smiod@section @code{.sleb128 @var{expressions}}
56723d8817e4Smiod
56733d8817e4Smiod@cindex @code{sleb128} directive
56743d8817e4Smiod@var{sleb128} stands for ``signed little endian base 128.''  This is a
56753d8817e4Smiodcompact, variable length representation of numbers used by the DWARF
56763d8817e4Smiodsymbolic debugging format.  @xref{Uleb128,@code{.uleb128}}.
56773d8817e4Smiod
56783d8817e4Smiod@ifclear no-space-dir
56793d8817e4Smiod@node Skip
56803d8817e4Smiod@section @code{.skip @var{size} , @var{fill}}
56813d8817e4Smiod
56823d8817e4Smiod@cindex @code{skip} directive
56833d8817e4Smiod@cindex filling memory
56843d8817e4SmiodThis directive emits @var{size} bytes, each of value @var{fill}.  Both
56853d8817e4Smiod@var{size} and @var{fill} are absolute expressions.  If the comma and
56863d8817e4Smiod@var{fill} are omitted, @var{fill} is assumed to be zero.  This is the same as
56873d8817e4Smiod@samp{.space}.
56883d8817e4Smiod
56893d8817e4Smiod@node Space
56903d8817e4Smiod@section @code{.space @var{size} , @var{fill}}
56913d8817e4Smiod
56923d8817e4Smiod@cindex @code{space} directive
56933d8817e4Smiod@cindex filling memory
56943d8817e4SmiodThis directive emits @var{size} bytes, each of value @var{fill}.  Both
56953d8817e4Smiod@var{size} and @var{fill} are absolute expressions.  If the comma
56963d8817e4Smiodand @var{fill} are omitted, @var{fill} is assumed to be zero.  This is the same
56973d8817e4Smiodas @samp{.skip}.
56983d8817e4Smiod
56993d8817e4Smiod@ifset HPPA
57003d8817e4Smiod@quotation
57013d8817e4Smiod@emph{Warning:} @code{.space} has a completely different meaning for HPPA
57023d8817e4Smiodtargets; use @code{.block} as a substitute.  See @cite{HP9000 Series 800
57033d8817e4SmiodAssembly Language Reference Manual} (HP 92432-90001) for the meaning of the
57043d8817e4Smiod@code{.space} directive.  @xref{HPPA Directives,,HPPA Assembler Directives},
57053d8817e4Smiodfor a summary.
57063d8817e4Smiod@end quotation
57073d8817e4Smiod@end ifset
57083d8817e4Smiod@end ifclear
57093d8817e4Smiod
57103d8817e4Smiod@ifset have-stabs
57113d8817e4Smiod@node Stab
57123d8817e4Smiod@section @code{.stabd, .stabn, .stabs}
57133d8817e4Smiod
57143d8817e4Smiod@cindex symbolic debuggers, information for
57153d8817e4Smiod@cindex @code{stab@var{x}} directives
57163d8817e4SmiodThere are three directives that begin @samp{.stab}.
57173d8817e4SmiodAll emit symbols (@pxref{Symbols}), for use by symbolic debuggers.
57183d8817e4SmiodThe symbols are not entered in the @command{@value{AS}} hash table: they
57193d8817e4Smiodcannot be referenced elsewhere in the source file.
57203d8817e4SmiodUp to five fields are required:
57213d8817e4Smiod
57223d8817e4Smiod@table @var
57233d8817e4Smiod@item string
57243d8817e4SmiodThis is the symbol's name.  It may contain any character except
57253d8817e4Smiod@samp{\000}, so is more general than ordinary symbol names.  Some
57263d8817e4Smioddebuggers used to code arbitrarily complex structures into symbol names
57273d8817e4Smiodusing this field.
57283d8817e4Smiod
57293d8817e4Smiod@item type
57303d8817e4SmiodAn absolute expression.  The symbol's type is set to the low 8 bits of
57313d8817e4Smiodthis expression.  Any bit pattern is permitted, but @code{@value{LD}}
57323d8817e4Smiodand debuggers choke on silly bit patterns.
57333d8817e4Smiod
57343d8817e4Smiod@item other
57353d8817e4SmiodAn absolute expression.  The symbol's ``other'' attribute is set to the
57363d8817e4Smiodlow 8 bits of this expression.
57373d8817e4Smiod
57383d8817e4Smiod@item desc
57393d8817e4SmiodAn absolute expression.  The symbol's descriptor is set to the low 16
57403d8817e4Smiodbits of this expression.
57413d8817e4Smiod
57423d8817e4Smiod@item value
57433d8817e4SmiodAn absolute expression which becomes the symbol's value.
57443d8817e4Smiod@end table
57453d8817e4Smiod
57463d8817e4SmiodIf a warning is detected while reading a @code{.stabd}, @code{.stabn},
57473d8817e4Smiodor @code{.stabs} statement, the symbol has probably already been created;
57483d8817e4Smiodyou get a half-formed symbol in your object file.  This is
57493d8817e4Smiodcompatible with earlier assemblers!
57503d8817e4Smiod
57513d8817e4Smiod@table @code
57523d8817e4Smiod@cindex @code{stabd} directive
57533d8817e4Smiod@item .stabd @var{type} , @var{other} , @var{desc}
57543d8817e4Smiod
57553d8817e4SmiodThe ``name'' of the symbol generated is not even an empty string.
57563d8817e4SmiodIt is a null pointer, for compatibility.  Older assemblers used a
57573d8817e4Smiodnull pointer so they didn't waste space in object files with empty
57583d8817e4Smiodstrings.
57593d8817e4Smiod
57603d8817e4SmiodThe symbol's value is set to the location counter,
57613d8817e4Smiodrelocatably.  When your program is linked, the value of this symbol
57623d8817e4Smiodis the address of the location counter when the @code{.stabd} was
57633d8817e4Smiodassembled.
57643d8817e4Smiod
57653d8817e4Smiod@cindex @code{stabn} directive
57663d8817e4Smiod@item .stabn @var{type} , @var{other} , @var{desc} , @var{value}
57673d8817e4SmiodThe name of the symbol is set to the empty string @code{""}.
57683d8817e4Smiod
57693d8817e4Smiod@cindex @code{stabs} directive
57703d8817e4Smiod@item .stabs @var{string} ,  @var{type} , @var{other} , @var{desc} , @var{value}
57713d8817e4SmiodAll five fields are specified.
57723d8817e4Smiod@end table
57733d8817e4Smiod@end ifset
57743d8817e4Smiod@c end     have-stabs
57753d8817e4Smiod
57763d8817e4Smiod@node String
57773d8817e4Smiod@section @code{.string} "@var{str}"
57783d8817e4Smiod
57793d8817e4Smiod@cindex string, copying to object file
57803d8817e4Smiod@cindex @code{string} directive
57813d8817e4Smiod
57823d8817e4SmiodCopy the characters in @var{str} to the object file.  You may specify more than
57833d8817e4Smiodone string to copy, separated by commas.  Unless otherwise specified for a
57843d8817e4Smiodparticular machine, the assembler marks the end of each string with a 0 byte.
57853d8817e4SmiodYou can use any of the escape sequences described in @ref{Strings,,Strings}.
57863d8817e4Smiod
57873d8817e4Smiod@node Struct
57883d8817e4Smiod@section @code{.struct @var{expression}}
57893d8817e4Smiod
57903d8817e4Smiod@cindex @code{struct} directive
57913d8817e4SmiodSwitch to the absolute section, and set the section offset to @var{expression},
57923d8817e4Smiodwhich must be an absolute expression.  You might use this as follows:
57933d8817e4Smiod@smallexample
57943d8817e4Smiod        .struct 0
57953d8817e4Smiodfield1:
57963d8817e4Smiod        .struct field1 + 4
57973d8817e4Smiodfield2:
57983d8817e4Smiod        .struct field2 + 4
57993d8817e4Smiodfield3:
58003d8817e4Smiod@end smallexample
58013d8817e4SmiodThis would define the symbol @code{field1} to have the value 0, the symbol
58023d8817e4Smiod@code{field2} to have the value 4, and the symbol @code{field3} to have the
58033d8817e4Smiodvalue 8.  Assembly would be left in the absolute section, and you would need to
58043d8817e4Smioduse a @code{.section} directive of some sort to change to some other section
58053d8817e4Smiodbefore further assembly.
58063d8817e4Smiod
58073d8817e4Smiod@ifset ELF
58083d8817e4Smiod@node SubSection
58093d8817e4Smiod@section @code{.subsection @var{name}}
58103d8817e4Smiod
58113d8817e4Smiod@cindex @code{subsection} directive
58123d8817e4Smiod@cindex Section Stack
58133d8817e4SmiodThis is one of the ELF section stack manipulation directives.  The others are
58143d8817e4Smiod@code{.section} (@pxref{Section}), @code{.pushsection} (@pxref{PushSection}),
58153d8817e4Smiod@code{.popsection} (@pxref{PopSection}), and @code{.previous}
58163d8817e4Smiod(@pxref{Previous}).
58173d8817e4Smiod
58183d8817e4SmiodThis directive replaces the current subsection with @code{name}.  The current
58193d8817e4Smiodsection is not changed.  The replaced subsection is put onto the section stack
58203d8817e4Smiodin place of the then current top of stack subsection.
58213d8817e4Smiod@end ifset
58223d8817e4Smiod
58233d8817e4Smiod@ifset ELF
58243d8817e4Smiod@node Symver
58253d8817e4Smiod@section @code{.symver}
58263d8817e4Smiod@cindex @code{symver} directive
58273d8817e4Smiod@cindex symbol versioning
58283d8817e4Smiod@cindex versions of symbols
58293d8817e4SmiodUse the @code{.symver} directive to bind symbols to specific version nodes
58303d8817e4Smiodwithin a source file.  This is only supported on ELF platforms, and is
58313d8817e4Smiodtypically used when assembling files to be linked into a shared library.
58323d8817e4SmiodThere are cases where it may make sense to use this in objects to be bound
58333d8817e4Smiodinto an application itself so as to override a versioned symbol from a
58343d8817e4Smiodshared library.
58353d8817e4Smiod
58363d8817e4SmiodFor ELF targets, the @code{.symver} directive can be used like this:
58373d8817e4Smiod@smallexample
58383d8817e4Smiod.symver @var{name}, @var{name2@@nodename}
58393d8817e4Smiod@end smallexample
58403d8817e4SmiodIf the symbol @var{name} is defined within the file
58413d8817e4Smiodbeing assembled, the @code{.symver} directive effectively creates a symbol
58423d8817e4Smiodalias with the name @var{name2@@nodename}, and in fact the main reason that we
58433d8817e4Smiodjust don't try and create a regular alias is that the @var{@@} character isn't
58443d8817e4Smiodpermitted in symbol names.  The @var{name2} part of the name is the actual name
58453d8817e4Smiodof the symbol by which it will be externally referenced.  The name @var{name}
58463d8817e4Smioditself is merely a name of convenience that is used so that it is possible to
58473d8817e4Smiodhave definitions for multiple versions of a function within a single source
58483d8817e4Smiodfile, and so that the compiler can unambiguously know which version of a
58493d8817e4Smiodfunction is being mentioned.  The @var{nodename} portion of the alias should be
58503d8817e4Smiodthe name of a node specified in the version script supplied to the linker when
58513d8817e4Smiodbuilding a shared library.  If you are attempting to override a versioned
58523d8817e4Smiodsymbol from a shared library, then @var{nodename} should correspond to the
58533d8817e4Smiodnodename of the symbol you are trying to override.
58543d8817e4Smiod
58553d8817e4SmiodIf the symbol @var{name} is not defined within the file being assembled, all
58563d8817e4Smiodreferences to @var{name} will be changed to @var{name2@@nodename}.  If no
58573d8817e4Smiodreference to @var{name} is made, @var{name2@@nodename} will be removed from the
58583d8817e4Smiodsymbol table.
58593d8817e4Smiod
58603d8817e4SmiodAnother usage of the @code{.symver} directive is:
58613d8817e4Smiod@smallexample
58623d8817e4Smiod.symver @var{name}, @var{name2@@@@nodename}
58633d8817e4Smiod@end smallexample
58643d8817e4SmiodIn this case, the symbol @var{name} must exist and be defined within
58653d8817e4Smiodthe file being assembled. It is similar to @var{name2@@nodename}. The
58663d8817e4Smioddifference is @var{name2@@@@nodename} will also be used to resolve
58673d8817e4Smiodreferences to @var{name2} by the linker.
58683d8817e4Smiod
58693d8817e4SmiodThe third usage of the @code{.symver} directive is:
58703d8817e4Smiod@smallexample
58713d8817e4Smiod.symver @var{name}, @var{name2@@@@@@nodename}
58723d8817e4Smiod@end smallexample
58733d8817e4SmiodWhen @var{name} is not defined within the
58743d8817e4Smiodfile being assembled, it is treated as @var{name2@@nodename}. When
58753d8817e4Smiod@var{name} is defined within the file being assembled, the symbol
58763d8817e4Smiodname, @var{name}, will be changed to @var{name2@@@@nodename}.
58773d8817e4Smiod@end ifset
58783d8817e4Smiod
58793d8817e4Smiod@ifset COFF
58803d8817e4Smiod@node Tag
58813d8817e4Smiod@section @code{.tag @var{structname}}
58823d8817e4Smiod
58833d8817e4Smiod@cindex COFF structure debugging
58843d8817e4Smiod@cindex structure debugging, COFF
58853d8817e4Smiod@cindex @code{tag} directive
58863d8817e4SmiodThis directive is generated by compilers to include auxiliary debugging
58873d8817e4Smiodinformation in the symbol table.  It is only permitted inside
58883d8817e4Smiod@code{.def}/@code{.endef} pairs.  Tags are used to link structure
58893d8817e4Smioddefinitions in the symbol table with instances of those structures.
58903d8817e4Smiod@ifset BOUT
58913d8817e4Smiod
58923d8817e4Smiod@samp{.tag} is only used when generating COFF format output; when
58933d8817e4Smiod@command{@value{AS}} is generating @code{b.out}, it accepts this directive but
58943d8817e4Smiodignores it.
58953d8817e4Smiod@end ifset
58963d8817e4Smiod@end ifset
58973d8817e4Smiod
58983d8817e4Smiod@node Text
58993d8817e4Smiod@section @code{.text @var{subsection}}
59003d8817e4Smiod
59013d8817e4Smiod@cindex @code{text} directive
59023d8817e4SmiodTells @command{@value{AS}} to assemble the following statements onto the end of
59033d8817e4Smiodthe text subsection numbered @var{subsection}, which is an absolute
59043d8817e4Smiodexpression.  If @var{subsection} is omitted, subsection number zero
59053d8817e4Smiodis used.
59063d8817e4Smiod
59073d8817e4Smiod@node Title
59083d8817e4Smiod@section @code{.title "@var{heading}"}
59093d8817e4Smiod
59103d8817e4Smiod@cindex @code{title} directive
59113d8817e4Smiod@cindex listing control: title line
59123d8817e4SmiodUse @var{heading} as the title (second line, immediately after the
59133d8817e4Smiodsource file name and pagenumber) when generating assembly listings.
59143d8817e4Smiod
59153d8817e4SmiodThis directive affects subsequent pages, as well as the current page if
59163d8817e4Smiodit appears within ten lines of the top of a page.
59173d8817e4Smiod
59183d8817e4Smiod@ifset COFF-ELF
59193d8817e4Smiod@node Type
59203d8817e4Smiod@section @code{.type}
59213d8817e4Smiod
59223d8817e4SmiodThis directive is used to set the type of a symbol.
59233d8817e4Smiod
59243d8817e4Smiod@ifset COFF
59253d8817e4Smiod@ifset ELF
59263d8817e4Smiod@c only print the extra heading if both COFF and ELF are set
59273d8817e4Smiod@subheading COFF Version
59283d8817e4Smiod@end ifset
59293d8817e4Smiod
59303d8817e4Smiod@cindex COFF symbol type
59313d8817e4Smiod@cindex symbol type, COFF
59323d8817e4Smiod@cindex @code{type} directive (COFF version)
59333d8817e4SmiodFor COFF targets, this directive is permitted only within
59343d8817e4Smiod@code{.def}/@code{.endef} pairs.  It is used like this:
59353d8817e4Smiod
59363d8817e4Smiod@smallexample
59373d8817e4Smiod.type @var{int}
59383d8817e4Smiod@end smallexample
59393d8817e4Smiod
59403d8817e4SmiodThis records the integer @var{int} as the type attribute of a symbol table
59413d8817e4Smiodentry.
59423d8817e4Smiod
59433d8817e4Smiod@ifset BOUT
59443d8817e4Smiod@samp{.type} is associated only with COFF format output; when
59453d8817e4Smiod@command{@value{AS}} is configured for @code{b.out} output, it accepts this
59463d8817e4Smioddirective but ignores it.
59473d8817e4Smiod@end ifset
59483d8817e4Smiod@end ifset
59493d8817e4Smiod
59503d8817e4Smiod@ifset ELF
59513d8817e4Smiod@ifset COFF
59523d8817e4Smiod@c only print the extra heading if both COFF and ELF are set
59533d8817e4Smiod@subheading ELF Version
59543d8817e4Smiod@end ifset
59553d8817e4Smiod
59563d8817e4Smiod@cindex ELF symbol type
59573d8817e4Smiod@cindex symbol type, ELF
59583d8817e4Smiod@cindex @code{type} directive (ELF version)
59593d8817e4SmiodFor ELF targets, the @code{.type} directive is used like this:
59603d8817e4Smiod
59613d8817e4Smiod@smallexample
59623d8817e4Smiod.type @var{name} , @var{type description}
59633d8817e4Smiod@end smallexample
59643d8817e4Smiod
59653d8817e4SmiodThis sets the type of symbol @var{name} to be either a
59663d8817e4Smiodfunction symbol or an object symbol.  There are five different syntaxes
59673d8817e4Smiodsupported for the @var{type description} field, in order to provide
59683d8817e4Smiodcompatibility with various other assemblers.  The syntaxes supported are:
59693d8817e4Smiod
59703d8817e4Smiod@smallexample
59713d8817e4Smiod  .type <name>,#function
59723d8817e4Smiod  .type <name>,#object
59733d8817e4Smiod
59743d8817e4Smiod  .type <name>,@@function
59753d8817e4Smiod  .type <name>,@@object
59763d8817e4Smiod
59773d8817e4Smiod  .type <name>,%function
59783d8817e4Smiod  .type <name>,%object
59793d8817e4Smiod
59803d8817e4Smiod  .type <name>,"function"
59813d8817e4Smiod  .type <name>,"object"
59823d8817e4Smiod
59833d8817e4Smiod  .type <name> STT_FUNCTION
59843d8817e4Smiod  .type <name> STT_OBJECT
59853d8817e4Smiod@end smallexample
59863d8817e4Smiod@end ifset
59873d8817e4Smiod@end ifset
59883d8817e4Smiod
59893d8817e4Smiod@node Uleb128
59903d8817e4Smiod@section @code{.uleb128 @var{expressions}}
59913d8817e4Smiod
59923d8817e4Smiod@cindex @code{uleb128} directive
59933d8817e4Smiod@var{uleb128} stands for ``unsigned little endian base 128.''  This is a
59943d8817e4Smiodcompact, variable length representation of numbers used by the DWARF
59953d8817e4Smiodsymbolic debugging format.  @xref{Sleb128,@code{.sleb128}}.
59963d8817e4Smiod
59973d8817e4Smiod@ifset COFF
59983d8817e4Smiod@node Val
59993d8817e4Smiod@section @code{.val @var{addr}}
60003d8817e4Smiod
60013d8817e4Smiod@cindex @code{val} directive
60023d8817e4Smiod@cindex COFF value attribute
60033d8817e4Smiod@cindex value attribute, COFF
60043d8817e4SmiodThis directive, permitted only within @code{.def}/@code{.endef} pairs,
60053d8817e4Smiodrecords the address @var{addr} as the value attribute of a symbol table
60063d8817e4Smiodentry.
60073d8817e4Smiod@ifset BOUT
60083d8817e4Smiod
60093d8817e4Smiod@samp{.val} is used only for COFF output; when @command{@value{AS}} is
60103d8817e4Smiodconfigured for @code{b.out}, it accepts this directive but ignores it.
60113d8817e4Smiod@end ifset
60123d8817e4Smiod@end ifset
60133d8817e4Smiod
60143d8817e4Smiod@ifset ELF
60153d8817e4Smiod@node Version
60163d8817e4Smiod@section @code{.version "@var{string}"}
60173d8817e4Smiod
60183d8817e4Smiod@cindex @code{version} directive
60193d8817e4SmiodThis directive creates a @code{.note} section and places into it an ELF
60203d8817e4Smiodformatted note of type NT_VERSION.  The note's name is set to @code{string}.
60213d8817e4Smiod@end ifset
60223d8817e4Smiod
60233d8817e4Smiod@ifset ELF
60243d8817e4Smiod@node VTableEntry
60253d8817e4Smiod@section @code{.vtable_entry @var{table}, @var{offset}}
60263d8817e4Smiod
60273d8817e4Smiod@cindex @code{vtable_entry} directive
60283d8817e4SmiodThis directive finds or creates a symbol @code{table} and creates a
60293d8817e4Smiod@code{VTABLE_ENTRY} relocation for it with an addend of @code{offset}.
60303d8817e4Smiod
60313d8817e4Smiod@node VTableInherit
60323d8817e4Smiod@section @code{.vtable_inherit @var{child}, @var{parent}}
60333d8817e4Smiod
60343d8817e4Smiod@cindex @code{vtable_inherit} directive
60353d8817e4SmiodThis directive finds the symbol @code{child} and finds or creates the symbol
60363d8817e4Smiod@code{parent} and then creates a @code{VTABLE_INHERIT} relocation for the
60373d8817e4Smiodparent whose addend is the value of the child symbol.  As a special case the
60383d8817e4Smiodparent name of @code{0} is treated as refering the @code{*ABS*} section.
60393d8817e4Smiod@end ifset
60403d8817e4Smiod
60413d8817e4Smiod@node Warning
60423d8817e4Smiod@section @code{.warning "@var{string}"}
60433d8817e4Smiod@cindex warning directive
60443d8817e4SmiodSimilar to the directive @code{.error}
60453d8817e4Smiod(@pxref{Error,,@code{.error "@var{string}"}}), but just emits a warning.
60463d8817e4Smiod
60473d8817e4Smiod@node Weak
60483d8817e4Smiod@section @code{.weak @var{names}}
60493d8817e4Smiod
60503d8817e4Smiod@cindex @code{weak} directive
60513d8817e4SmiodThis directive sets the weak attribute on the comma separated list of symbol
60523d8817e4Smiod@code{names}.  If the symbols do not already exist, they will be created.
60533d8817e4Smiod
60543d8817e4SmiodOn COFF targets other than PE, weak symbols are a GNU extension.  This
60553d8817e4Smioddirective sets the weak attribute on the comma separated list of symbol
60563d8817e4Smiod@code{names}.  If the symbols do not already exist, they will be created.
60573d8817e4Smiod
60583d8817e4SmiodOn the PE target, weak symbols are supported natively as weak aliases.
60593d8817e4SmiodWhen a weak symbol is created that is not an alias, GAS creates an
60603d8817e4Smiodalternate symbol to hold the default value.
60613d8817e4Smiod
60623d8817e4Smiod@node Weakref
60633d8817e4Smiod@section @code{.weakref @var{alias}, @var{target}}
60643d8817e4Smiod
60653d8817e4Smiod@cindex @code{weakref} directive
60663d8817e4SmiodThis directive creates an alias to the target symbol that enables the symbol to
60673d8817e4Smiodbe referenced with weak-symbol semantics, but without actually making it weak.
60683d8817e4SmiodIf direct references or definitions of the symbol are present, then the symbol
60693d8817e4Smiodwill not be weak, but if all references to it are through weak references, the
60703d8817e4Smiodsymbol will be marked as weak in the symbol table.
60713d8817e4Smiod
60723d8817e4SmiodThe effect is equivalent to moving all references to the alias to a separate
60733d8817e4Smiodassembly source file, renaming the alias to the symbol in it, declaring the
60743d8817e4Smiodsymbol as weak there, and running a reloadable link to merge the object files
60753d8817e4Smiodresulting from the assembly of the new source file and the old source file that
60763d8817e4Smiodhad the references to the alias removed.
60773d8817e4Smiod
60783d8817e4SmiodThe alias itself never makes to the symbol table, and is entirely handled
60793d8817e4Smiodwithin the assembler.
60803d8817e4Smiod
60813d8817e4Smiod@node Word
60823d8817e4Smiod@section @code{.word @var{expressions}}
60833d8817e4Smiod
60843d8817e4Smiod@cindex @code{word} directive
60853d8817e4SmiodThis directive expects zero or more @var{expressions}, of any section,
60863d8817e4Smiodseparated by commas.
60873d8817e4Smiod@ifclear GENERIC
60883d8817e4Smiod@ifset W32
60893d8817e4SmiodFor each expression, @command{@value{AS}} emits a 32-bit number.
60903d8817e4Smiod@end ifset
60913d8817e4Smiod@ifset W16
60923d8817e4SmiodFor each expression, @command{@value{AS}} emits a 16-bit number.
60933d8817e4Smiod@end ifset
60943d8817e4Smiod@end ifclear
60953d8817e4Smiod@ifset GENERIC
60963d8817e4Smiod
60973d8817e4SmiodThe size of the number emitted, and its byte order,
60983d8817e4Smioddepend on what target computer the assembly is for.
60993d8817e4Smiod@end ifset
61003d8817e4Smiod
61013d8817e4Smiod@c on amd29k, i960, sparc the "special treatment to support compilers" doesn't
61023d8817e4Smiod@c happen---32-bit addressability, period; no long/short jumps.
61033d8817e4Smiod@ifset DIFF-TBL-KLUGE
61043d8817e4Smiod@cindex difference tables altered
61053d8817e4Smiod@cindex altered difference tables
61063d8817e4Smiod@quotation
61073d8817e4Smiod@emph{Warning: Special Treatment to support Compilers}
61083d8817e4Smiod@end quotation
61093d8817e4Smiod
61103d8817e4Smiod@ifset GENERIC
61113d8817e4SmiodMachines with a 32-bit address space, but that do less than 32-bit
61123d8817e4Smiodaddressing, require the following special treatment.  If the machine of
61133d8817e4Smiodinterest to you does 32-bit addressing (or doesn't require it;
61143d8817e4Smiod@pxref{Machine Dependencies}), you can ignore this issue.
61153d8817e4Smiod
61163d8817e4Smiod@end ifset
61173d8817e4SmiodIn order to assemble compiler output into something that works,
61183d8817e4Smiod@command{@value{AS}} occasionally does strange things to @samp{.word} directives.
61193d8817e4SmiodDirectives of the form @samp{.word sym1-sym2} are often emitted by
61203d8817e4Smiodcompilers as part of jump tables.  Therefore, when @command{@value{AS}} assembles a
61213d8817e4Smioddirective of the form @samp{.word sym1-sym2}, and the difference between
61223d8817e4Smiod@code{sym1} and @code{sym2} does not fit in 16 bits, @command{@value{AS}}
61233d8817e4Smiodcreates a @dfn{secondary jump table}, immediately before the next label.
61243d8817e4SmiodThis secondary jump table is preceded by a short-jump to the
61253d8817e4Smiodfirst byte after the secondary table.  This short-jump prevents the flow
61263d8817e4Smiodof control from accidentally falling into the new table.  Inside the
61273d8817e4Smiodtable is a long-jump to @code{sym2}.  The original @samp{.word}
61283d8817e4Smiodcontains @code{sym1} minus the address of the long-jump to
61293d8817e4Smiod@code{sym2}.
61303d8817e4Smiod
61313d8817e4SmiodIf there were several occurrences of @samp{.word sym1-sym2} before the
61323d8817e4Smiodsecondary jump table, all of them are adjusted.  If there was a
61333d8817e4Smiod@samp{.word sym3-sym4}, that also did not fit in sixteen bits, a
61343d8817e4Smiodlong-jump to @code{sym4} is included in the secondary jump table,
61353d8817e4Smiodand the @code{.word} directives are adjusted to contain @code{sym3}
61363d8817e4Smiodminus the address of the long-jump to @code{sym4}; and so on, for as many
61373d8817e4Smiodentries in the original jump table as necessary.
61383d8817e4Smiod
61393d8817e4Smiod@ifset INTERNALS
61403d8817e4Smiod@emph{This feature may be disabled by compiling @command{@value{AS}} with the
61413d8817e4Smiod@samp{-DWORKING_DOT_WORD} option.} This feature is likely to confuse
61423d8817e4Smiodassembly language programmers.
61433d8817e4Smiod@end ifset
61443d8817e4Smiod@end ifset
61453d8817e4Smiod@c end     DIFF-TBL-KLUGE
61463d8817e4Smiod
61473d8817e4Smiod@node Deprecated
61483d8817e4Smiod@section Deprecated Directives
61493d8817e4Smiod
61503d8817e4Smiod@cindex deprecated directives
61513d8817e4Smiod@cindex obsolescent directives
61523d8817e4SmiodOne day these directives won't work.
61533d8817e4SmiodThey are included for compatibility with older assemblers.
61543d8817e4Smiod@table @t
61553d8817e4Smiod@item .abort
61563d8817e4Smiod@item .line
61573d8817e4Smiod@end table
61583d8817e4Smiod
61593d8817e4Smiod@ifset GENERIC
61603d8817e4Smiod@node Machine Dependencies
61613d8817e4Smiod@chapter Machine Dependent Features
61623d8817e4Smiod
61633d8817e4Smiod@cindex machine dependencies
61643d8817e4SmiodThe machine instruction sets are (almost by definition) different on
61653d8817e4Smiodeach machine where @command{@value{AS}} runs.  Floating point representations
61663d8817e4Smiodvary as well, and @command{@value{AS}} often supports a few additional
61673d8817e4Smioddirectives or command-line options for compatibility with other
61683d8817e4Smiodassemblers on a particular platform.  Finally, some versions of
61693d8817e4Smiod@command{@value{AS}} support special pseudo-instructions for branch
61703d8817e4Smiodoptimization.
61713d8817e4Smiod
61723d8817e4SmiodThis chapter discusses most of these differences, though it does not
61733d8817e4Smiodinclude details on any machine's instruction set.  For details on that
61743d8817e4Smiodsubject, see the hardware manufacturer's manual.
61753d8817e4Smiod
61763d8817e4Smiod@menu
61773d8817e4Smiod@ifset ALPHA
61783d8817e4Smiod* Alpha-Dependent::		Alpha Dependent Features
61793d8817e4Smiod@end ifset
61803d8817e4Smiod@ifset ARC
61813d8817e4Smiod* ARC-Dependent::               ARC Dependent Features
61823d8817e4Smiod@end ifset
61833d8817e4Smiod@ifset ARM
61843d8817e4Smiod* ARM-Dependent::               ARM Dependent Features
61853d8817e4Smiod@end ifset
61863d8817e4Smiod@ifset BFIN
61873d8817e4Smiod* BFIN-Dependent::		BFIN Dependent Features
61883d8817e4Smiod@end ifset
61893d8817e4Smiod@ifset CRIS
61903d8817e4Smiod* CRIS-Dependent::              CRIS Dependent Features
61913d8817e4Smiod@end ifset
61923d8817e4Smiod@ifset D10V
61933d8817e4Smiod* D10V-Dependent::              D10V Dependent Features
61943d8817e4Smiod@end ifset
61953d8817e4Smiod@ifset D30V
61963d8817e4Smiod* D30V-Dependent::              D30V Dependent Features
61973d8817e4Smiod@end ifset
61983d8817e4Smiod@ifset H8/300
61993d8817e4Smiod* H8/300-Dependent::            Renesas H8/300 Dependent Features
62003d8817e4Smiod@end ifset
62013d8817e4Smiod@ifset HPPA
62023d8817e4Smiod* HPPA-Dependent::              HPPA Dependent Features
62033d8817e4Smiod@end ifset
62043d8817e4Smiod@ifset I370
62053d8817e4Smiod* ESA/390-Dependent::           IBM ESA/390 Dependent Features
62063d8817e4Smiod@end ifset
62073d8817e4Smiod@ifset I80386
62083d8817e4Smiod* i386-Dependent::              Intel 80386 and AMD x86-64 Dependent Features
62093d8817e4Smiod@end ifset
62103d8817e4Smiod@ifset I860
62113d8817e4Smiod* i860-Dependent::              Intel 80860 Dependent Features
62123d8817e4Smiod@end ifset
62133d8817e4Smiod@ifset I960
62143d8817e4Smiod* i960-Dependent::              Intel 80960 Dependent Features
62153d8817e4Smiod@end ifset
62163d8817e4Smiod@ifset IA64
62173d8817e4Smiod* IA-64-Dependent::             Intel IA-64 Dependent Features
62183d8817e4Smiod@end ifset
62193d8817e4Smiod@ifset IP2K
62203d8817e4Smiod* IP2K-Dependent::              IP2K Dependent Features
62213d8817e4Smiod@end ifset
62223d8817e4Smiod@ifset M32C
62233d8817e4Smiod* M32C-Dependent::              M32C Dependent Features
62243d8817e4Smiod@end ifset
62253d8817e4Smiod@ifset M32R
62263d8817e4Smiod* M32R-Dependent::              M32R Dependent Features
62273d8817e4Smiod@end ifset
62283d8817e4Smiod@ifset M680X0
62293d8817e4Smiod* M68K-Dependent::              M680x0 Dependent Features
62303d8817e4Smiod@end ifset
62313d8817e4Smiod@ifset M68HC11
62323d8817e4Smiod* M68HC11-Dependent::           M68HC11 and 68HC12 Dependent Features
62333d8817e4Smiod@end ifset
62343d8817e4Smiod@ifset MIPS
62353d8817e4Smiod* MIPS-Dependent::              MIPS Dependent Features
62363d8817e4Smiod@end ifset
62373d8817e4Smiod@ifset MMIX
62383d8817e4Smiod* MMIX-Dependent::              MMIX Dependent Features
62393d8817e4Smiod@end ifset
62403d8817e4Smiod@ifset MSP430
62413d8817e4Smiod* MSP430-Dependent::		MSP430 Dependent Features
62423d8817e4Smiod@end ifset
62433d8817e4Smiod@ifset SH
62443d8817e4Smiod* SH-Dependent::                Renesas / SuperH SH Dependent Features
62453d8817e4Smiod* SH64-Dependent::              SuperH SH64 Dependent Features
62463d8817e4Smiod@end ifset
62473d8817e4Smiod@ifset PDP11
62483d8817e4Smiod* PDP-11-Dependent::            PDP-11 Dependent Features
62493d8817e4Smiod@end ifset
62503d8817e4Smiod@ifset PJ
62513d8817e4Smiod* PJ-Dependent::                picoJava Dependent Features
62523d8817e4Smiod@end ifset
62533d8817e4Smiod@ifset PPC
62543d8817e4Smiod* PPC-Dependent::               PowerPC Dependent Features
62553d8817e4Smiod@end ifset
62563d8817e4Smiod@ifset SPARC
62573d8817e4Smiod* Sparc-Dependent::             SPARC Dependent Features
62583d8817e4Smiod@end ifset
62593d8817e4Smiod@ifset TIC54X
62603d8817e4Smiod* TIC54X-Dependent::            TI TMS320C54x Dependent Features
62613d8817e4Smiod@end ifset
62623d8817e4Smiod@ifset V850
62633d8817e4Smiod* V850-Dependent::              V850 Dependent Features
62643d8817e4Smiod@end ifset
62653d8817e4Smiod@ifset XTENSA
62663d8817e4Smiod* Xtensa-Dependent::            Xtensa Dependent Features
62673d8817e4Smiod@end ifset
62683d8817e4Smiod@ifset Z80
62693d8817e4Smiod* Z80-Dependent::               Z80 Dependent Features
62703d8817e4Smiod@end ifset
62713d8817e4Smiod@ifset Z8000
62723d8817e4Smiod* Z8000-Dependent::             Z8000 Dependent Features
62733d8817e4Smiod@end ifset
62743d8817e4Smiod@ifset VAX
62753d8817e4Smiod* Vax-Dependent::               VAX Dependent Features
62763d8817e4Smiod@end ifset
62773d8817e4Smiod@end menu
62783d8817e4Smiod
62793d8817e4Smiod@lowersections
62803d8817e4Smiod@end ifset
62813d8817e4Smiod
62823d8817e4Smiod@c The following major nodes are *sections* in the GENERIC version, *chapters*
62833d8817e4Smiod@c in single-cpu versions.  This is mainly achieved by @lowersections.  There is a
62843d8817e4Smiod@c peculiarity: to preserve cross-references, there must be a node called
62853d8817e4Smiod@c "Machine Dependencies".  Hence the conditional nodenames in each
62863d8817e4Smiod@c major node below.  Node defaulting in makeinfo requires adjacency of
62873d8817e4Smiod@c node and sectioning commands; hence the repetition of @chapter BLAH
62883d8817e4Smiod@c in both conditional blocks.
62893d8817e4Smiod
62903d8817e4Smiod@ifset ALPHA
62913d8817e4Smiod@include c-alpha.texi
62923d8817e4Smiod@end ifset
62933d8817e4Smiod
62943d8817e4Smiod@ifset ARC
62953d8817e4Smiod@include c-arc.texi
62963d8817e4Smiod@end ifset
62973d8817e4Smiod
62983d8817e4Smiod@ifset ARM
62993d8817e4Smiod@include c-arm.texi
63003d8817e4Smiod@end ifset
63013d8817e4Smiod
63023d8817e4Smiod@ifset BFIN
63033d8817e4Smiod@include c-bfin.texi
63043d8817e4Smiod@end ifset
63053d8817e4Smiod
63063d8817e4Smiod@ifset CRIS
63073d8817e4Smiod@include c-cris.texi
63083d8817e4Smiod@end ifset
63093d8817e4Smiod
63103d8817e4Smiod@ifset Renesas-all
63113d8817e4Smiod@ifclear GENERIC
63123d8817e4Smiod@node Machine Dependencies
63133d8817e4Smiod@chapter Machine Dependent Features
63143d8817e4Smiod
63153d8817e4SmiodThe machine instruction sets are different on each Renesas chip family,
63163d8817e4Smiodand there are also some syntax differences among the families.  This
63173d8817e4Smiodchapter describes the specific @command{@value{AS}} features for each
63183d8817e4Smiodfamily.
63193d8817e4Smiod
63203d8817e4Smiod@menu
63213d8817e4Smiod* H8/300-Dependent::            Renesas H8/300 Dependent Features
63223d8817e4Smiod* SH-Dependent::                Renesas SH Dependent Features
63233d8817e4Smiod@end menu
63243d8817e4Smiod@lowersections
63253d8817e4Smiod@end ifclear
63263d8817e4Smiod@end ifset
63273d8817e4Smiod
63283d8817e4Smiod@ifset D10V
63293d8817e4Smiod@include c-d10v.texi
63303d8817e4Smiod@end ifset
63313d8817e4Smiod
63323d8817e4Smiod@ifset D30V
63333d8817e4Smiod@include c-d30v.texi
63343d8817e4Smiod@end ifset
63353d8817e4Smiod
63363d8817e4Smiod@ifset H8/300
63373d8817e4Smiod@include c-h8300.texi
63383d8817e4Smiod@end ifset
63393d8817e4Smiod
63403d8817e4Smiod@ifset HPPA
63413d8817e4Smiod@include c-hppa.texi
63423d8817e4Smiod@end ifset
63433d8817e4Smiod
63443d8817e4Smiod@ifset I370
63453d8817e4Smiod@include c-i370.texi
63463d8817e4Smiod@end ifset
63473d8817e4Smiod
63483d8817e4Smiod@ifset I80386
63493d8817e4Smiod@include c-i386.texi
63503d8817e4Smiod@end ifset
63513d8817e4Smiod
63523d8817e4Smiod@ifset I860
63533d8817e4Smiod@include c-i860.texi
63543d8817e4Smiod@end ifset
63553d8817e4Smiod
63563d8817e4Smiod@ifset I960
63573d8817e4Smiod@include c-i960.texi
63583d8817e4Smiod@end ifset
63593d8817e4Smiod
63603d8817e4Smiod@ifset IA64
63613d8817e4Smiod@include c-ia64.texi
63623d8817e4Smiod@end ifset
63633d8817e4Smiod
63643d8817e4Smiod@ifset IP2K
63653d8817e4Smiod@include c-ip2k.texi
63663d8817e4Smiod@end ifset
63673d8817e4Smiod
63683d8817e4Smiod@ifset M32C
63693d8817e4Smiod@include c-m32c.texi
63703d8817e4Smiod@end ifset
63713d8817e4Smiod
63723d8817e4Smiod@ifset M32R
63733d8817e4Smiod@include c-m32r.texi
63743d8817e4Smiod@end ifset
63753d8817e4Smiod
63763d8817e4Smiod@ifset M680X0
63773d8817e4Smiod@include c-m68k.texi
63783d8817e4Smiod@end ifset
63793d8817e4Smiod
63803d8817e4Smiod@ifset M68HC11
63813d8817e4Smiod@include c-m68hc11.texi
63823d8817e4Smiod@end ifset
63833d8817e4Smiod
63843d8817e4Smiod@ifset MIPS
63853d8817e4Smiod@include c-mips.texi
63863d8817e4Smiod@end ifset
63873d8817e4Smiod
63883d8817e4Smiod@ifset MMIX
63893d8817e4Smiod@include c-mmix.texi
63903d8817e4Smiod@end ifset
63913d8817e4Smiod
63923d8817e4Smiod@ifset MSP430
63933d8817e4Smiod@include c-msp430.texi
63943d8817e4Smiod@end ifset
63953d8817e4Smiod
63963d8817e4Smiod@ifset NS32K
63973d8817e4Smiod@include c-ns32k.texi
63983d8817e4Smiod@end ifset
63993d8817e4Smiod
64003d8817e4Smiod@ifset PDP11
64013d8817e4Smiod@include c-pdp11.texi
64023d8817e4Smiod@end ifset
64033d8817e4Smiod
64043d8817e4Smiod@ifset PJ
64053d8817e4Smiod@include c-pj.texi
64063d8817e4Smiod@end ifset
64073d8817e4Smiod
64083d8817e4Smiod@ifset PPC
64093d8817e4Smiod@include c-ppc.texi
64103d8817e4Smiod@end ifset
64113d8817e4Smiod
64123d8817e4Smiod@ifset SH
64133d8817e4Smiod@include c-sh.texi
64143d8817e4Smiod@include c-sh64.texi
64153d8817e4Smiod@end ifset
64163d8817e4Smiod
64173d8817e4Smiod@ifset SPARC
64183d8817e4Smiod@include c-sparc.texi
64193d8817e4Smiod@end ifset
64203d8817e4Smiod
64213d8817e4Smiod@ifset TIC54X
64223d8817e4Smiod@include c-tic54x.texi
64233d8817e4Smiod@end ifset
64243d8817e4Smiod
64253d8817e4Smiod@ifset Z80
64263d8817e4Smiod@include c-z80.texi
64273d8817e4Smiod@end ifset
64283d8817e4Smiod
64293d8817e4Smiod@ifset Z8000
64303d8817e4Smiod@include c-z8k.texi
64313d8817e4Smiod@end ifset
64323d8817e4Smiod
64333d8817e4Smiod@ifset VAX
64343d8817e4Smiod@include c-vax.texi
64353d8817e4Smiod@end ifset
64363d8817e4Smiod
64373d8817e4Smiod@ifset V850
64383d8817e4Smiod@include c-v850.texi
64393d8817e4Smiod@end ifset
64403d8817e4Smiod
64413d8817e4Smiod@ifset XTENSA
64423d8817e4Smiod@include c-xtensa.texi
64433d8817e4Smiod@end ifset
64443d8817e4Smiod
64453d8817e4Smiod@ifset GENERIC
64463d8817e4Smiod@c reverse effect of @down at top of generic Machine-Dep chapter
64473d8817e4Smiod@raisesections
64483d8817e4Smiod@end ifset
64493d8817e4Smiod
64503d8817e4Smiod@node Reporting Bugs
64513d8817e4Smiod@chapter Reporting Bugs
64523d8817e4Smiod@cindex bugs in assembler
64533d8817e4Smiod@cindex reporting bugs in assembler
64543d8817e4Smiod
64553d8817e4SmiodYour bug reports play an essential role in making @command{@value{AS}} reliable.
64563d8817e4Smiod
64573d8817e4SmiodReporting a bug may help you by bringing a solution to your problem, or it may
64583d8817e4Smiodnot.  But in any case the principal function of a bug report is to help the
64593d8817e4Smiodentire community by making the next version of @command{@value{AS}} work better.
64603d8817e4SmiodBug reports are your contribution to the maintenance of @command{@value{AS}}.
64613d8817e4Smiod
64623d8817e4SmiodIn order for a bug report to serve its purpose, you must include the
64633d8817e4Smiodinformation that enables us to fix the bug.
64643d8817e4Smiod
64653d8817e4Smiod@menu
64663d8817e4Smiod* Bug Criteria::                Have you found a bug?
64673d8817e4Smiod* Bug Reporting::               How to report bugs
64683d8817e4Smiod@end menu
64693d8817e4Smiod
64703d8817e4Smiod@node Bug Criteria
64713d8817e4Smiod@section Have You Found a Bug?
64723d8817e4Smiod@cindex bug criteria
64733d8817e4Smiod
64743d8817e4SmiodIf you are not sure whether you have found a bug, here are some guidelines:
64753d8817e4Smiod
64763d8817e4Smiod@itemize @bullet
64773d8817e4Smiod@cindex fatal signal
64783d8817e4Smiod@cindex assembler crash
64793d8817e4Smiod@cindex crash of assembler
64803d8817e4Smiod@item
64813d8817e4SmiodIf the assembler gets a fatal signal, for any input whatever, that is a
64823d8817e4Smiod@command{@value{AS}} bug.  Reliable assemblers never crash.
64833d8817e4Smiod
64843d8817e4Smiod@cindex error on valid input
64853d8817e4Smiod@item
64863d8817e4SmiodIf @command{@value{AS}} produces an error message for valid input, that is a bug.
64873d8817e4Smiod
64883d8817e4Smiod@cindex invalid input
64893d8817e4Smiod@item
64903d8817e4SmiodIf @command{@value{AS}} does not produce an error message for invalid input, that
64913d8817e4Smiodis a bug.  However, you should note that your idea of ``invalid input'' might
64923d8817e4Smiodbe our idea of ``an extension'' or ``support for traditional practice''.
64933d8817e4Smiod
64943d8817e4Smiod@item
64953d8817e4SmiodIf you are an experienced user of assemblers, your suggestions for improvement
64963d8817e4Smiodof @command{@value{AS}} are welcome in any case.
64973d8817e4Smiod@end itemize
64983d8817e4Smiod
64993d8817e4Smiod@node Bug Reporting
65003d8817e4Smiod@section How to Report Bugs
65013d8817e4Smiod@cindex bug reports
65023d8817e4Smiod@cindex assembler bugs, reporting
65033d8817e4Smiod
65043d8817e4SmiodA number of companies and individuals offer support for @sc{gnu} products.  If
65053d8817e4Smiodyou obtained @command{@value{AS}} from a support organization, we recommend you
65063d8817e4Smiodcontact that organization first.
65073d8817e4Smiod
65083d8817e4SmiodYou can find contact information for many support companies and
65093d8817e4Smiodindividuals in the file @file{etc/SERVICE} in the @sc{gnu} Emacs
65103d8817e4Smioddistribution.
65113d8817e4Smiod
65123d8817e4SmiodIn any event, we also recommend that you send bug reports for @command{@value{AS}}
65133d8817e4Smiodto @samp{bug-binutils@@gnu.org}.
65143d8817e4Smiod
65153d8817e4SmiodThe fundamental principle of reporting bugs usefully is this:
65163d8817e4Smiod@strong{report all the facts}.  If you are not sure whether to state a
65173d8817e4Smiodfact or leave it out, state it!
65183d8817e4Smiod
65193d8817e4SmiodOften people omit facts because they think they know what causes the problem
65203d8817e4Smiodand assume that some details do not matter.  Thus, you might assume that the
65213d8817e4Smiodname of a symbol you use in an example does not matter.  Well, probably it does
65223d8817e4Smiodnot, but one cannot be sure.  Perhaps the bug is a stray memory reference which
65233d8817e4Smiodhappens to fetch from the location where that name is stored in memory;
65243d8817e4Smiodperhaps, if the name were different, the contents of that location would fool
65253d8817e4Smiodthe assembler into doing the right thing despite the bug.  Play it safe and
65263d8817e4Smiodgive a specific, complete example.  That is the easiest thing for you to do,
65273d8817e4Smiodand the most helpful.
65283d8817e4Smiod
65293d8817e4SmiodKeep in mind that the purpose of a bug report is to enable us to fix the bug if
65303d8817e4Smiodit is new to us.  Therefore, always write your bug reports on the assumption
65313d8817e4Smiodthat the bug has not been reported previously.
65323d8817e4Smiod
65333d8817e4SmiodSometimes people give a few sketchy facts and ask, ``Does this ring a
65343d8817e4Smiodbell?''  This cannot help us fix a bug, so it is basically useless.  We
65353d8817e4Smiodrespond by asking for enough details to enable us to investigate.
65363d8817e4SmiodYou might as well expedite matters by sending them to begin with.
65373d8817e4Smiod
65383d8817e4SmiodTo enable us to fix the bug, you should include all these things:
65393d8817e4Smiod
65403d8817e4Smiod@itemize @bullet
65413d8817e4Smiod@item
65423d8817e4SmiodThe version of @command{@value{AS}}.  @command{@value{AS}} announces it if you start
65433d8817e4Smiodit with the @samp{--version} argument.
65443d8817e4Smiod
65453d8817e4SmiodWithout this, we will not know whether there is any point in looking for
65463d8817e4Smiodthe bug in the current version of @command{@value{AS}}.
65473d8817e4Smiod
65483d8817e4Smiod@item
65493d8817e4SmiodAny patches you may have applied to the @command{@value{AS}} source.
65503d8817e4Smiod
65513d8817e4Smiod@item
65523d8817e4SmiodThe type of machine you are using, and the operating system name and
65533d8817e4Smiodversion number.
65543d8817e4Smiod
65553d8817e4Smiod@item
65563d8817e4SmiodWhat compiler (and its version) was used to compile @command{@value{AS}}---e.g.
65573d8817e4Smiod``@code{gcc-2.7}''.
65583d8817e4Smiod
65593d8817e4Smiod@item
65603d8817e4SmiodThe command arguments you gave the assembler to assemble your example and
65613d8817e4Smiodobserve the bug.  To guarantee you will not omit something important, list them
65623d8817e4Smiodall.  A copy of the Makefile (or the output from make) is sufficient.
65633d8817e4Smiod
65643d8817e4SmiodIf we were to try to guess the arguments, we would probably guess wrong
65653d8817e4Smiodand then we might not encounter the bug.
65663d8817e4Smiod
65673d8817e4Smiod@item
65683d8817e4SmiodA complete input file that will reproduce the bug.  If the bug is observed when
65693d8817e4Smiodthe assembler is invoked via a compiler, send the assembler source, not the
65703d8817e4Smiodhigh level language source.  Most compilers will produce the assembler source
65713d8817e4Smiodwhen run with the @samp{-S} option.  If you are using @code{@value{GCC}}, use
65723d8817e4Smiodthe options @samp{-v --save-temps}; this will save the assembler source in a
65733d8817e4Smiodfile with an extension of @file{.s}, and also show you exactly how
65743d8817e4Smiod@command{@value{AS}} is being run.
65753d8817e4Smiod
65763d8817e4Smiod@item
65773d8817e4SmiodA description of what behavior you observe that you believe is
65783d8817e4Smiodincorrect.  For example, ``It gets a fatal signal.''
65793d8817e4Smiod
65803d8817e4SmiodOf course, if the bug is that @command{@value{AS}} gets a fatal signal, then we
65813d8817e4Smiodwill certainly notice it.  But if the bug is incorrect output, we might not
65823d8817e4Smiodnotice unless it is glaringly wrong.  You might as well not give us a chance to
65833d8817e4Smiodmake a mistake.
65843d8817e4Smiod
65853d8817e4SmiodEven if the problem you experience is a fatal signal, you should still say so
65863d8817e4Smiodexplicitly.  Suppose something strange is going on, such as, your copy of
65873d8817e4Smiod@command{@value{AS}} is out of synch, or you have encountered a bug in the C
65883d8817e4Smiodlibrary on your system.  (This has happened!)  Your copy might crash and ours
65893d8817e4Smiodwould not.  If you told us to expect a crash, then when ours fails to crash, we
65903d8817e4Smiodwould know that the bug was not happening for us.  If you had not told us to
65913d8817e4Smiodexpect a crash, then we would not be able to draw any conclusion from our
65923d8817e4Smiodobservations.
65933d8817e4Smiod
65943d8817e4Smiod@item
65953d8817e4SmiodIf you wish to suggest changes to the @command{@value{AS}} source, send us context
65963d8817e4Smioddiffs, as generated by @code{diff} with the @samp{-u}, @samp{-c}, or @samp{-p}
65973d8817e4Smiodoption.  Always send diffs from the old file to the new file.  If you even
65983d8817e4Smioddiscuss something in the @command{@value{AS}} source, refer to it by context, not
65993d8817e4Smiodby line number.
66003d8817e4Smiod
66013d8817e4SmiodThe line numbers in our development sources will not match those in your
66023d8817e4Smiodsources.  Your line numbers would convey no useful information to us.
66033d8817e4Smiod@end itemize
66043d8817e4Smiod
66053d8817e4SmiodHere are some things that are not necessary:
66063d8817e4Smiod
66073d8817e4Smiod@itemize @bullet
66083d8817e4Smiod@item
66093d8817e4SmiodA description of the envelope of the bug.
66103d8817e4Smiod
66113d8817e4SmiodOften people who encounter a bug spend a lot of time investigating
66123d8817e4Smiodwhich changes to the input file will make the bug go away and which
66133d8817e4Smiodchanges will not affect it.
66143d8817e4Smiod
66153d8817e4SmiodThis is often time consuming and not very useful, because the way we
66163d8817e4Smiodwill find the bug is by running a single example under the debugger
66173d8817e4Smiodwith breakpoints, not by pure deduction from a series of examples.
66183d8817e4SmiodWe recommend that you save your time for something else.
66193d8817e4Smiod
66203d8817e4SmiodOf course, if you can find a simpler example to report @emph{instead}
66213d8817e4Smiodof the original one, that is a convenience for us.  Errors in the
66223d8817e4Smiodoutput will be easier to spot, running under the debugger will take
66233d8817e4Smiodless time, and so on.
66243d8817e4Smiod
66253d8817e4SmiodHowever, simplification is not vital; if you do not want to do this,
66263d8817e4Smiodreport the bug anyway and send us the entire test case you used.
66273d8817e4Smiod
66283d8817e4Smiod@item
66293d8817e4SmiodA patch for the bug.
66303d8817e4Smiod
66313d8817e4SmiodA patch for the bug does help us if it is a good one.  But do not omit
66323d8817e4Smiodthe necessary information, such as the test case, on the assumption that
66333d8817e4Smioda patch is all we need.  We might see problems with your patch and decide
66343d8817e4Smiodto fix the problem another way, or we might not understand it at all.
66353d8817e4Smiod
66363d8817e4SmiodSometimes with a program as complicated as @command{@value{AS}} it is very hard to
66373d8817e4Smiodconstruct an example that will make the program follow a certain path through
66383d8817e4Smiodthe code.  If you do not send us the example, we will not be able to construct
66393d8817e4Smiodone, so we will not be able to verify that the bug is fixed.
66403d8817e4Smiod
66413d8817e4SmiodAnd if we cannot understand what bug you are trying to fix, or why your
66423d8817e4Smiodpatch should be an improvement, we will not install it.  A test case will
66433d8817e4Smiodhelp us to understand.
66443d8817e4Smiod
66453d8817e4Smiod@item
66463d8817e4SmiodA guess about what the bug is or what it depends on.
66473d8817e4Smiod
66483d8817e4SmiodSuch guesses are usually wrong.  Even we cannot guess right about such
66493d8817e4Smiodthings without first using the debugger to find the facts.
66503d8817e4Smiod@end itemize
66513d8817e4Smiod
66523d8817e4Smiod@node Acknowledgements
66533d8817e4Smiod@chapter Acknowledgements
66543d8817e4Smiod
66553d8817e4SmiodIf you have contributed to GAS and your name isn't listed here,
66563d8817e4Smiodit is not meant as a slight.  We just don't know about it.  Send mail to the
66573d8817e4Smiodmaintainer, and we'll correct the situation.  Currently
66583d8817e4Smiod@c (January 1994),
66593d8817e4Smiodthe maintainer is Ken Raeburn (email address @code{raeburn@@cygnus.com}).
66603d8817e4Smiod
66613d8817e4SmiodDean Elsner wrote the original @sc{gnu} assembler for the VAX.@footnote{Any
66623d8817e4Smiodmore details?}
66633d8817e4Smiod
66643d8817e4SmiodJay Fenlason maintained GAS for a while, adding support for GDB-specific debug
66653d8817e4Smiodinformation and the 68k series machines, most of the preprocessing pass, and
66663d8817e4Smiodextensive changes in @file{messages.c}, @file{input-file.c}, @file{write.c}.
66673d8817e4Smiod
66683d8817e4SmiodK. Richard Pixley maintained GAS for a while, adding various enhancements and
66693d8817e4Smiodmany bug fixes, including merging support for several processors, breaking GAS
66703d8817e4Smiodup to handle multiple object file format back ends (including heavy rewrite,
66713d8817e4Smiodtesting, an integration of the coff and b.out back ends), adding configuration
66723d8817e4Smiodincluding heavy testing and verification of cross assemblers and file splits
66733d8817e4Smiodand renaming, converted GAS to strictly ANSI C including full prototypes, added
66743d8817e4Smiodsupport for m680[34]0 and cpu32, did considerable work on i960 including a COFF
66753d8817e4Smiodport (including considerable amounts of reverse engineering), a SPARC opcode
66763d8817e4Smiodfile rewrite, DECstation, rs6000, and hp300hpux host ports, updated ``know''
66773d8817e4Smiodassertions and made them work, much other reorganization, cleanup, and lint.
66783d8817e4Smiod
66793d8817e4SmiodKen Raeburn wrote the high-level BFD interface code to replace most of the code
66803d8817e4Smiodin format-specific I/O modules.
66813d8817e4Smiod
66823d8817e4SmiodThe original VMS support was contributed by David L. Kashtan.  Eric Youngdale
66833d8817e4Smiodhas done much work with it since.
66843d8817e4Smiod
66853d8817e4SmiodThe Intel 80386 machine description was written by Eliot Dresselhaus.
66863d8817e4Smiod
66873d8817e4SmiodMinh Tran-Le at IntelliCorp contributed some AIX 386 support.
66883d8817e4Smiod
66893d8817e4SmiodThe Motorola 88k machine description was contributed by Devon Bowen of Buffalo
66903d8817e4SmiodUniversity and Torbjorn Granlund of the Swedish Institute of Computer Science.
66913d8817e4Smiod
66923d8817e4SmiodKeith Knowles at the Open Software Foundation wrote the original MIPS back end
66933d8817e4Smiod(@file{tc-mips.c}, @file{tc-mips.h}), and contributed Rose format support
66943d8817e4Smiod(which hasn't been merged in yet).  Ralph Campbell worked with the MIPS code to
66953d8817e4Smiodsupport a.out format.
66963d8817e4Smiod
66973d8817e4SmiodSupport for the Zilog Z8k and Renesas H8/300 processors (tc-z8k,
66983d8817e4Smiodtc-h8300), and IEEE 695 object file format (obj-ieee), was written by
66993d8817e4SmiodSteve Chamberlain of Cygnus Support.  Steve also modified the COFF back end to
67003d8817e4Smioduse BFD for some low-level operations, for use with the H8/300 and AMD 29k
67013d8817e4Smiodtargets.
67023d8817e4Smiod
67033d8817e4SmiodJohn Gilmore built the AMD 29000 support, added @code{.include} support, and
67043d8817e4Smiodsimplified the configuration of which versions accept which directives.  He
67053d8817e4Smiodupdated the 68k machine description so that Motorola's opcodes always produced
67063d8817e4Smiodfixed-size instructions (e.g., @code{jsr}), while synthetic instructions
67073d8817e4Smiodremained shrinkable (@code{jbsr}).  John fixed many bugs, including true tested
67083d8817e4Smiodcross-compilation support, and one bug in relaxation that took a week and
67093d8817e4Smiodrequired the proverbial one-bit fix.
67103d8817e4Smiod
67113d8817e4SmiodIan Lance Taylor of Cygnus Support merged the Motorola and MIT syntax for the
67123d8817e4Smiod68k, completed support for some COFF targets (68k, i386 SVR3, and SCO Unix),
67133d8817e4Smiodadded support for MIPS ECOFF and ELF targets, wrote the initial RS/6000 and
67143d8817e4SmiodPowerPC assembler, and made a few other minor patches.
67153d8817e4Smiod
67163d8817e4SmiodSteve Chamberlain made GAS able to generate listings.
67173d8817e4Smiod
67183d8817e4SmiodHewlett-Packard contributed support for the HP9000/300.
67193d8817e4Smiod
67203d8817e4SmiodJeff Law wrote GAS and BFD support for the native HPPA object format (SOM)
67213d8817e4Smiodalong with a fairly extensive HPPA testsuite (for both SOM and ELF object
67223d8817e4Smiodformats).  This work was supported by both the Center for Software Science at
67233d8817e4Smiodthe University of Utah and Cygnus Support.
67243d8817e4Smiod
67253d8817e4SmiodSupport for ELF format files has been worked on by Mark Eichin of Cygnus
67263d8817e4SmiodSupport (original, incomplete implementation for SPARC), Pete Hoogenboom and
67273d8817e4SmiodJeff Law at the University of Utah (HPPA mainly), Michael Meissner of the Open
67283d8817e4SmiodSoftware Foundation (i386 mainly), and Ken Raeburn of Cygnus Support (sparc,
67293d8817e4Smiodand some initial 64-bit support).
67303d8817e4Smiod
67313d8817e4SmiodLinas Vepstas added GAS support for the ESA/390 ``IBM 370'' architecture.
67323d8817e4Smiod
67333d8817e4SmiodRichard Henderson rewrote the Alpha assembler. Klaus Kaempf wrote GAS and BFD
67343d8817e4Smiodsupport for openVMS/Alpha.
67353d8817e4Smiod
67363d8817e4SmiodTimothy Wall, Michael Hayes, and Greg Smart contributed to the various tic*
67373d8817e4Smiodflavors.
67383d8817e4Smiod
67393d8817e4SmiodDavid Heine, Sterling Augustine, Bob Wilson and John Ruttenberg from Tensilica,
67403d8817e4SmiodInc. added support for Xtensa processors.
67413d8817e4Smiod
67423d8817e4SmiodSeveral engineers at Cygnus Support have also provided many small bug fixes and
67433d8817e4Smiodconfiguration enhancements.
67443d8817e4Smiod
67453d8817e4SmiodMany others have contributed large or small bugfixes and enhancements.  If
67463d8817e4Smiodyou have contributed significant work and are not mentioned on this list, and
67473d8817e4Smiodwant to be, let us know.  Some of the history has been lost; we are not
67483d8817e4Smiodintentionally leaving anyone out.
67493d8817e4Smiod
67503d8817e4Smiod@include fdl.texi
67513d8817e4Smiod
67523d8817e4Smiod@node Index
67533d8817e4Smiod@unnumbered Index
67543d8817e4Smiod
67553d8817e4Smiod@printindex cp
67563d8817e4Smiod
67573d8817e4Smiod@contents
67583d8817e4Smiod@bye
67593d8817e4Smiod@c Local Variables:
67603d8817e4Smiod@c fill-column: 79
67613d8817e4Smiod@c End:
6762