as 命令详解

| 选择喜欢的代码风格  

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

as 命令安装:


-bash/zsh: as command not found

#Debian
apt-get install binutils-i586-linux-gnu

#Ubuntu
apt-get install binutils-2.26

#Alpine
apk add binutils

#Arch Linux
pacman -S aarch64-linux-gnu-binutils

#Kali Linux
apt-get install binutils-i686-kfreebsd-gnu

#CentOS
yum install binutils

#Fedora
dnf install binutils-arc-linux-gnu

#OS X
brew install binutils

#Raspbian
apt-get install binutils-mingw-w64-i686

#Docker
docker run cmd.cat/as as

as 命令补充说明:


as 命令是 GNU 组织推出的一款汇编语言编译器,它支持多种不同类型的处理器。

as 程序实际上是一个汇编程序家族。 如果您在一个体系结构上使用(或已经使用过)GNU 汇编程序,那么当您在另一个体系结构上使用它时,您应该找到一个非常相似的环境。 每个版本与其他版本有许多共同之处,包括目标文件格式,大多数汇编程序指令(通常称为伪操作)和汇编语法。

as 命令语法:


as [-a[cdghlns][=file]] [--alternate] [-D]
        [--compress-debug-sections]  [--nocompress-debug-sections]
        [--debug-prefix-map old=new]
        [--defsym sym=val] [-f] [-g] [--gstabs]
        [--gstabs+] [--gdwarf-] [--gdwarf-sections]
        [--gdwarf-cie-version=VERSION]
        [--help] [-I dir] [-J]
        [-K] [-L] [--listing-lhs-width=NUM]
        [--listing-lhs-width2=NUM] [--listing-rhs-width=NUM]
        [--listing-cont-lines=NUM] [--keep-locals]
        [--no-pad-sections]
        [-o objfile] [-R]
        [--hash-size=NUM] [--reduce-memory-overheads]
        [--statistics]
        [-v] [-version] [--version]
        [-W] [--warn] [--fatal-warnings] [-w] [-x]
        [-Z] [@FILE]
        [--sectname-subst] [--size-check=[error|warning]]
        [--elf-stt-common=[no|yes]]
        [--generate-missing-build-notes=[no|yes]]
        [--target-help] [target-options]
        [--|files ...]


Syntax:
===========================================================================
AArch64:

[-EB|-EL] [-mabi=ABI]
Alpha:

[-mcpu] [-mdebug | -no-mdebug] [-replace | -noreplace] [-relax] [-g] 
[-Gsize] [-F] [-32addr]
ARC:

[-marc[5|6|7|8]] [-EB|-EL]
ARM:

[-mcpu=processor[+extension...]] [-march=architecture[+extension...]] 
[-mfpu=floating-point-format] [-mfloat-abi=abi] [-meabi=ver] [-mthumb] 
[-EB|-EL] [-mapcs-32|-mapcs-26|-mapcs-float| -mapcs-reentrant] 
[-mthumb-interwork] [-k]
Blackfin:

[-mcpu=processor[-sirevision]] [-mfdpic] [-mno-fdpic] [-mnopic]
CRIS:

[--underscore | --no-underscore] [--pic] [-N] [--emulation=criself | 
--emulation=crisaout] [--march=v0_v10 | --march=v10 | --march=v32 | 
--march=common_v10_v32]
D10V:

[-O]
D30V:

[-O|-n|-N]
EPIPHANY:

[-mepiphany|-mepiphany16]
H8/300:

[-h-tick-hex]
i386:

[--32|--n32|--64] [-n] [-march=CPU[+EXTENSION...]] [-mtune=CPU]
i960:

[-ACA|-ACA_A|-ACB|-ACC|-AKA|-AKB| -AKC|-AMC] [-b] [-no-relax]
IA-64:

[-mconstant-gp|-mauto-pic] [-milp32|-milp64|-mlp64|-mp64] [-mle|mbe] 
[-mtune=itanium1|-mtune=itanium2] [-munwind-check=warning|-munwind-check=error] 
[-mhint.b=ok|-mhint.b=warning|-mhint.b=error] [-x|-xexplicit] 
[-xauto] [-xdebug]
IP2K:

[-mip2022|-mip2022ext]
M32C:

[-m32c|-m16c] [-relax] [-h-tick-hex]
M32R:

[--m32rx|--[no-]warn-explicit-parallel-conflicts| --W[n]p]
M680X0:

[-l] [-m68000|-m68010|-m68020|...]
M68HC11:

[-m68hc11|-m68hc12|-m68hcs12|-mm9s12x|-mm9s12xg] [-mshort|-mlong] 
[-mshort-double|-mlong-double] [--force-long-branches] [--short-branches] 
[--strict-direct-mode] [--print-insn-syntax] [--print-opcodes] 
[--generate-example]
MCORE:

[-jsri2bsr] [-sifilter] [-relax] [-mcpu=[210|340]]
MIPS:

