Section: GNU Development Tools (1)
as [-a[cdghlns][=file]] [--alternate] [-D]
[--defsym sym=val] [-f] [-g] [--gstabs]
[--gstabs+] [--gdwarf-2] [--gdwarf-sections]
[--help] [-I dir] [-J]
[-K] [-L] [--listing-lhs-width=NUM]
[--listing-cont-lines=NUM] [--keep-locals] [-o
objfile] [-R] [--reduce-memory-overheads] [--statistics]
[-v] [-version] [--version] [-W] [--warn]
[--fatal-warnings] [-w] [-x] [-Z] [@FILE]
Target AArch64 options:
Target Alpha options:
[-mdebug | -no-mdebug]
[-replace | -noreplace]
[-relax] [-g] [-Gsize]
Target ARC options:
Target ARM options:
Target Blackfin options:
Target CRIS options:
[--underscore | --no-underscore]
[--emulation=criself | --emulation=crisaout]
[--march=v0_v10 | --march=v10 | --march=v32 | --march=common_v10_v32]
Target D10V options:
Target D30V options:
Target EPIPHANY options:
Target H8/300 options:
Target i386 options:
Target i960 options:
Target IA-64 options:
[-x|-xexplicit] [-xauto] [-xdebug]
Target IP2K options:
Target M32C options:
[-m32c|-m16c] [-relax] [-h-tick-hex]
Target M32R options:
Target M680X0 options:
Target M68HC11 options:
Target MCORE options:
[-jsri2bsr] [-sifilter] [-relax]
Target Meta options:
[-mcpu=cpu] [-mfpu=cpu] [-mdsp=cpu] Target MICROBLAZE options:
Target MIPS options:
[-nocpp] [-EL] [-EB] [-O[optimization level]]
[-g[debug level]] [-G num] [-KPIC] [-call_shared]
[-non_shared] [-xgot [-mvxworks-pic]
[-mabi=ABI] [-32] [-n32] [-64] [-mfp32] [-mgp32]
[-mfp64] [-mgp64] [-mfpxx]
[-march=CPU] [-mtune=CPU] [-mips1] [-mips2]
[-mips3] [-mips4] [-mips5] [-mips32] [-mips32r2]
[-mips32r3] [-mips32r5] [-mips32r6] [-mips64] [-mips64r2]
[-mips64r3] [-mips64r5] [-mips64r6]
[-trap] [-no-break] [-break] [-no-trap]
Target MMIX options:
[--gnu-syntax] [--relax] [--no-predefined-symbols]
[--no-expand] [--no-merge-gregs] [-x]
Target Nios II options:
[-relax-all] [-relax-section] [-no-relax]
Target NDS32 options:
[-EL] [-EB] [-O] [-Os] [-mcpu=cpu]
[-misa=isa] [-mabi=abi] [-mall-ext]
[-m[no-]16-bit] [-m[no-]perf-ext] [-m[no-]perf2-ext]
[-m[no-]string-ext] [-m[no-]dsp-ext] [-m[no-]mac] [-m[no-]div]
[-m[no-]audio-isa-ext] [-m[no-]fpu-sp-ext] [-m[no-]fpu-dp-ext]
[-m[no-]fpu-fma] [-mfpu-freg=FREG] [-mreduced-regs]
[-mfull-regs] [-m[no-]dx-regs] [-mpic] [-mno-relax]
Target PDP11 options:
[-mpic|-mno-pic] [-mall] [-mno-extensions]
Target picoJava options:
Target PowerPC options:
[-mrelocatable|-mrelocatable-lib|-K PIC] [-memb]
Target RL78 options:
Target RX options:
Target s390 options:
[-m31|-m64] [-mesa|-mzarch] [-march=CPU]
Target SCORE options:
Target SPARC options:
Target TIC54X options:
[-merrors-to-file <filename>|-me <filename>]
Target TIC6X options:
Target TILE-Gx options:
Target Xtensa options:
Target Z80 options:
[ -ignore-undocumented-instructions] [-Wnud]
[ -ignore-unportable-instructions] [-Wnup]
[ -warn-undocumented-instructions] [-Wud]
[ -warn-unportable-instructions] [-Wup]
[ -forbid-undocumented-instructions] [-Fud]
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
"gcc"for use by the linker
"ld". 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, 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 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 in file are separated by whitespace. A whitespace character may be included in an option by surrounding the entire option in either single or double quotes. Any character (including a backslash) may be included by prefixing the character to be included with a backslash. The file may itself contain additional @file options; any such options will be processed recursively.
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.
Set the default size of GAS's hash tables to a prime number close to number. Increasing this value can reduce the length of time it takes the assembler to perform its tasks, at the expense of increasing the assembler's memory requirements. Similarly reducing this value can reduce the memory requirements at the expense of speed.
The following options are available when as is configured for the 64-bit mode of the ARM Architecture (AArch64).
"lp64", which decides the generated object file in ELF32 and ELF64 format respectively. The default is
"xgene2". The special name
"all"may be used to allow the assembler to accept instructions valid for any supported processor, including all optional extensions.
In addition to the basic instruction set, the assembler can be told to accept, or restrict, various extension mnemonics that extend the processor.
If some implementations of a particular processor can have an extension, then then those extensions are automatically enabled. Consequently, you will not normally have to specify any additional extensions.
If both -mcpu and -march are specified, the assembler will use the setting for -mcpu. If neither are specified, the assembler will default to -mcpu=all.
The architecture option can be extended with the same instruction set extension options as the -mcpu option. Unlike -mcpu, extensions are not always enabled by default,
The following options are available when as is configured for an Alpha processor.
"ev68". The special name
"all"may be used to allow the assembler to accept instructions valid for any Alpha processor. In order to support existing practice in OSF/1 with respect to
".arch", and existing practice within MILO (the Linux ARC bootloader), the numbered processor names (e.g. 21064) enable the processor-specific PALcode instructions, while the ``electro-vlasic'' names (e.g.
"ev4") do not.
".mdebug"encapsulation for stabs directives and procedure descriptors. The default is to automatically enable
".mdebug"when the first stabs directive is seen.:
"-replace"is the default. See section 1.4.1 of the OpenVMS Linker Utility Manual.:
".bss", while smaller symbols are placed in
The following options are available when as is configured for an ARC processor.
The following options are available when as is configured for the ARM processor family.
The following options are available when as is configured for the Blackfin processor family.
"-mcpu="option. The assembler will issue an error message if an attempt is made to assemble an instruction which will not execute on the target processor. The following processor names are recognized:
"bf535"(not implemented yet),
See the info pages for documentation of the CRIS-specific options.
The following options are available when as is configured for a D10V processor.
The following options are available when as is configured for a D30V processor.
The following options are available when as is configured for an Epiphany processor.
@chapterH8/300 Dependent Features
"as"has one machine-dependent option:
The following options are available when as is configured for an i386 processor.
These options are only available with the ELF object file format, and require that the necessary BFD support has been included (on a 32-bit platform you have to add --enable-64-bit-bfd to configure enable 64-bit usage and use x86-64 as target platform).
"-march=i686+sse4+vmx"extends i686 with sse4 and vmx. The following extensions are currently supported:
"padlock". Note that rather than extending a basic instruction set, the extension mnemonics starting with
"no"revoke the respective functionality. When the
".arch"directive is used with -march, the
".arch"directive will take precedent.
Valid CPU values are identical to the processor list of -march=CPU.
".intel_mnemonic"directives will take precedent.:
".intel_syntax"directives will take precedent.:
".intel_syntax"directives will take precedent.:
The following options are available when as is configured for the Intel 80960 processor.
The following options are available when as is configured for the Ubicom IP2K series.
The following options are available when as is configured for the Renesas M32C and M16C processors.
The following options are available when as is configured for the Renesas M32R (formerly Mitsubishi M32R) series.
The following options are available when as is configured for the Motorola 68000 series.
:-m68000 | -m68008 | -m68010 | -m68020 | -m68030
:| -m68040 | -m68060 | -m68302 | -m68331 | -m68332
The following options are available when as is configured for an Altera Nios II processor.
"jmp"sequences when possible. The generated code sequences are suitable for use in position-independent code, but there is a practical limit on the extended branch range because of the length of the sequences. This option is the default.:
"callr"sequences (respectively). This option generates absolute relocations against the target symbols and is not appropriate for position-independent code.:
The following options are available when as is configured for a Meta processor.
See the info pages for documentation of the MMIX-specific options.
The following options are available when as is configured for a NDS32 processor.
"0 8 SP / 4 DP registers":
"1 16 SP / 8 DP registers":
"2 32 SP / 16 DP registers":
"3 32 SP / 32 DP registers"
Specify a abi version <abi> could be v1, v2, v2fp, v2fpp.:
Enable/Disable Multiply instructions support.:
Enable/Disable Divide instructions support.:
Enable/Disable 16-bit extension:
Enable/Disable d0/d1 registers:
Enable/Disable Performance extension:
Enable/Disable Performance extension 2:
Enable/Disable String extension:
Enable/Disable Reduced Register configuration (
Turn on all extensions and instructions support:
The following options are available when as is configured for a PowerPC processor.
See the info pages for documentation of the RX-specific options.
The following options are available when as is configured for the s390 processor family.
The following options are available when as is configured for a TMS320C6000 processor.
"Tag_ABI_DSBT"attribute with a value of 1, indicating that the code is using DSBT addressing. The -mno-dsbt option, the default, causes the tag to have a value of 0, indicating that the code does not use DSBT addressing. The linker will emit a warning if objects of different type (DSBT and non-DSBT) are linked together.:
"Tag_ABI_PID"attribute with a value indicating the form of data addressing used by the code. -mpid=no, the default, indicates position-dependent data addressing, -mpid=near indicates position-independent addressing with GOT accesses using near DP addressing, and -mpid=far indicates position-independent addressing with GOT accesses using far DP addressing. The linker will emit a warning if objects built with different settings of this option are linked together.:
"Tag_ABI_PIC"attribute with a value of 1, indicating that the code is using position-independent code addressing, The
"-mno-pic"option, the default, causes the tag to have a value of 0, indicating position-dependent code addressing. The linker will emit a warning if objects of different type (position-dependent and position-independent) are linked together.:
The following options are available when as is configured for a TILE-Gx processor.
The following options are available when as is configured for an Xtensa processor.
"L32R"instructions in the text section. These options only affect literals referenced via PC-relative
"L32R"instructions; literals for absolute mode
"L32R"instructions are handled separately.:
"L32R"instructions use absolute or PC-relative addressing. If the processor includes the absolute addressing option, the default is to use absolute
"L32R"relocations. Otherwise, only the PC-relative
"L32R"relocations can be used.:
"LOOP"that have fixed alignment requirements.:
The following options are available when as is configured for a Z80 family processor.
Copyright (c) 1991-2014 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.3 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''.
Tutoriais de Tecnologia Web