GNU 汇编器 as 的用户手册。
Here is a brief summary of how to invoke as. For details, see section
Command-Line Options.
以下是调用 as 的命令概要,详细内容请见命令行选项一节。
as [ -a[cdhlns][=file] ] [ -D ] [ --defsym sym=val ]
[ -f ] [ --gstabs ] [ --help ] [ -I dir ] [ -J ] [ -K ] [ -L ]
[ --keep-locals ] [ -o objfile ] [ -R ] [ --statistics ] [ -v ]
[ -version ] [ --version ] [ -W ] [ -w ] [ -x ] [ -Z ]
[ -mbig-endian | -mlittle-endian ]
[ -m[arm]1 | -m[arm]2 | -m[arm]250 | -m[arm]3 | -m[arm]6 | -m[arm]7[t][[d]m[i]] ]
[ -m[arm]v2 | -m[arm]v2a | -m[arm]v3 | -m[arm]v3m | -m[arm]v4 | -m[arm]v4t ]
[ -mthumb | -mall ]
[ -mfpa10 | -mfpa11 | -mfpe-old | -mno-fpu ]
[ -EB | -EL ]
[ -mapcs-32 | -mapcs-26 ]
[ -O ]
[ -Av6 | -Av7 | -Av8 | -Asparclet | -Asparclite
-Av8plus | -Av8plusa | -Av9 | -Av9a ]
[ -xarch=v8plus | -xarch=v8plusa ] [ -bump ] [ -32 | -64 ]
[ -ACA | -ACA_A | -ACB | -ACC | -AKA | -AKB | -AKC | -AMC ]
[ -b ] [ -no-relax ]
[ -l ] [ -m68000 | -m68010 | -m68020 | ... ]
[ -nocpp ] [ -EL ] [ -EB ] [ -G num ] [ -mcpu=CPU ]
[ -mips1 ] [ -mips2 ] [ -mips3 ] [ -m4650 ] [ -no-m4650 ]
[ --trap ] [ --break ]
[ --emulation=name ]
[ -- | files ... ]
-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
忽略 forms 处理
-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'.
你可以联合使用这些选项;例如,要获得未经过 forms 处理的汇编代码清单可使用 '-aln',
如果要使用 ‘=file’选项,它必须在最后一个位置,选项‘-a’缺省含义是'-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.
处理输入文件前,定义符号 sym 的值为 value。value 必须是整形常量。同在'C'中一样,前导
字符'0x'标志十六进制值,前导字符'0'标志八进制值。
-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.
生成逐行的 stabs 格式调试信息,如果调试器可以处理这种格式的信息将有助于汇编代码调
试。
--help
Print a summary of the command line options and exit.
打印命令行选项概要后退出。
-I dir
Add directory dir to the search list for .include directives.
为.include 汇编指示增加搜索目录。
-J
Don't warn about signed overflow.
不警告符号溢出。
-K
Issue warnings when difference tables altered for long displacements.
长跳切换表时发出警告。
-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.
保留(符号表中的)局部符号。在传统的 a.out 系统中这些符号有'L'前缀,但是在不同
的系统中有不同的局部符号前缀。
-o objfile
Name the object-file output from as objfile.
as 输出的目标文件名。
-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.
打印 as 的版本。
--version
Print the as version and exit.
打印 as 的版本后退出。
-W
Suppress warning messages.
压制警告信息。
-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.
以下选项,当配置 as 为 ARC 处理器时有效。
-mbig-endian
Generate "big endian" format output.
生成“大端”格式输出。
-mlittle-endian
Generate "little endian" format output.
生成“小端”格式输出。
The following options are available when as is configured for the ARM processor
family.
以下选项,当配置 as 为 ARM 处理器族时有效。
-m[arm]1 | -m[arm]2 | -m[arm]250 | -m[arm]3 | -m[arm]6 | -m[arm]7[t][[d]m] |
-m[arm]v2 | -m[arm]v2a | -m[arm]v3 | -m[arm]v3m | -m[arm]v4 | -m[arm]v4t
Specify which variant of the ARM architecture is the target.
指定不同的目标架构。
-mthumb | -mall
Enable or disable Thumb only instruction decoding.
禁止或使能仅用 Thumb 指令译码。
-mfpa10 | -mfpa11 | -mfpe-old | -mno-fpu
Select which Floating Point architcture is the target.
选择不同的浮点目标架构。
-mapcs-32 | -mapcs-26
Select which procedure calling convention is in use.
选择使用的调用习惯。
-EB | -EL
Select either big-endian (-EB) or little-endian (-EL) output.
选择大端(-EB)或小端(-EL)输出格式。
The following options are available when as is configured for a D10V processor.
以下选项,当配置 as 为 D10V 处理器时有效。
-O
Optimize output by parallelizing instructions.
优化并行指令输出。
The following options are available when as is configured for the Intel 80960
processor.
以下选项,当配置 as 为英特尔 80960 处理器时有效。
-ACA | -ACA_A | -ACB | -ACC | -AKA | -AKB | -AKC | -AMC
Specify which variant of the 960 architecture is the target.
指定不同的 960 目标架构。
-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 Motorola 68000
series.
以下选项,当配置 as 为摩托罗拉 68000 系列处理器时有效。
-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.
指定 68000 族的目标架构,缺省是普通的 68020,可在配置时更改。
-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.
目标机有或没有浮点协处理器。缺省假定有 68020,68030 和 cpu32 的协处理器。虽然基本的
68000 和 68881 不兼容,但是通过主处理器的协处理器指令模拟,两者还是可以联合使用。
-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.
目标机有或没有内存管理单元协处理器。缺省假定有 68020 或以上的内存管理单元。
The following options are available when as is configured for the SPARC
architecture:
以下选项,当配置 as 为 SPARC 架构处理器时有效。
-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.
明确选择不同的 SPARC 架构。'-Av8plus'和'-Av8plusa' 选择 32 位环境。'-Av9' 和 '-Av9a'
选择 64 位环境。'-Av8plusa' 和 '-Av9a' 使用带 UltraSPARC 扩展的 SPARC V9 指令集。
-xarch=v8plus | -xarch=v8plusa
For compatibility with the Solaris v9 assembler. These options are equivalent
to -Av8plus and -Av8plusa, respectively.
兼容 Solaris V9 汇编器。这些选项分别等于-Av8plus 和-Av8plusa。
-bump
Warn when the assembler switches to another architecture.
汇编器转换到其他架构时发出警告。
The following options are available when as is configured for a MIPS processor.
以下选项,当配置 as 为 MIPS 处理器时有效。
-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.
设置可以被 gp 寄存器隐含引用对象的最大尺寸。这只是为目标代码格式为 ECOFF 的情况
而设置,例如运行 Ultrix 的 DECstation。缺省值是 8。
-EB
Generate "big endian" format output.
生成“大端”格式输出。
-EL
Generate "little endian" format output.
生成“小端”格式输出。
-mips1
-mips2
-mips3
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.
生成特定 MIPS 指令集架构层的代码。'-mips1'对应 R2000 和 R3000 处理器,'-mips2'对应
R6000
处理器,'-mips3'对应 R4000 处理器。
-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.
生成 MIPS R4650 芯片代码。告诉汇编器接受'mad'和'madu'指令,访问'HI'和'LO'寄存器时
不调整'nop'指令。'-no-m4650'关闭这个选项。
-mcpu=CPU
Generate code for a particular MIPS cpu. This has little effect on the
assembler, but it is passed by gcc.
生成特定 MIPS cpu 的代码,如果输入文件是经过 gcc 相应处理而得,对汇编器的影响不大
--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.
模拟其他目标架构,包括输出文件格式(ELF 或 ECOFF 二者其一),伪指令处理,生成的调
试
信息,存储的符号表信息,以及缺省的大小端格式。有效的配置名是:`mipsecoff', `mipself',
`mipslecoff', `mipsbecoff', `mipslelf',`mipsbelf'。前两个不改变相应目标的缺省大小端格式。
其它的分别依据其配置名中包含的字符'b'或'l'改变目标代码的大小端格式。这个选项当前
只支持主目标代码格式是 MIPS ELF 或 ECOFF 的情况。另外,如果二者都是有效格式,主
目标格式或配
置时通过'--enable-targets=...' 指定的格式必须包含支持另一格式。例如 Irix 5 配置包含对二者
的支持。最终这个选项将会支持更多的配置,对汇编器行为进行更细微的控制,而且会支持
更多的处理器。
-nocpp
as ignores this option. It is accepted for compatibility with the native
tools.
as 忽略这个选项。这是为兼容本地工具而设。
--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