[-nocpp] [-EL] [-EB] [-O[optimizationlevel]] [-g[debuglevel]] [-G num] 
[-KPIC] [-call_shared] [-non_shared] [-xgot [-mvxworks-pic] [-mabi=ABI] 
[-32] [-n32] [-64] [-mfp32] [-mgp32] [-march=CPU] [-mtune=CPU] [-mips1] 
[-mips2] [-mips3] [-mips4] [-mips5] [-mips32] [-mips32r2] [-mips64] 
[-mips64r2] [-construct-floats] [-no-construct-floats] [-trap] [-no-break] 
[-break] [-no-trap] [-mips16] [-no-mips16] [-mmicromips] [-mno-micromips] 
[-msmartmips] [-mno-smartmips] [-mips3d] [-no-mips3d] [-mdmx] [-no-mdmx] 
[-mdsp] [-mno-dsp] [-mdspr2] [-mno-dspr2] [-mmt] [-mno-mt] [-mmcu] 
[-mno-mcu] [-mfix7000] [-mno-fix7000] [-mfix-vr4120] [-mno-fix-vr4120] 
[-mfix-vr4130] [-mno-fix-vr4130] [-mdebug] [-no-mdebug] [-mpdr] [-mno-pdr]
MMIX:

[--fixed-special-register-names] [--globalize-symbols] [--gnu-syntax] 
[--relax] [--no-predefined-symbols] [--no-expand] [--no-merge-gregs] 
[-x] [--linker-allocated-gregs]
PDP11:

[-mpic|-mno-pic] [-mall] [-mno-extensions] [-mextension|-mno-extension] 
[-mcpu] [-mmachine]
picoJava:

[-mb|-me]
PowerPC:

[-a32|-a64] [-mpwrx|-mpwr2|-mpwr|-m601|-mppc|-mppc32|-m603|-m604|-m403|-m405| 
-m440|-m464|-m476|-m7400|-m7410|-m7450|-m7455|-m750cl|-mppc64| -m620|-me500|
-e500x2|-me500mc|-me500mc64|-me5500|-me6500|-mppc64bridge| -mbooke|-mpower4|
-mpr4|-mpower5|-mpwr5|-mpwr5x|-mpower6|-mpwr6| -mpower7|-mpw7|-ma2|-mcell|
-mspe|-mtitan|-me300|-mcom] [-many] [-maltivec|-mvsx] [-mregnames|
-mno-regnames] [-mrelocatable|-mrelocatable-lib|-K PIC] [-memb] [-mlittle|
-mlittle-endian|-le|-mbig|-mbig-endian|-be] [-msolaris|-mno-solaris] 
[-nops=count]
RX:

[-mlittle-endian|-mbig-endian] [-m32bit-ints|-m16bit-ints] [-m32bit-doubles|
-m64bit-doubles]
s390:

[-m31|-m64] [-mesa|-mzarch] [-march=CPU] [-mregnames|-mno-regnames] 
[-mwarn-areg-zero]
SCORE:

[-EB][-EL][-FIXDD][-NWARN] [-SCORE5][-SCORE5U][-SCORE7][-SCORE3] 
[-march=score7] [-march=score3] [-USE_R1][-KPIC][-O0][-G num][-V]
SPARC:

[-Av6|-Av7|-Av8|-Asparclet|-Asparclite -Av8plus|-Av8plusa|-Av9|-Av9a] 
[-xarch=v8plus|-xarch=v8plusa] [-bump] [-32|-64]
TIC54X:

[-mcpu=54[123589]|-mcpu=54[56]lp] [-mfar-mode|-mf] [-merrors-to-file 
|-me ]
TIC6X:

[-march=arch] [-mbig-endian|-mlittle-endian] [-mdsbt|-mno-dsbt] 
[-mpid=no|-mpid=near|-mpid=far] [-mpic|-mno-pic]
TILE-Gx:

[-m32|-m64][-EB][-EL]
Xtensa:

[--[no-]text-section-literals] [--[no-]absolute-literals] [--[no-]target-align] 
[--[no-]longcalls] [--[no-]transform] [--rename-section oldname=newname]
Z80:

[-z80] [-r800] [-ignore-undocumented-instructions] [-Wnud] 
[-ignore-unportable-instructions] [-Wnup] [-warn-undocumented-instructions] 
[-Wud] [-warn-unportable-instructions] [-Wup] 
[-forbid-undocumented-instructions] [-Fud] [-forbid-unportable-instructions] 
[-Fup]

as 命令选项:


-ac:忽略失败条件;
-ad:忽略调试指令;
-ah:包括高级源;
-al:包括装配;
-am:包括宏扩展;
-an:忽略形式处理;
-as:包括符号;
=file:设置列出文件的名字;
--alternate:以交互宏模式开始;
-f:跳过空白和注释预处理;
-g:产生调试信息;
-J:对于有符号溢出不显示警告信息;
-L:在符号表中保留本地符号;
-o:指定要生成的目标文件;
--statistics:打印汇编所用的最大空间和总时间。

as 命令参数:


汇编文件:指定要汇编的源文件。

as 命令实例:


as 汇编文件,将输出写入 a.out

as file.s

as 将输出组装到给定文件:

as file.s -o out.o

as 通过跳过空格和注释预处理,可以更快地生成输出。(仅应用于受信任的编译器):

as -f file.s

as 包括目录列表的给定路径,以搜索 .include 指令中指定的文件:

as -I path/to/directory file.s

as 命令扩展阅读:




as 命令评论

共收录到 511Linux 命令