AS(1)
okay so you opened AS(1) from GNU Development Tools, and bestie, this is the portable GNU assembler โ yes, the whole architecture buffet, no cap. ๐
๐ธ NAME ๐ธ
AS โ the portable GNU assembler. That's the name. Short, iconic, does exactly what it says on the tin. โจ
๐ฆ SYNOPSIS ๐ฆ
okay so here's how you call it. This is the full shape of the command, and I'm keeping every bracket exactly where it belongs, fr fr:
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-2] [--gdwarf-sections]
[--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]]
[--target-help] [target-options]
[--|files ...]
๐ฅ TARGET ๐ฅ
this section is giving โevery architecture wants a turn on the auxโ energy. It's the complete target-option menu, and I'm preserving it exactly โ every weird bracket, every slash, every ..., every duplicated-looking thing. No edits, no merges, no โfixingโ the lore. ๐ซถ
and yes, the Target MICROBLAZE options: bit is literally inline after the Meta options in the original, so I'm leaving that exactly as-is. we respect the chaos. ๐
Target AArch64 options:
[-EB|-EL]
[-mabi=ABI]
Target Alpha options:
[-mcpu]
[-mdebug | -no-mdebug]
[-replace | -noreplace]
[-relax] [-g] [-Gsize]
[-F] [-32addr]
Target ARC options:
[-mcpu=cpu]
[-mA6|-mARC600|-mARC601|-mA7|-mARC700|-mEM|-mHS]
[-mcode-density]
[-mrelax]
[-EB|-EL]
Target ARM options:
[-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]
Target Blackfin options:
[-mcpu=processor[-sirevision]]
[-mfdpic]
[-mno-fdpic]
[-mnopic]
Target CRIS options:
[--underscore | --no-underscore]
[--pic] [-N]
[--emulation=criself | --emulation=crisaout]
[--march=v0_v10 | --march=v10 | --march=v32 | --march=common_v10_v32]
Target D10V options:
[-O]
Target D30V options:
[-O|-n|-N]
Target EPIPHANY options:
[-mepiphany|-mepiphany16]
Target H8/300 options:
[-h-tick-hex]
Target i386 options:
[--32|--x32|--64] [-n]
[-march=CPU[+EXTENSION...]] [-mtune=CPU]
Target i960 options:
[-ACA|-ACA_A|-ACB|-ACC|-AKA|-AKB|
-AKC|-AMC]
[-b] [-no-relax]
Target IA-64 options:
[-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]
Target IP2K options:
[-mip2022|-mip2022ext]
Target M32C options:
[-m32c|-m16c] [-relax] [-h-tick-hex]
Target M32R options:
[--m32rx|--[no-]warn-explicit-parallel-conflicts|
--W[n]p]
Target M680X0 options:
[-l] [-m68000|-m68010|-m68020|...]
Target M68HC11 options:
[-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]
Target MCORE options:
[-jsri2bsr] [-sifilter] [-relax]
[-mcpu=[210|340]]
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]
[-modd-spreg] [-mno-odd-spreg]
[-march=CPU] [-mtune=CPU] [-mips1] [-mips2]
[-mips3] [-mips4] [-mips5] [-mips32] [-mips32r2]
[-mips32r3] [-mips32r5] [-mips32r6] [-mips64] [-mips64r2]
[-mips64r3] [-mips64r5] [-mips64r6]
[-construct-floats] [-no-construct-floats]
[-mignore-branch-isa] [-mno-ignore-branch-isa]
[-mnan=encoding]
[-trap] [-no-break] [-break] [-no-trap]
[-mips16] [-no-mips16]
[-mmips16e2] [-mno-mips16e2]
[-mmicromips] [-mno-micromips]
[-msmartmips] [-mno-smartmips]
[-mips3d] [-no-mips3d]
[-mdmx] [-no-mdmx]
[-mdsp] [-mno-dsp]
[-mdspr2] [-mno-dspr2]
[-mdspr3] [-mno-dspr3]
[-mmsa] [-mno-msa]
[-mxpa] [-mno-xpa]
[-mmt] [-mno-mt]
[-mmcu] [-mno-mcu]
[-minsn32] [-mno-insn32]
[-mfix7000] [-mno-fix7000]
[-mfix-rm7000] [-mno-fix-rm7000]
[-mfix-vr4120] [-mno-fix-vr4120]
[-mfix-vr4130] [-mno-fix-vr4130]
[-mdebug] [-no-mdebug]
[-mpdr] [-mno-pdr]
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 Nios II options:
[-relax-all] [-relax-section] [-no-relax]
[-EB] [-EL]
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]
[-mb2bb]
Target PDP11 options:
[-mpic|-mno-pic] [-mall] [-mno-extensions]
[-mextension|-mno-extension]
[-mcpu] [-mmachine]
Target picoJava options:
[-mb|-me]
Target PowerPC options:
[-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|-mpwr4|-mpower5|-mpwr5|-mpwr5x|-mpower6|-mpwr6|
-mpower7|-mpwr7|-mpower8|-mpwr8|-mpower9|-mpwr9-ma2|
-mcell|-mspe|-mspe2|-mtitan|-me300|-mcom]
[-many] [-maltivec|-mvsx|-mhtm|-mvle]
[-mregnames|-mno-regnames]
[-mrelocatable|-mrelocatable-lib|-K PIC] [-memb]
[-mlittle|-mlittle-endian|-le|-mbig|-mbig-endian|-be]
[-msolaris|-mno-solaris]
[-nops=count]
Target PRU options:
[-link-relax]
[-mnolink-relax]
[-mno-warn-regname-label]
Target RISC-V options:
[-fpic|-fPIC|-fno-pic]
[-march=ISA]
[-mabi=ABI]
Target RL78 options:
[-mg10]
[-m32bit-doubles|-m64bit-doubles]
Target RX options:
[-mlittle-endian|-mbig-endian]
[-m32bit-doubles|-m64bit-doubles]
[-muse-conventional-section-names]
[-msmall-data-limit]
[-mpid]
[-mrelax]
[-mint-register=number]
[-mgcc-abi|-mrx-abi]
Target s390 options:
[-m31|-m64] [-mesa|-mzarch] [-march=CPU]
[-mregnames|-mno-regnames]
[-mwarn-areg-zero]
Target SCORE options:
[-EB][-EL][-FIXDD][-NWARN]
[-SCORE5][-SCORE5U][-SCORE7][-SCORE3]
[-march=score7][-march=score3]
[-USE_R1][-KPIC][-O0][-G num][-V]
Target SPARC options:
[-Av6|-Av7|-Av8|-Aleon|-Asparclet|-Asparclite
-Av8plus|-Av8plusa|-Av8plusb|-Av8plusc|-Av8plusd
-Av8plusv|-Av8plusm|-Av9|-Av9a|-Av9b|-Av9c
-Av9d|-Av9e|-Av9v|-Av9m|-Asparc|-Asparcvis
-Asparcvis2|-Asparcfmaf|-Asparcima|-Asparcvis3
-Asparcvisr|-Asparc5]
[-xarch=v8plus|-xarch=v8plusa]|-xarch=v8plusb|-xarch=v8plusc
-xarch=v8plusd|-xarch=v8plusv|-xarch=v8plusm|-xarch=v9
-xarch=v9a|-xarch=v9b|-xarch=v9c|-xarch=v9d|-xarch=v9e
-xarch=v9v|-xarch=v9m|-xarch=sparc|-xarch=sparcvis
-xarch=sparcvis2|-xarch=sparcfmaf|-xarch=sparcima
-xarch=sparcvis3|-xarch=sparcvisr|-xarch=sparc5
-bump]
[-32|-64]
[--enforce-aligned-data][--dcti-couples-detect]
Target TIC54X options:
[-mcpu=54[123589]|-mcpu=54[56]lp] [-mfar-mode|-mf]
[-merrors-to-file <filename>|-me <filename>]
Target TIC6X options:
[-march=arch] [-mbig-endian|-mlittle-endian]
[-mdsbt|-mno-dsbt] [-mpid=no|-mpid=near|-mpid=far]
[-mpic|-mno-pic]
Target TILE-Gx options:
[-m32|-m64][-EB][-EL]
Target Visium options:
[-mtune=arch]
Target Xtensa options:
[--[no-]text-section-literals] [--[no-]auto-litpools]
[--[no-]absolute-literals]
[--[no-]target-align] [--[no-]longcalls]
[--[no-]transform]
[--rename-section oldname=newname]
[--[no-]trampolines]
Target Z80 options:
[-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]
๐ DESCRIPTION ๐
okay so picture this: GNU as is literally not just one assembler, itโs a whole 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. slay.
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. ๐ญ iconic chaos, honestly.
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. simple as that.
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. tiny king behavior.
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. โ ๏ธ no cap, pay attention to those.
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.) iykyk.
โจ OPTIONS โจ
@fileโ read command-line options from file. The options read are inserted in place of the original@fileoption. If file does not exist, or cannot be read, then the option will be treated literally, and not removed.- 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
@fileoptions; any such options will be processed recursively. ๐
-a[cdghlmns]โ turn on listings, in any of a variety of ways:-acโ omit false conditionals-adโ omit debugging directives-agโ include general information, likeasversion and options passed-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. ๐
--alternateโ begin in alternate macro mode.--compress-debug-sectionsโ compress DWARF debug sections using zlib withSHF_COMPRESSEDfrom the ELF ABI. The resulting object file may not be compatible with older linkers and object file utilities. Note: if compression would make a given section larger, then it is not compressed. โ ๏ธ--compress-debug-sections=none,--compress-debug-sections=zlib,--compress-debug-sections=zlib-gnu,--compress-debug-sections=zlib-gabiโ these options control how DWARF debug sections are compressed.--compress-debug-sections=noneis equivalent to--nocompress-debug-sections.--compress-debug-sections=zliband--compress-debug-sections=zlib-gabiare equivalent to--compress-debug-sections.--compress-debug-sections=zlib-gnucompresses DWARF debug sections using zlib. The debug sections are renamed to begin with.zdebug. Note: if compression would make a given section larger, then it is not compressed nor renamed. ๐--nocompress-debug-sectionsโ do not compress DWARF debug sections. This is usually the default for all targets except the x86/x86_64, but a configure time option can be used to override this.-Dโ ignored. This option is accepted for script compatibility with calls to other assemblers.--debug-prefix-map old=newโ when assembling files in directory old, record debugging information describing them as in new instead.--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 leading0xindicates a hexadecimal value, and a leading0indicates an octal value. The value of the symbol can be overridden inside a source file via the use of a.setpseudo-op. ๐ง-fโ โfastโ โ skip whitespace and comment preprocessing (assume source is compiler output).-g,--gen-debugโ generate debugging information for each assembler source line using whichever debug format is preferred by the target. This currently means either STABS, ECOFF or DWARF2.--gstabsโ generate stabs debugging information for each assembler line. This may help debugging assembler code, if the debugger can handle it.--gstabs+โ generate stabs debugging information for each assembler line, with GNU extensions that probably onlygdbcan handle, and that could make other debuggers crash or refuse to read your program. This may help debugging assembler code. Currently the only GNU extension is the location of the current working directory at assembling time. ๐ญ read the warning, bestie.--gdwarf-2โ 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.--gdwarf-sectionsโ instead of creating a.debug_linesection, create a series of.debug_line.foosections where foo is the name of the corresponding code section. For example a code section called.text.funcwill have its dwarf line number information placed into a section called.debug_line.text.func. If the code section is just called.textthen debug line section will still be called just.debug_linewithout any suffix. ๐ธ--size-check=error,--size-check=warningโ issue an error or warning for invalid ELF.sizedirective.--elf-stt-common=no,--elf-stt-common=yesโ these options control whether the ELF assembler should generate common symbols with the"STT_COMMON"type. The default can be controlled by a configure option--enable-elf-stt-common.--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.includedirectives.-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. These symbols start with system-specific local label prefixes, typically.Lfor ELF systems orLfor traditional a.out systems.--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.--no-pad-sectionsโ stop the assembler from padding the ends of output sections to the alignment of that section. The default is to pad the sections, but this can waste space which might be needed on targets which have tight memory constraints. ๐-o objfileโ name the object-file output fromasobjfile.-Rโ fold the data section into the text section.--hash-size=numberโ 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. ๐ฆ--reduce-memory-overheadsโ this option reduces GASโs memory requirements, at the expense of making the assembly processes slower. Currently this switch is a synonym for--hash-size=4051, but in the future it may have other effects as well.--sectname-substโ honor substitution sequences in section names.--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 theasversion.--versionโ print theasversion 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. ๐ bold.--| files ... โ standard input, or source files to assemble.
The following options are available when as is configured for the 64-bit mode of the ARM Architecture (AArch64). ๐
-EBโ this option specifies that the output generated by the assembler should be marked as being encoded for a big-endian processor.-ELโ marks the output the assembler makes as being encoded for a little-endian processor ๐ง-mabi=abiโ tells it which ABI the source code is using. Recognized args are"ilp32"and"lp64", which decide whether the generated object file comes out in ELF32 or ELF64 format respectively. The default is"lp64"โจ-mcpu=processor[+extension...]โ picks the target processor. Try to assemble an instruction that won't run on that processor and the assembler will hit you with an error message, no cap. Recognized processor names:"cortex-a35","cortex-a53","cortex-a55","cortex-a57","cortex-a72","cortex-a73","cortex-a75","exynos-m1","falkor","qdf24xx","saphira","thunderx","vulcan","xgene1"and"xgene2". There's also a special name"all"โ use that and the assembler accepts instructions valid for any supported processor, including all optional extensions ๐
Beyond the basic instruction set, you can tell the assembler to accept, or restrict, various extension mnemonics that extend the processor.
If some implementations of a particular processor can have an extension, then those extensions are automatically enabled โ so normally you won't have to specify any extra extensions at all. Iconic behaviour tbh ๐
-march=architecture[+extension...]โ specifies the target architecture. Same deal: assemble an instruction that won't execute on the target architecture and you get an error message. Recognized architecture names:"armv8-a","armv8.1-a","armv8.2-a","armv8.3-a"and"armv8.4-a".
If both -mcpu and -march are specified, the assembler uses the setting for -mcpu. If neither is specified, the assembler defaults to -mcpu=all.
The architecture option can be extended with the same instruction set extension options as the -mcpu option. But unlike -mcpu, extensions are not always enabled by default ๐
-mverbose-errorโ turns on verbose error messages for AArch64 gas. This one is enabled by default, so it's already slaying for you ๐ซถ-mno-verbose-errorโ turns verbose error messages off in AArch64 gas.
๐ธ The following options are available when as is configured for an Alpha processor ๐ธ
-mcpuโ specifies the target processor. If you try to assemble an instruction that won't execute on the target processor, the assembler may either expand the instruction as a macro or issue an error message. This option is equivalent to the.archdirective.
Recognized processor names: 21064, "21064a", 21066, 21068, 21164, "21164a", "21164pc", 21264, "21264a", "21264b", "ev4", "ev5", "lca45", "ev5", "ev56", "pca56", "ev6", "ev67", "ev68". (yep, "ev5" shows up twice in there โ not me, that's the list ๐) The special name "all" lets the assembler accept instructions valid for any Alpha processor.
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-no-mdebugโ enables or disables the generation of.mdebugencapsulation for stabs directives and procedure descriptors. The default is to automatically enable.mdebugwhen the first stabs directive is seen โจ-relaxโ forces all relocations to be put into the object file, instead of saving space and resolving some relocations at assembly time. Heads up: this option does not propagate all symbol arithmetic into the object file, because not all symbol arithmetic can be represented. That said, it can still be useful in specific applications ๐ฆ-replace-noreplaceโ enables or disables the optimization of procedure calls, both at assemblage and at link time. These are only available for VMS targets, and-replaceis the default. See section 1.4.1 of the OpenVMS Linker Utility Manual ๐-gโ used when the compiler generates debug information. When gcc is using mips-tfile to generate debug information for ECOFF, local labels must be passed through to the object file. Otherwise this option has no effect, literally nothing ๐-Gsizeโ a local common symbol larger than size gets placed in.bss, while smaller symbols go in.sbss.-F-32addrโ these options are ignored for backward compatibility ๐
๐ฆ The following options are available when as is configured for an ARC processor ๐ฆ
-mcpu=cpuโ selects the core processor variant.-EB|-ELโ select either big-endian (-EB) or little-endian (-EL) output.-mcode-densityโ enable Code Density extension instructions ๐
๐ 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.-mfloat-abi=abiโ select which floating point ABI is in use.-mthumbโ enable Thumb only instruction decoding.-mapcs-32|-mapcs-26|-mapcs-float|-mapcs-reentrantโ 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.-mccsโ turns on CodeComposer Studio assembly syntax compatibility mode.-kโ specify that PIC code has been generated.
๐ The following options are available when as is configured for the Blackfin processor family ๐
-mcpu=processor[-sirevision]โ specifies the target processor. The optional sirevision is not used in the assembler; it's here so GCC can easily pass down its-mcpu=option. The assembler will issue an error message if you attempt to assemble an instruction which will not execute on the target processor. Recognized processor names:"bf504","bf506","bf512","bf514","bf516","bf518","bf522","bf523","bf524","bf525","bf526","bf527","bf531","bf532","bf533","bf534","bf535"(not implemented yet),"bf536","bf537","bf538","bf539","bf542","bf542m","bf544","bf544m","bf547","bf547m","bf548","bf548m","bf549","bf549m","bf561", and"bf592"๐-mfdpicโ assemble for the FDPIC ABI.-mno-fdpic-mnopicโ disable-mfdpic.
See the info pages for documentation of the CRIS-specific options โ yeah, they live over there, go look ๐ (Wait, you need CRIS docs? Info pages. That's the vibe.)
โญ 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 an Epiphany processor ๐ง
-mepiphanyโ specifies that both 32 and 16 bit instructions are allowed. This is the default behavior, so it's just doing its thing already ๐-mepiphany16โ restricts the permitted instructions to just the 16 bit set.
๐ The following options are available when as is configured for an H8/300 processor ๐
@chapter H8/300 Dependent Features
(no babe I didn't mistype, that line is literally in there โ we keep the lore ๐ซถ)
Options
The Renesas H8/300 version of as has one machine-dependent option:
-h-tick-hexโ support H'00 style hex constants in addition to 0x00 style.-mach=nameโ sets the H8300 machine variant. Recognized machine names:"h8300h","h8300hn","h8300s","h8300sn","h8300sx"and"h8300sxn"โจ
๐ The following options are available when as is configured for an i386 processor ๐
--32|--x32|--64โ select the word size, either 32 bits or 64 bits.--32implies Intel i386 architecture, while--x32and--64imply AMD x86-64 architecture with 32-bit or 64-bit word-size respectively.
These options are only available with the ELF object file format, and they require that the necessary BFD support has been included (on a 32-bit platform you have to add --enable-64-bit-bfd to configure to enable 64-bit usage and use x86-64 as target platform). So like, check your build first bestie ๐ญ
-nโ by default, x86 GAS replaces multiple nop instructions used for alignment within code sections with multi-byte nop instructions such asleal 0(%esi,1),%esi. This switch disables that optimization if a single byte nop (0x90) is explicitly specified as the fill byte for alignment ๐--divideโ on SVR4-derived platforms, the character/is treated as a comment character, which means it can't be used in expressions. The--divideoption turns/into a normal character. This does not disable/at the beginning of a line starting a comment, and it doesn't affect using#for starting a comment ๐-march=CPU[+EXTENSION...]โ specifies the target processor. Assemble an instruction that won't execute on the target processor and the assembler issues an error message. Recognized processor names:"i8086","i186","i286","i386","i486","i586","i686","pentium","pentiumpro","pentiumii","pentiumiii","pentium4","prescott","nocona","core","core2","corei7","l1om","k1om","iamcu","k6","k6_2","athlon","opteron","k8","amdfam10","bdver1","bdver2","bdver3","bdver4","znver1","btver1","btver2","generic32"and"generic64"๐ฆ
so like โ beyond the basic instruction set, you can also tell the assembler to accept a whole buffet of extension mnemonics. for example, -march=i686+sse4+vmx extends i686 with sse4 and vmx. the currently supported extensions are 8087, 287, 387, 687, no87, no287, no387, no687, mmx, nommx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, sse4, nosse, nosse2, nosse3, nossse3, nosse4.1, nosse4.2, nosse4, avx, avx2, noavx, noavx2, adx, rdseed, prfchw, smap, mpx, sha, rdpid, ptwrite, cet, gfni, vaes, vpclmulqdq, prefetchwt1, clflushopt, se1, clwb, avx512f, avx512cd, avx512er, avx512pf, avx512vl, avx512bw, avx512dq, avx512ifma, avx512vbmi, avx512_4fmaps, avx512_4vnniw, avx512_vpopcntdq, avx512_vbmi2, avx512_vnni, avx512_bitalg, noavx512f, noavx512cd, noavx512er, noavx512pf, noavx512vl, noavx512bw, noavx512dq, noavx512ifma, noavx512vbmi, noavx512_4fmaps, noavx512_4vnniw, noavx512_vpopcntdq, noavx512_vbmi2, noavx512_vnni, noavx512_bitalg, vmx, vmfunc, smx, xsave, xsaveopt, xsavec, xsaves, aes, pclmul, fsgsbase, rdrnd, f16c, bmi2, fma, movbe, ept, lzcnt, hle, rtm, invpcid, clflush, mwaitx, clzero, lwp, fma4, xop, cx16, syscall, rdtscp, 3dnow, 3dnowa, sse4a, sse5, svme, abm and padlock ๐
real talk though โ the mnemonics that start with no don't extend the instruction set, they revoke that functionality. like, taking it back. ๐
also important: when the .arch directive is used together with -march, the .arch directive takes precedent. periodt. ๐
-mtune=CPUโ tells the assembler which processor to optimize for. when you also pass-march, only instructions belonging to the processor named by-marchwill actually get generated. the validCPUvalues are literally the same list as-march=CPU. same list, no extra credit. โจ-msse2avxโ tells the assembler it should encode SSE instructions with a VEX prefix. that's it, that's the whole vibe. ๐ฆ-msse-check=none,-msse-check=warning,-msse-check=errorโ these three control whether the assembler checks SSE instructions at all:-msse-check=noneโ don't check SSE instructions. this is the default, bestie.-msse-check=warningโ issue a warning for any SSE instruction.-msse-check=errorโ issue an error for any SSE instruction. no chill mode.
-mavxscalar=128,-mavxscalar=256โ control how scalar AVX instructions get encoded.-mavxscalar=128โ encode them with 128bit vector length. default โจ-mavxscalar=256โ encode them with 256bit vector length.
-mevexlig=128,-mevexlig=256,-mevexlig=512โ control how length-ignored (LIG) EVEX instructions get encoded.-mevexlig=128โ 128bit vector length. default, iconic ๐-mevexlig=256โ 256bit vector length.-mevexlig=512โ 512bit vector length.
-mevexwig=0,-mevexwig=1โ control how w-ignored (WIG) EVEX instructions get encoded.-mevexwig=0โ encodes WIG EVEX instructions withevex.w = 0. default ๐-mevexwig=1โ encodes them withevex.w = 1.
-mmnemonic=att,-mmnemonic=intelโ picks which instruction mnemonic to match instructions by. heads up: the.att_mnemonicand.intel_mnemonicdirectives will take precedent ๐-msyntax=att,-msyntax=intelโ picks the instruction syntax used when processing instructions. again: the.att_syntaxand.intel_syntaxdirectives will take precedent.-mnaked-regโ says registers don't need a%prefix. (naked registers, scandalous ๐) the.att_syntaxand.intel_syntaxdirectives will take precedent.-madd-bnd-prefixโ forces the assembler to slap a BND prefix on all branches, even when the source code never explicitly asked for one. generous of it ngl.-mno-sharedโ on ELF targets the assembler normally optimizes out non-PLT relocations against defined non-weak global branch targets with default visibility. the-msharedoption tells it to instead generate code that could go into a shared library, where all non-weak global branch targets with default visibility can be preempted. resulting code is slightly bigger. this only affects how branch instructions are handled, fyi.-mbig-objโ on x86-64 PE/COFF targets this forces the big object file format, which allows more than 32768 sections. that's a lot of sections bestie ๐ญ-momit-lock-prefix=no,-momit-lock-prefix=yesโ control how the assembler encodes the lock prefix. this one is a workaround for processors that fail on lock prefix.-momit-lock-prefix=yesโ omits all lock prefixes.-momit-lock-prefix=noโ encodes lock prefix as usual. default
โ ๏ธ seriously though: this option can only be safely used on single-core, single-thread computers. like, read that twice. ๐
-mfence-as-lock-add=no,-mfence-as-lock-add=yesโ control howlfence,mfenceandsfenceget encoded.-mfence-as-lock-add=yesโ encodeslfence,mfenceandsfenceaslock addl $0x0, (%rsp)in 64-bit mode, andlock addl $0x0, (%esp)in 32-bit mode.-mfence-as-lock-add=noโ encodes them as usual. default โจ
-mrelax-relocations=no,-mrelax-relocations=yesโ control whether the assembler generates relax relocations:R_386_GOT32Xin 32-bit mode, orR_X86_64_GOTPCRELXandR_X86_64_REX_GOTPCRELXin 64-bit mode.-mrelax-relocations=yesโ generate relax relocations.-mrelax-relocations=noโ don't.
the default can be controlled by a configure option: --enable-x86-relax-relocations ๐ ๏ธ
-mevexrcig=rne,-mevexrcig=rd,-mevexrcig=ru,-mevexrcig=rzโ control how SAE-only EVEX instructions get encoded.-mevexrcig=rneโ encodes the RC bits of the EVEX instruction with00. default ๐-mevexrcig=rdโ01RC bits.-mevexrcig=ruโ10RC bits.-mevexrcig=rzโ11RC bits.
-mamd64,-mintel64โ says the assembler should accept only AMD64 or only Intel64 ISA in 64-bit mode. the default is to accept both, because why choose ๐
๐น๏ธ when as is configured for the Intel 80960 processor
the following options are available:
-ACA|-ACA_A|-ACB|-ACC|-AKA|-AKB|-AKC|-AMCโ pick which variant of the 960 architecture is the target.-bโ add code to collect statistics about branches taken. data girlie behavior ๐-no-relaxโ do not alter compare-and-branch instructions for long displacements; error if necessary. it will simply โจrefuseโจ
๐ when as is configured for the Ubicom IP2K series
-mip2022extโ says the extended IP2022 instructions are allowed.-mip2022โ restores the default behaviour, which restricts the permitted instructions to just the basic IP2022 ones. back to basics, no extras ๐
๐ธ when as is configured for the Renesas M32C and M16C processors
-m32cโ assemble M32C instructions.-m16cโ assemble M16C instructions. this one's the default.-relaxโ enable support for link-time relaxations.-h-tick-hexโ supportH'00style hex constants in addition to0x00style. two hex flavors, both valid ๐
๐ฆ when as is configured for the Renesas M32R (formerly 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-conflictsor--Wpโ produce warning messages when questionable parallel constructs are encountered. questionable!! ๐--no-warn-explicit-parallel-conflictsor--Wnpโ do not produce warning messages when questionable parallel constructs are encountered.
๐ง when as is configured for the Motorola 68000 series
-lโ shorten references to undefined symbols, to one word instead of two. little savings, big icon energy โจ-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 the68020, 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. default is to assume a coprocessor for68020,68030, andcpu32. and like, even though the basic 68000 isn't compatible with the 68881, you can specify a combination of the two, because it's possible to emulate the coprocessor instructions with the main processor. loophole slay ๐-m68851|-mno-68851โ the target machine does (or does not) have a memory-management unit coprocessor. default is to assume an MMU for 68020 and up.
๐ when as is configured for an Altera Nios II processor
-relax-sectionโ replace identified out-of-range branches with PC-relativejmpsequences when possible. the generated code sequences are suitable for position-independent code, but there's a practical limit on the extended branch range because of the length of the sequences. this option is the default โจ-relax-allโ replace branch instructions that can't be determined to be in range, plus all call instructions, withjmpandcallrsequences respectively. this generates absolute relocations against the target symbols and is not appropriate for position-independent code. ๐จ-no-relaxโ do not replace any branches or calls.-EBโ generate big-endian output.-ELโ generate little-endian output. this is the default ๐-march=architectureโ specifies the target architecture. the assembler issues an error message if you try to assemble an instruction which will not execute on the target architecture. recognized architecture names arer1andr2. the default isr1. (yes, another-march, different context, don't @ me ๐ญ)
๐งต when as is configured for a PRU processor
okay soโ
-mlink-relaxโ tellsasto assume LD is gonna do that cute LDI32 glow-up: LD peeks at the upper 16 bits of the expression, and if they're all zeros it shortens LDI32 down to a single LDI. In that scenarioasoutputs DIFF relocations for diff expressions. slay for LD ๐-mno-link-relaxโ opposite vibe: assume LD will not optimize LDI32 instructions. consequence? DIFF relocations don't get emitted at all. โจ-mno-warn-regname-labelโ turns off the warning you'd normally get when a label name matches a register name. ngl, assembler programmers usually want that warning, but C compilers may wanna turn it off. ๐ซถ
๐ธ MIPS time!! ๐ธ
The following options are available when as is configured for a MIPS processor. buckle up bestie, there's a lot ๐
-G numโ sets the largest size of an object that can be referenced implicitly with thegpregister. only accepted for targets that use ECOFF format, like a DECstation running Ultrix. default value is8. ๐-EBโ generate "big endian" format output.-ELโ generate "little endian" format output. (the endian girlies stay winning ๐ )-mips1,-mips2,-mips3,-mips4,-mips5,-mips32,-mips32r2,-mips32r3,-mips32r5,-mips32r6,-mips64,-mips64r2,-mips64r3,-mips64r5,-mips64r6โ generate code for a particular MIPS Instruction Set Architecture level. the tea โ:-mips1is an alias for-march=r3000-mips2is an alias for-march=r6000-mips3is an alias for-march=r4000-mips4is an alias for-march=r8000-mips5,-mips32,-mips32r2,-mips32r3,-mips32r5,-mips32r6,-mips64,-mips64r2,-mips64r3,-mips64r5, and-mips64r6correspond to generic MIPS V, MIPS32, MIPS32 Release 2, MIPS32 Release 3, MIPS32 Release 5, MIPS32 Release 6, MIPS64, MIPS64 Release 2, MIPS64 Release 3, MIPS64 Release 5, and MIPS64 Release 6 ISA processors, respectively. periodt โจ
-march=cpuโ generate code for a particular MIPS CPU. ๐-mtune=cpuโ schedule and tune for a particular MIPS CPU.-mfix7000,-mno-fix7000โ cause nops to be inserted if the read of the destination register of anmfhiormfloinstruction occurs in the following two instructions.-mfix-rm7000,-mno-fix-rm7000โ cause nops to be inserted if admultordmultuinstruction is followed by a load instruction.-mdebug,-no-mdebugโ cause stabs-style debugging output to go into an ECOFF-style.mdebugsection instead of the standard ELF.stabssections. ๐-mpdr,-mno-pdrโ control generation of.pdrsections.-mgp32,-mfp32โ register sizes are normally inferred from the ISA and ABI, but these flags force a certain group of registers to be treated as 32 bits wide at all times.-mgp32controls the size of general-purpose registers and-mfp32controls the size of floating-point registers.-mgp64,-mfp64โ same deal but 64 bits, always.-mgp64controls the size of general-purpose registers and-mfp64controls the size of floating-point registers.-mfpxxโ register sizes are normally inferred from the ISA and ABI, but using this flag in combination with-mabi=32enables an ABI variant which will operate correctly with floating-point registers which are 32 or 64 bits wide. flexible queen ๐-modd-spreg,-mno-odd-spregโ enable use of floating-point operations on odd-numbered single-precision registers when supported by the ISA.-mfpxximplies-mno-odd-spreg, otherwise the default is-modd-spreg.-mips16,-no-mips16โ generate code for the MIPS 16 processor. equivalent to putting.module mips16at the start of the assembly file.-no-mips16turns off this option.-mmips16e2,-mno-mips16e2โ enable the use of MIPS16e2 instructions in MIPS16 mode. equivalent to putting.module mips16e2at the start of the assembly file.-mno-mips16e2turns off this option.-mmicromips,-mno-micromipsโ generate code for the microMIPS processor. equivalent to putting.module micromipsat the start of the assembly file.-mno-micromipsturns off this option. that one is equivalent to putting.module nomicromipsat the start of the assembly file. little lowercase era ๐-msmartmips,-mno-smartmipsโ enables the SmartMIPS extension to the MIPS32 instruction set. equivalent to putting.module smartmipsat the start of the assembly file.-mno-smartmipsturns off this option.-mips3d,-no-mips3dโ generate code for the MIPS-3D Application Specific Extension. tells the assembler to accept MIPS-3D instructions.-no-mips3dturns off this option.-mdmx,-no-mdmxโ generate code for the MDMX Application Specific Extension. tells the assembler to accept MDMX instructions.-no-mdmxturns off this option.-mdsp,-mno-dspโ generate code for the DSP Release 1 Application Specific Extension. tells the assembler to accept DSP Release 1 instructions.-mno-dspturns off this option.-mdspr2,-mno-dspr2โ generate code for the DSP Release 2 Application Specific Extension. this option implies-mdsp. tells the assembler to accept DSP Release 2 instructions.-mno-dspr2turns off this option.-mdspr3,-mno-dspr3โ generate code for the DSP Release 3 Application Specific Extension. this option implies-mdspand-mdspr2. tells the assembler to accept DSP Release 3 instructions.-mno-dspr3turns off this option.-mmsa,-mno-msaโ generate code for the MIPS SIMD Architecture Extension. tells the assembler to accept MSA instructions.-mno-msaturns off this option.-mxpa,-mno-xpaโ generate code for the MIPS eXtended Physical Address (XPA) Extension. tells the assembler to accept XPA instructions.-mno-xpaturns off this option.-mmt,-mno-mtโ generate code for the MT Application Specific Extension. tells the assembler to accept MT instructions.-mno-mtturns off this option.-mmcu,-mno-mcuโ generate code for the MCU Application Specific Extension. tells the assembler to accept MCU instructions.-mno-mcuturns off this option.-minsn32,-mno-insn32โ only use 32-bit instruction encodings when generating code for the microMIPS processor. this option inhibits the use of any 16-bit instructions. equivalent to putting.set insn32at the start of the assembly file.-mno-insn32turns off this option, and it's equivalent to putting.set noinsn32at the start of the assembly file. by default-mno-insn32is selected, allowing all instructions to be used. ๐ซถ--construct-floats,--no-construct-floatsโ the--no-construct-floatsoption disables the construction of double width floating point constants by loading the two halves of the value into the two single width floating point registers that make up the double width register. by default--construct-floatsis selected, allowing construction of these floating point constants. โจ--relax-branch,--no-relax-branchโ the--relax-branchoption enables the relaxation of out-of-range branches. by default--no-relax-branchis selected, causing any out-of-range branches to produce an error. no chill, just error ๐-mignore-branch-isa,-mno-ignore-branch-isaโ ignore branch checks for invalid transitions between ISA modes. here's the lore: the semantics of branches does not provide for an ISA mode switch, so in most cases the ISA mode a branch has been encoded for has to be the same as the ISA mode of the branch's target label. so GAS has checks implemented that verify in branch assembly that the two ISA modes match.-mignore-branch-isadisables these checks. by default-mno-ignore-branch-isais selected, causing any invalid branch requiring a transition between ISA modes to produce an error. ๐จ-mnan=encodingโ pick between the IEEE 754-2008 (-mnan=2008) or the legacy (-mnan=legacy) NaN encoding format. the latter is the default. ngl, legacy is giving vintage ๐--emulation=nameโ ok so this one used to switch between ELF and ECOFF output on targets like IRIX 5 that supported both. MIPS ECOFF support was removed in GAS 2.24, so the option now serves little purpose. it's retained for backwards compatibility only. the available configuration names are:mipself,mipslelfandmipsbelf. choosingmipselfnow has no effect, since the output is always ELF.mipslelfandmipsbelfselect little- and big-endian output respectively, but-ELand-EBare now the preferred options instead. ๐ฆ-nocppโasignores this option. it's accepted for compatibility with the native tools. the "seen but not heard" icon ๐--trap,--no-trap,--break,--no-breakโ control how to deal with multiplication overflow and division by zero.--trapor--no-break(which are synonyms) take a trap exception, and those only work for Instruction Set Architecture level 2 and higher.--breakor--no-trap(also synonyms, and the default) take a break exception. ๐ญ-nโ when this option is used,aswill issue a warning every time it generates a nop instruction from a macro. lil nop watchdog, honestly iconic ๐
๐ง Meta processor zone ๐ง
The following options are available when as is configured for a Meta processor.
-mcpu=metac11โ generate code for Meta 1.1.-mcpu=metac12โ generate code for Meta 1.2.-mcpu=metac21โ generate code for Meta 2.1.-mfpu=metac21โ allow code to use FPU hardware of Meta 2.1. ๐ฅ
lowkey important aside: see the info pages for documentation of the MMIX-specific options. not here bestie, different page ๐
๐บ NDS32 processor section ๐บ
The following options are available when as is configured for a NDS32 processor.
-O1โ optimize for performance.-Osโ optimize for space.-ELโ produce little endian data output.-EBโ produce little endian data output.-mpicโ generate PIC.-mno-fp-as-gp-relaxโ suppress fp-as-gp relaxation for this file.-mb2bb-relaxโ back-to-back branch optimization.-mno-all-relaxโ suppress all relaxation for this file.-march=<arch name>โ assemble for architecture <arch name> which could bev3,v3j,v3m,v3f,v3s,v2,v2j,v2f,v2s.-mbaseline=<baseline>โ assemble for baseline <baseline> which could bev2,v3,v3m.-mfpu-freg=FREGโ specify a FPU configuration.
ok do not come for me about -EB up there saying "little endian" ๐ that is word-for-word what the page says, I am simply the messenger, copy-paste accuracy is my whole brand ๐ซถ
"0"โ 8 SP / 4 DP registers"1"โ 16 SP / 8 DP registers"2"โ 32 SP / 16 DP registers"3"โ 32 SP / 32 DP registers-mabi=abiโ pick an abi version, bestie. abi can bev1,v2,v2fp, orv2fpp.-m[no-]macโ turn Multiply instructions support on/off.-m[no-]divโ turn Divide instructions support on/off.-m[no-]16bit-extโ turn the 16-bit extension on/off.-m[no-]dx-regsโ turn thed0/d1registers on/off.-m[no-]perf-extโ turn Performance extension on/off.-m[no-]perf2-extโ turn Performance extension 2 on/off.-m[no-]string-extโ turn String extension on/off.-m[no-]reduced-regsโ turn the Reduced Register configuration (GPR16) option on/off.-m[no-]audio-isa-extโ turn the AUDIO ISA extension on/off.-m[no-]fpu-sp-extโ turn the FPU SP extension on/off.-m[no-]fpu-dp-extโ turn the FPU DP extension on/off.-m[no-]fpu-fmaโ turn FPU fused-multiply-add instructions on/off.-mall-extโ turn on all extensions and instructions support. literally the "select all" checkbox of assembler flags ๐
๐ฆ when as is configured for a PowerPC processor
these are the options you get, and there areโฆ a lot of them. buckle up bestie ๐
-a32โ generate ELF32 or XCOFF32.-a64โ generate ELF64 or XCOFF64.-K PICโ setEF_PPC_RELOCATABLE_LIBin ELF flags.-mpwrx|-mpwr2โ generate code for POWER/2 (RIOS2).-mpwrโ generate code for POWER (RIOS1).-m601โ generate code for PowerPC 601.-mppc,-mppc32,-m603,-m604โ generate code for PowerPC 603/604.-m403,-m405โ generate code for PowerPC 403/405.-m440โ generate code for PowerPC 440. BookE and some 405 instructions.-m464โ generate code for PowerPC 464.-m476โ generate code for PowerPC 476.-m7400,-m7410,-m7450,-m7455โ generate code for PowerPC 7400/7410/7450/7455.-m750clโ generate code for PowerPC 750CL.-m821,-m850,-m860โ generate code for PowerPC 821/850/860.-mppc64,-m620โ generate code for PowerPC 620/625/630.-me500,-me500x2โ generate code for Motorola e500 core complex.-me500mcโ generate code for Freescale e500mc core complex.-me500mc64โ generate code for Freescale e500mc64 core complex.-me5500โ generate code for Freescale e5500 core complex.-me6500โ generate code for Freescale e6500 core complex.-mspeโ generate code for Motorola SPE instructions.-mspe2โ generate code for Freescale SPE2 instructions.-mtitanโ generate code for AppliedMicro Titan core complex.-mppc64bridgeโ generate code for PowerPC 64, including bridge insns.-mbookeโ generate code for 32-bit BookE.-ma2โ generate code for A2 architecture.-me300โ generate code for PowerPC e300 family.-maltivecโ generate code for processors with AltiVec instructions.-mvleโ generate code for Freescale PowerPC VLE instructions.-mvsxโ generate code for processors with Vector-Scalar (VSX) instructions.-mhtmโ generate code for processors with Hardware Transactional Memory instructions.-mpower4,-mpwr4โ generate code for Power4 architecture.-mpower5,-mpwr5,-mpwr5xโ generate code for Power5 architecture.-mpower6,-mpwr6โ generate code for Power6 architecture.-mpower7,-mpwr7โ generate code for Power7 architecture.-mpower8,-mpwr8โ generate code for Power8 architecture.-mpower9,-mpwr9โ generate code for Power9 architecture.-mcellโ generate code for Cell Broadband Engine architecture. (it's listed twice in the original โ she contains multitudes ๐)-mcomโ generate code Power/PowerPC common instructions.-manyโ generate code for any architecture (PWR/PWRX/PPC).-mregnamesโ allow symbolic names for registers.-mno-regnamesโ do not allow symbolic names for registers.-mrelocatableโ support for GCC's-mrelocatableoption.-mrelocatable-libโ support for GCC's-mrelocatable-liboption.-membโ setPPC_EMBbit in ELF flags.-mlittle,-mlittle-endian,-leโ generate code for a little endian machine.-mbig,-mbig-endian,-beโ generate code for a big endian machine.-msolarisโ generate code for Solaris.-mno-solarisโ do not generate code for Solaris.-nops=countโ if an alignment directive inserts more than count nops, put a branch at the beginning to skip execution of the nops. lowkey genius โจ
๐ธ when as is configured for a RISC-V processor
-fpic-fPICโ generate position-independent code. (same energy, two spellings ๐ซถ)-fno-picโ don't generate position-independent code (default).-march=ISAโ select the base isa, as specified by ISA. for example-march=rv32ima.-mabi=ABIโ selects the ABI, which is either"ilp32"or"lp64", optionally followed by"f","d", or"q"to indicate single-precision, double-precision, or quad-precision floating-point calling convention, or none to indicate the soft-float calling convention.
๐ RX-specific options
see the info pages for documentation of the RX-specific options. that's the whole vibe check, go read the info pages bestie ๐
โญ when as is configured for the s390 processor family
-m31-m64โ select the word size, either 31/32 bits or 64 bits.-mesa-mzarchโ select the architecture mode, either the Enterprise System Architecture (esa) or the z/Architecture mode (zarch).-march=processorโ specify which s390 processor variant is the target:g5(orarch3),g6,z900(orarch5),z990(orarch6),z9-109,z9-ec(orarch7),z10(orarch8),z196(orarch9),zEC12(orarch10),z13(orarch11), orz14(orarch12). pick your fighter ๐ค-mregnames-mno-regnamesโ allow or disallow symbolic names for registers.-mwarn-areg-zeroโ warn whenever the operand for a base or index register has been specified but evaluates to zero. honestly? it's just looking out for you ๐ซถ
๐ฅ when as is configured for a TMS320C6000 processor
-march=archโ enable (only) instructions from architecture arch. by default, all instructions are permitted.
the following values of arch are accepted: "c62x", "c64x", "c64x+", "c67x", "c67x+", "c674x".
-mdsbt-mno-dsbtโ the-mdsbtoption causes the assembler to generate the"Tag_ABI_DSBT"attribute with a value of 1, indicating that the code is using DSBT addressing. the-mno-dsbtoption, 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. โ ๏ธ-mpid=no-mpid=near-mpid=farโ the-mpid=option causes the assembler to generate the"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=nearindicates position-independent addressing with GOT accesses using near DP addressing, and-mpid=farindicates 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. โ ๏ธ-mpic-mno-picโ the-mpicoption causes the assembler to generate the"Tag_ABI_PIC"attribute with a value of 1, indicating that the code is using position-independent code addressing. the-mno-picoption, 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. โ ๏ธ-mbig-endian-mlittle-endianโ generate code for the specified endianness. the default is little-endian.
๐ when as is configured for a TILE-Gx processor
-m32|-m64โ select the word size, either 32 bits or 64 bits.-EB|-ELโ select the endianness, either big-endian (-EB) or little-endian (-EL).
๐ง when as is configured for a Visium processor
-mtune=archโ this option specifies the target architecture. if an attempt is made to assemble an instruction that will not execute on the target architecture, the assembler will issue an error message. ๐ญ
the following names are recognized: "mcm24" "mcm" "gr5" "gr6"
๐ when as is configured for an Xtensa processor
--text-section-literals|--no-text-section-literalsโ control the treatment of literal pools. the default is--no-text-section-literals, which places literals in separate sections in the output file. this allows the literal pool to be placed in a data RAM/ROM. with--text-section-literals, the literals are interspersed in the text section in order to keep them as close as possible to their references. this may be necessary for large assembly files, where the literals would otherwise be out of range of the"L32R"instructions in the text section. literals are grouped into pools following.literal_positiondirectives or precedingENTRYinstructions. these options only affect literals referenced via PC-relative"L32R"instructions; literals for absolute mode"L32R"instructions are handled separately.--auto-litpools|--no-auto-litpoolsโ control the treatment of literal pools (yes, again, they're siblings ๐ฏ). the default is--no-auto-litpools, which in the absence of--text-section-literalsplaces literals in separate sections in the output file. this allows the literal pool to be placed in a data RAM/ROM. with--auto-litpools, the literals are interspersed in the text section in order to keep them as close as possible to their references, explicit.literal_positiondirectives are not required. this may be necessary for very large functions, where single literal pool at the beginning of the function may not be reachable by"L32R"instructions at the end. these options only affect literals referenced via PC-relative"L32R"instructions; literals for absolute mode"L32R"instructions are handled separately. when used together with--text-section-literals,--auto-litpoolstakes precedence. ๐--absolute-literals|--no-absolute-literalsโ okay so this tells the assembler whetherL32Rinstructions use absolute or PC-relative addressing. If the processor includes the absolute addressing option, the default is to use absoluteL32Rrelocations. Otherwise, only the PC-relativeL32Rrelocations can be used. ๐--target-align|--no-target-alignโ enable or disable automatic alignment to reduce branch penalties, at some expense in code size. This optimization is enabled by default. Note that the assembler will always align instructions likeLOOPthat have fixed alignment requirements. โจ--longcalls|--no-longcallsโ enable or disable transformation of call instructions so calls can reach a greater range of addresses. Use this when call targets can potentially be out of range. It may degrade both code size and performance, but the linker can generally optimize away the unnecessary overhead when a call ends up within range. The default is--no-longcalls. ๐--transform|--no-transformโ enable or disable all assembler transformations of Xtensa instructions, including both relaxation and optimization. The default is--transform;--no-transformshould only be used in the rare cases when the instructions must be exactly as specified in the assembly source. Using--no-transformcauses out of range instruction operands to be errors. โ ๏ธ--rename-section oldname=newnameโ rename theoldnamesection tonewname. This option can be used multiple times to rename multiple sections. ๐--trampolines|--no-trampolinesโ enable or disable transformation of jump instructions so jumps can reach a greater range of addresses. Use this when jump targets can potentially be out of range. In the absence of such jumps this option does not affect code size or performance. The default is--trampolines. ๐ฆ
The following options are available when as is configured for a Z80 family processor. ๐น๏ธ
-z80โ assemble for Z80 processor. ๐พ-r800โ assemble for R800 processor. ๐ฎ-ignore-undocumented-instructions,-Wnudโ assemble undocumented Z80 instructions that also work on R800 without warning. ๐-ignore-unportable-instructions,-Wnupโ assemble all undocumented Z80 instructions without warning. ๐-warn-undocumented-instructions,-Wudโ issue a warning for undocumented Z80 instructions that also work on R800. โ ๏ธ-warn-unportable-instructions,-Wupโ issue a warning for undocumented Z80 instructions that do not work on R800. ๐จ-forbid-undocumented-instructions,-Fudโ treat all undocumented instructions as errors. โ-forbid-unportable-instructions,-Fupโ treat undocumented Z80 instructions that do not work on R800 as errors. ๐
๐ซถ SEE ALSO ๐ซถ
gcc(1), ld(1), and the Info entries for binutils and ld. iykyk, those are the next besties to check. ๐
๐ COPYRIGHT ๐
Copyright (c) 1991-2018 Free Software Foundation, Inc. ๐
Okay, legal moment, no skipping: 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". periodt. ๐
Source/version: binutils-2.30 โ dated 2018-01-27 โ page: AS(1). That's the whole iconic footer vibe, bestie: go assemble something legendary. ๐
โจ
๐ฆ where this page comes from
- nixpkgs unstable: djgpp 12.2.0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms