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