Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
as(1)
Edit
PageHistory
Diff
Info
LikePages
AS !!!AS NAME SYNOPSIS DESCRIPTION OPTIONS SEE ALSO COPYRIGHT ---- !!NAME AS - the portable GNU assembler. !!SYNOPSIS as [[__-a__[[__cdhlns__][[=''file'']] [[__-D__] [[__--defsym__ ''sym''=''val''] [[__-f__] [[__--gstabs__] [[__--gdwarf2__] [[__--help__] [[__-I__ ''dir''] [[__-J__] [[__-K__] [[__-L__] [[__--listing-lhs-width__= ''NUM'' ] [[__--listing-lhs-width2__= ''NUM'' ] [[__--listing-rhs-width__= ''NUM'' ] [[__--listing-cont-lines__= ''NUM'' ] [[__--keep-locals__] [[__-o__ ''objfile''] [[__-R__] [[__--statistics__] [[__-v__] [[__-version__] [[__--version__] [[__-W__] [[__--warn__] [[__--fatal-warnings__] [[__-w__] [[__-x__] [[__-Z__] [[__--target-help__] [[''target-options''] [[__--__''files'' ...] ''Target Alpha options:'' [[__-m__''cpu''] [[__-mdebug -no-mdebug__] [[__-relax__] [[__-g__] [[__-G__''size''] [[__-F__] [[__-32addr__] ''Target'' ''ARC options:'' [[__-marc[[5678]__] [[__-EB-EL__] ''Target'' ''ARM options:'' [[__-mcpu__=''processor''[[+''extension''...]] [[__-march__=''architecture''[[+''extension''...]] [[__-mfpu__=''floating-point-fromat''] [[__-mthumb__] [[__-EB-EL__] [[__-mapcs-32-mapcs-26-mapcs-float -mapcs-reentrant__] [[__-mthumb-interwork__] [[__-moabi__] [[__-k__] ''Target'' ''CRIS options:'' [[__--underscore --no-underscore__] [[__--pic__] [[__-N__] [[__--emulation=criself --emulation=crisaout__] ''Target D10V options:'' [[__-O__] ''Target D30V options:'' [[__-O-n-N__] ''Target i386 options:'' [[__--32--64__] ''Target i960 options:'' [[__-ACA-ACA_A-ACB-ACC-AKA-AKB -AKC-AMC__] [[__-b__] [[__-no-relax__] ''Target M32R options:'' [[__--m32rx--[[no-]warn-explicit-parallel-conflicts --W[[n]p__] ''Target M680X0 options:'' [[__-l__] [[__-m68000-m68010-m68020__...] ''Target M68HC11 options:'' [[__-m68hc11-m68hc12__] [[__--force-long-branchs__] [[__--short-branchs__] [[__--strict-direct-mode__] [[__--print-insn-syntax__] [[__--print-opcodes__] [[__--generate-example__] ''Target'' ''MCORE options:'' [[__-jsri2bsr__] [[__-sifilter__] [[__-relax__] [[__-mcpu=[[210340]__] ''Target'' ''MIPS options:'' [[__-nocpp__] [[__-EL__] [[__-EB__] [[__-G__ ''num''] [[__-mcpu__= ''CPU'' ] [[__-mips1__] [[__-mips2__] [[__-mips3__] [[__-mips4__] [[__-mips5__] [[__-mips32__] [[__-mips64__] [[__-m4650__] [[__-no-m4650__] [[__--trap__] [[__--break__] [[__-n__] [[__--emulation__=''name'' ] ''Target'' ''MMIX options:'' [[__--fixed-special-register-names__] [[__--globalize-symbols__] [[__--gnu-syntax__] [[__--relax__] [[__--no-predefined-symbols__] [[__--no-expand__] [[__--no-merge-gregs__] [[__-x__] [[__--linker-allocated-gregs__] ''Target'' ''PDP11 options:'' [[__-mpic-mno-pic__] [[__-mall__] [[__-mno-extensions__] [[__-m__''extension''__-mno-__''extension''] [[__-m__''cpu''] [[__-m__''machine''] ''Target picoJava options:'' [[__-mb-me__] ''Target PowerPC options:'' [[__-mpwrx-mpwr2-mpwr-m601-mppc-mppc32-m603-m604 -m403-m405-mppc64-m620-mppc64bridge-mbooke -mbooke32-mbooke64__] [[__-mcom-many-maltivec__] [[__-memb__] [[__-mregnames-mno-regnames__] [[__-mrelocatable-mrelocatable-lib__] [[__-mlittle-mlittle-endian-mbig-mbig-endian__] [[__-msolaris-mno-solaris__] ''Target'' ''SPARC options:'' [[__-Av6-Av7-Av8-Asparclet-Asparclite -Av8plus-Av8plusa-Av9-Av9a__] [[__-xarch=v8plus-xarch=v8plusa__] [[__-bump__] [[__-32-64__] !!DESCRIPTION GNU __as__ is really a family of assemblers. If you use (or have used) the GNU assembler on one architecture, you should find a fairly similar environment when you use it on another architecture. Each version has much in common with the others, including object file formats, most assembler directives (often called ''pseudo-ops'') and assembler syntax. __as__ is primarily intended to assemble the output of the GNU C compiler for use by the linker . Nevertheless, we've tried to make __as__ assemble correctly everything that other assemblers for the same machine would assemble. Any exceptions are documented explicitly. This doesn't mean __as__ always uses the same syntax as another assembler for the same architecture; for example, we know of several incompatible versions of 680x0 assembly language syntax. Each time you run __as__ it assembles exactly one source program. The source program is made up of one or more files. (The standard input is also a file.) You give __as__ a command line that has zero or more input file names. The input files are read (from left file name to right). A command line argument (in any position) that has no special meaning is taken to be an input file name. If you give __as__ no file names it attempts to read one input file from the __as__ standard input, which is normally your terminal. You may have to type __ctl-D__ to tell __as__ there is no more program to assemble. Use __--__ if you need to explicitly name the standard input file in your command line. If the source is empty, __as__ produces a small, empty object file. __as__ may write warnings and error messages to the standard error file (usually your terminal). This should not happen when a compiler runs __as__ automatically. Warnings report an assumption made so that __as__ could keep assembling a flawed program; errors report a grave problem that stops the assembly. If you are invoking __as__ via the GNU C compiler (version 2), you can use the __-Wa__ option to pass arguments through to the assembler. The assembler arguments must be separated from each other (and the __-Wa__) by commas. For example: gcc -c -g -O -Wa,-alh,-L file.c This passes two options to the assembler: __-alh__ (emit a listing to standard output with with high-level and assembly source) and __-L__ (retain local symbols in the symbol table). Usually you do not need to use this __-Wa__ mechanism, since many compiler command-line options are automatically passed to the assembler by the compiler. (You can call the GNU compiler driver with the __-v__ option to see precisely what options it passes to each compilation pass, including the assembler.) !!OPTIONS __-a[[cdhlmns]__ Turn on listings, in any of a variety of ways: __-ac__ omit false conditionals __-ad__ omit debugging directives __-ah__ include high-level source __-al__ include assembly __-am__ include macro expansions __-an__ omit forms processing __-as__ include symbols __=file__ set the name of the listing file You may combine these options; for example, use __-aln__ for assembly listing without forms processing. The __=file__ option, if used, must be the last one. By itself, __-a__ defaults to __-ahls__. __-D__ Ignored. This option is accepted for script compatibility with calls to other assemblers. __--defsym__ ''sym''__=__''value'' Define the symbol ''sym'' to be ''value'' before assembling the input file. ''value'' must be an integer constant. As in C, a leading __0x__ indicates a hexadecimal value, and a leading __0__ indicates an octal value. __-f__ ``fast''---skip whitespace and comment preprocessing (assume source is compiler output). __--gstabs__ Generate stabs debugging information for each assembler line. This may help debugging assembler code, if the debugger can handle it. __--gdwarf2__ Generate DWARF2 debugging information for each assembler line. This may help debugging assembler code, if the debugger can handle it. Note - this option is only supported by some targets, not all of them. __--help__ Print a summary of the command line options and exit. __--target-help__ Print a summary of all target specific options and exit. __-I__ ''dir'' Add directory ''dir'' to the search list for .include directives. __-J__ Don't warn about signed overflow. __-K__ This option is accepted but has no effect on the TARGET family. __-L__ __--keep-locals__ Keep (in the symbol table) local symbols. On traditional a.out systems these start with __L__, but different systems have different local label prefixes. __--listing-lhs-width=__''number'' Set the maximum width, in words, of the output data column for an assembler listing to ''number''. __--listing-lhs-width2=__''number'' Set the maximum width, in words, of the output data column for continuation lines in an assembler listing to ''number''. __--listing-rhs-width=__''number'' Set the maximum width of an input source line, as displayed in a listing, to ''number'' bytes. __--listing-cont-lines=__''number'' Set the maximum number of lines printed in a listing for a single line of input to ''number'' + 1. __-o__ ''objfile'' Name the object-file output from __as__ ''objfile''. __-R__ Fold the data section into the text section. __--statistics__ Print the maximum space (in bytes) and total time (in seconds) used by assembly. __--strip-local-absolute__ Remove local absolute symbols from the outgoing symbol table. __-v__ __-version__ Print the __as__ version. __--version__ Print the __as__ version and exit. __-W__ __--no-warn__ Suppress warning messages. __--fatal-warnings__ Treat warnings as errors. __--warn__ Don't suppress warning messages or treat them as errors. __-w__ Ignored. __-x__ Ignored. __-Z__ Generate an object file even after errors. __--__ ''files'' __...__ Standard input, or source files to assemble. The following options are available when as is configured for an ARC processor. __-marc[[5678]__ This option selects the core processor variant. __-EB -EL__ Select either big-endian (-EB) or little-endian (-EL) output. The following options are available when as is configured for the ARM processor family. __-mcpu=__''processor''__[[+__''extension''__...]__ Specify which ARM processor variant is the target. __-march=__''architecture''__[[+__''extension''__...]__ Specify which ARM architecture variant is used by the target. __-mfpu=__''floating-point-format'' Select which Floating Point architecture is the target. __-mthumb__ Enable Thumb only instruction decoding. __-mapcs-32 -mapcs-26 -mapcs-float -mapcs-reentrant -moabi__ Select which procedure calling convention is in use. __-EB -EL__ Select either big-endian (-EB) or little-endian (-EL) output. __-mthumb-interwork__ Specify that the code has been generated with interworking between Thumb and ARM code in mind. __-k__ Specify that PIC code has been generated. See the info pages for documentation of the CRIS-specific options. The following options are available when as is configured for a D10V processor. __-O__ Optimize output by parallelizing instructions. The following options are available when as is configured for a D30V processor. __-O__ Optimize output by parallelizing instructions. __-n__ Warn when nops are generated. __-N__ Warn when a nop after a 32-bit multiply instruction is generated. The following options are available when as is configured for the Intel 80960 processor. __-ACA -ACA_A -ACB -ACC -AKA -AKB -AKC -AMC__ Specify which variant of the 960 architecture is the target. __-b__ Add code to collect statistics about branches taken. __-no-relax__ Do not alter compare-and-branch instructions for long displacements; error if necessary. The following options are available when as is configured for the Mitsubishi M32R series. __--m32rx__ Specify which processor in the M32R family is the target. The default is normally the M32R, but this option changes it to the M32RX. __--warn-explicit-parallel-conflicts or --Wp__ Produce warning messages when questionable parallel constructs are encountered. __--no-warn-explicit-parallel-conflicts or --Wnp__ Do not produce warning messages when questionable parallel constructs are encountered. The following options are available when as is configured for the Motorola 68000 series. __-l__ Shorten references to undefined symbols, to one word instead of two. __-m68000 -m68008 -m68010 -m68020 -m68030__ __-m68040 -m68060 -m68302 -m68331 -m68332__ __-m68333 -m68340 -mcpu32 -m5200__ Specify what processor in the 68000 family is the target. The default is normally the 68020, but this can be changed at configuration time. __-m68881 -m68882 -mno-68881 -mno-68882__ The target machine does (or does not) have a floating-point coprocessor. The default is to assume a coprocessor for 68020, 68030, and cpu32. Although the basic 68000 is not compatible with the 68881, a combination of the two can be specified, since it's possible to do emulation of the coprocessor instructions with the main processor. __-m68851 -mno-68851__ The target machine does (or does not) have a memory-management unit coprocessor. The default is to assume an MMU for 68020 and up. For details about the PDP-11 machine dependent features options, see @ref{PDP-11-Options}. __-mpic -mno-pic__ Generate position-independent (or position-dependent) code. The default is __-mpic__. __-mall__ __-mall-extensions__ Enable all instruction set extensions. This is the default. __-mno-extensions__ Disable all instruction set extensions. __-m__''extension'' __-mno-__''extension'' Enable (or disable) a particular instruction set extension. __-m__''cpu'' Enable the instruction set extensions supported by a particular CPU , and disable all other extensions. __-m__''machine'' Enable the instruction set extensions supported by a particular machine model, and disable all other extensions. The following options are available when as is configured for a picoJava processor. __-mb__ Generate ``big endian'' format output. __-ml__ Generate ``little endian'' format output. The following options are available when as is configured for the Motorola 68HC11 or 68HC12 series. __-m68hc11 -m68hc12__ Specify what processor is the target. The default is defined by the configuration option when building the assembler. __--force-long-branchs__ Relative branches are turned into absolute ones. This concerns conditional branches, unconditional branches and branches to a sub routine. __-S --short-branchs__ Do not turn relative branchs into absolute ones when the offset is out of range. __--strict-direct-mode__ Do not turn the direct addressing mode into extended addressing mode when the instruction does not support direct addressing mode. __--print-insn-syntax__ Print the syntax of instruction in case of error. __--print-opcodes__ print the list of instructions with syntax and then exit. __--generate-example__ print an example of instruction for each possible instruction and then exit. This option is only useful for testing __as__. The following options are available when __as__ is configured for the SPARC architecture: __-Av6 -Av7 -Av8 -Asparclet -Asparclite__ __-Av8plus -Av8plusa -Av9 -Av9a__ Explicitly select a variant of the SPARC architecture. __-Av8plus__ and __-Av8plusa__ select a 32 bit environment. __-Av9__ and __-Av9a__ select a 64 bit environment. __-Av8plusa__ and __-Av9a__ enable the SPARC V9 instruction set with UltraSPARC extensions. __-xarch=v8plus -xarch=v8plusa__ For compatibility with the Solaris v9 assembler. These options are equivalent to -Av8plus and -Av8plusa, respectively. __-bump__ Warn when the assembler switches to another architecture. The following options are available when as is configured for a MIPS processor. __-G__ ''num'' This option sets the largest size of an object that can be referenced implicitly with the gp register. It is only accepted for targets that use ECOFF format, such as a DECstation running Ultrix. The default value is 8. __-EB__ Generate ``big endian'' format output. __-EL__ Generate ``little endian'' format output. __-mips1__ __-mips2__ __-mips3__ __-mips4__ __-mips32__ __-mips64__ Generate code for a particular MIPS Instruction Set Architecture level. __-mips1__ corresponds to the R2000 and R3000 processors, __-mips2__ to the R6000 processor, and __-mips3__ to the R4000 processor. __-mips5__, __-mips32__, and __-mips64__ correspond to generic MIPS V, MIPS32 , and MIPS64 ISA processors, respectively. __-m4650__ __-no-m4650__ Generate code for the MIPS R4650 chip. This tells the assembler to accept the __mad__ and __madu__ instruction, and to not schedule __nop__ instructions around accesses to the __HI__ and __LO__ registers. __-no-m4650__ turns off this option. __-mcpu=__ ''CPU'' Generate code for a particular MIPS cpu. It is exactly equivalent to __-m__''cpu'', except that there are more value of ''cpu'' understood. __--emulation=__''name'' This option causes __as__ to emulate __as__ configured for some other target, in all respects, including output format (choosing between ELF and ECOFF only), handling of pseudo-opcodes which may generate debugging information or store symbol table information, and default endianness. The available configuration names are: __mipsecoff__, __mipself__, __mipslecoff__, __mipsbecoff__, __mipslelf__, __mipsbelf__. The first two do not alter the default endianness from that of the primary target for which the assembler was configured; the others change the default to little- or big-endian as indicated by the __b__ or __l__ in the name. Using __-EB__ or __-EL__ will override the endianness selection in any case. This option is currently supported only when the primary target __as__ is configured for is a MIPS ELF or ECOFF target. Furthermore, the primary target or others specified with __--enable-targets=...__ at configuration time must include support for the other format, if both are to be available. For example, the Irix 5 configuration includes support for both. Eventually, this option will support more configurations, with more fine-grained control over the assembler's behavior, and will be supported for more processors. __-nocpp__ __as__ ignores this option. It is accepted for compatibility with the native tools. __--trap__ __--no-trap__ __--break__ __--no-break__ Control how to deal with multiplication overflow and division by zero. __--trap__ or __--no-break__ (which are synonyms) take a trap exception (and only work for Instruction Set Architecture level 2 and higher); __--break__ or __--no-trap__ (also synonyms, and the default) take a break exception. __-n__ When this option is used, __as__ will issue a warning every time it generates a nop instruction from a macro. The following options are available when as is configured for an MCore processor. __-jsri2bsr__ __-nojsri2bsr__ Enable or disable the JSRI to BSR transformation. By default this is enabled. The command line option __-nojsri2bsr__ can be used to disable it. __-sifilter__ __-nosifilter__ Enable or disable the silicon filter behaviour. By default this is disabled. The default can be overridden by the __-sifilter__ command line option. __-relax__ Alter jump instructions for long displacements. __-mcpu=[[210340]__ Select the cpu type on the target hardware. This controls which instructions can be assembled. __-EB__ Assemble for a big endian target. __-EL__ Assemble for a little endian target. See the info pages for documentation of the MMIX-specific options. !!SEE ALSO gcc(1), ld(1), and the Info entries for ''binutils'' and ''ld''. !!COPYRIGHT Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled `` GNU Free Documentation License''. ----
10 pages link to
as(1)
:
gcc-2.95(1)
cc(1)
Man1a
as86(1)
g++(1)
g++-2.95(1)
CompilingHowto
gcc(1)
TwoLetterCommands
GCC
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.