📄 as.texinfo
字号:
listing-control directives have no effect.The letters after @samp{-a} may be combined into one option,@emph{e.g.}, @samp{-aln}.@node D@section @code{-D}@kindex -DThis option has no effect whatsoever, but it is accepted to make it morelikely that scripts written for other assemblers also work with@code{@value{AS}}.@node f@section Work Faster: @code{-f}@kindex -f@cindex trusted compiler@cindex faster processing (@code{-f})@samp{-f} should only be used when assembling programs written by a(trusted) compiler. @samp{-f} stops the assembler from doing whitespaceand comment preprocessing onthe input file(s) before assembling them. @xref{Preprocessing,,Preprocessing}.@quotation@emph{Warning:} if you use @samp{-f} when the files actually need to bepreprocessed (if they contain comments, for example), @code{@value{AS}} doesnot work correctly.@end quotation@node I@section @code{.include} search path: @code{-I} @var{path}@kindex -I @var{path}@cindex paths for @code{.include}@cindex search path for @code{.include}@cindex @code{include} directive search pathUse this option to add a @var{path} to the list of directories@code{@value{AS}} searches for files specified in @code{.include}directives (@pxref{Include,,@code{.include}}). You may use @code{-I} asmany times as necessary to include a variety of paths. The currentworking directory is always searched first; after that, @code{@value{AS}}searches any @samp{-I} directories in the same order as they werespecified (left to right) on the command line.@node K@section Difference Tables: @code{-K}@kindex -K@ifclear DIFF-TBL-KLUGEOn the @value{TARGET} family, this option is allowed, but has no effect. It ispermitted for compatibility with the @sc{gnu} assembler on other platforms,where it can be used to warn when the assembler alters the machine codegenerated for @samp{.word} directives in difference tables. The @value{TARGET}family does not have the addressing limitations that sometimes lead to thisalteration on other platforms.@end ifclear@ifset DIFF-TBL-KLUGE@cindex difference tables, warning@cindex warning for altered difference tables@code{@value{AS}} sometimes alters the code emitted for directives of the form@samp{.word @var{sym1}-@var{sym2}}; @pxref{Word,,@code{.word}}.You can use the @samp{-K} option if you want a warning issued when thisis done.@end ifset@node L@section Include Local Labels: @code{-L}@kindex -L@cindex local labels, retaining in outputLabels beginning with @samp{L} (upper case only) are called @dfn{locallabels}. @xref{Symbol Names}. Normally you do not see such labels whendebugging, because they are intended for the use of programs (likecompilers) that compose assembler programs, not for your notice.Normally both @code{@value{AS}} and @code{@value{LD}} discard such labels, so you do notnormally debug with them.This option tells @code{@value{AS}} to retain those @samp{L@dots{}} symbolsin the object file. Usually if you do this you also tell the linker@code{@value{LD}} to preserve symbols whose names begin with @samp{L}.By default, a local label is any label beginning with @samp{L}, but eachtarget is allowed to redefine the local label prefix.@ifset HPPAOn the HPPA local labels begin with @samp{L$}.@end ifset@node M@section Assemble in MRI Compatibility Mode: @code{-M}@kindex -M@cindex MRI compatibility modeThe @code{-M} or @code{--mri} option selects MRI compatibility mode. Thischanges the syntax and pseudo-op handling of @code{@value{AS}} to make itcompatible with the @code{ASM68K} or the @code{ASM960} (depending upon theconfigured target) assembler from Microtec Research. The exact nature of theMRI syntax will not be documented here; see the MRI manuals for moreinformation. Note in particular that the handling of macros and macroarguments is somewhat different. The purpose of this option is to permitassembling existing MRI assembler code using @code{@value{AS}}.The MRI compatibility is not complete. Certain operations of the MRI assemblerdepend upon its object file format, and can not be supported using other objectfile formats. Supporting these would require enhancing each object file formatindividually. These are:@itemize @bullet@item global symbols in common sectionThe m68k MRI assembler supports common sections which are merged by the linker.Other object file formats do not support this. @code{@value{AS}} handlescommon sections by treating them as a single common symbol. It permits localsymbols to be defined within a common section, but it can not support globalsymbols, since it has no way to describe them.@item complex relocationsThe MRI assemblers support relocations against a negated section address, andrelocations which combine the start addresses of two or more sections. Theseare not support by other object file formats.@item @code{END} pseudo-op specifying start addressThe MRI @code{END} pseudo-op permits the specification of a start address.This is not supported by other object file formats. The start address mayinstead be specified using the @code{-e} option to the linker, or in a linkerscript.@item @code{IDNT}, @code{.ident} and @code{NAME} pseudo-opsThe MRI @code{IDNT}, @code{.ident} and @code{NAME} pseudo-ops assign a modulename to the output file. This is not supported by other object file formats.@item @code{ORG} pseudo-opThe m68k MRI @code{ORG} pseudo-op begins an absolute section at a givenaddress. This differs from the usual @code{@value{AS}} @code{.org} pseudo-op,which changes the location within the current section. Absolute sections arenot supported by other object file formats. The address of a section may beassigned within a linker script.@end itemizeThere are some other features of the MRI assembler which are not supported by@code{@value{AS}}, typically either because they are difficult or because theyseem of little consequence. Some of these may be supported in future releases.@itemize @bullet@item EBCDIC stringsEBCDIC strings are not supported.@item packed binary coded decimalPacked binary coded decimal is not supported. This means that the @code{DC.P}and @code{DCB.P} pseudo-ops are not supported.@item @code{FEQU} pseudo-opThe m68k @code{FEQU} pseudo-op is not supported.@item @code{NOOBJ} pseudo-opThe m68k @code{NOOBJ} pseudo-op is not supported.@item @code{OPT} branch control optionsThe m68k @code{OPT} branch control options---@code{B}, @code{BRS}, @code{BRB},@code{BRL}, and @code{BRW}---are ignored. @code{@value{AS}} automaticallyrelaxes all branches, whether forward or backward, to an appropriate size, sothese options serve no purpose.@item @code{OPT} list control optionsThe following m68k @code{OPT} list control options are ignored: @code{C},@code{CEX}, @code{CL}, @code{CRE}, @code{E}, @code{G}, @code{I}, @code{M},@code{MEX}, @code{MC}, @code{MD}, @code{X}.@item other @code{OPT} optionsThe following m68k @code{OPT} options are ignored: @code{NEST}, @code{O},@code{OLD}, @code{OP}, @code{P}, @code{PCO}, @code{PCR}, @code{PCS}, @code{R}.@item @code{OPT} @code{D} option is defaultThe m68k @code{OPT} @code{D} option is the default, unlike the MRI assembler.@code{OPT NOD} may be used to turn it off.@item @code{XREF} pseudo-op.The m68k @code{XREF} pseudo-op is ignored.@item @code{.debug} pseudo-opThe i960 @code{.debug} pseudo-op is not supported.@item @code{.extended} pseudo-opThe i960 @code{.extended} pseudo-op is not supported.@item @code{.list} pseudo-op.The various options of the i960 @code{.list} pseudo-op are not supported.@item @code{.optimize} pseudo-opThe i960 @code{.optimize} pseudo-op is not supported.@item @code{.output} pseudo-opThe i960 @code{.output} pseudo-op is not supported.@item @code{.setreal} pseudo-opThe i960 @code{.setreal} pseudo-op is not supported.@end itemize@node MD@section Dependency tracking: @code{--MD}@kindex --MD@cindex dependency tracking@cindex make rules@code{@value{AS}} can generate a dependency file for the file it creates. Thisfile consists of a single rule suitable for @code{make} describing thedependencies of the main source file.The rule is written to the file named in its argument.This feature is used in the automatic updating of makefiles.@node o@section Name the Object File: @code{-o}@kindex -o@cindex naming object file@cindex object file nameThere is always one object file output when you run @code{@value{AS}}. Bydefault it has the name@ifset GENERIC@ifset I960@file{a.out} (or @file{b.out}, for Intel 960 targets only).@end ifset@ifclear I960@file{a.out}.@end ifclear@end ifset@ifclear GENERIC@ifset I960@file{b.out}.@end ifset@ifclear I960@file{a.out}.@end ifclear@end ifclearYou use this option (which takes exactly one filename) to give theobject file a different name.Whatever the object file is called, @code{@value{AS}} overwrites anyexisting file of the same name.@node R@section Join Data and Text Sections: @code{-R}@kindex -R@cindex data and text sections, joining@cindex text and data sections, joining@cindex joining text and data sections@cindex merging text and data sections@code{-R} tells @code{@value{AS}} to write the object file as if alldata-section data lives in the text section. This is only done atthe very last moment: your binary data are the same, but datasection parts are relocated differently. The data section part ofyour object file is zero bytes long because all its bytes areappended to the text section. (@xref{Sections,,Sections and Relocation}.)When you specify @code{-R} it would be possible to generate shorteraddress displacements (because we do not have to cross between text anddata section). We refrain from doing this simply for compatibility witholder versions of @code{@value{AS}}. In future, @code{-R} may work this way.@ifset COFFWhen @code{@value{AS}} is configured for COFF output,this option is only useful if you use sections named @samp{.text} and@samp{.data}.@end ifset@ifset HPPA@code{-R} is not supported for any of the HPPA targets. Using@code{-R} generates a warning from @code{@value{AS}}.@end ifset@node statistics@section Display Assembly Statistics: @code{--statistics}@kindex --statistics@cindex statistics, about assembly@cindex time, total for assembly@cindex space used, maximum for assemblyUse @samp{--statistics} to display two statistics about the resources used by@code{@value{AS}}: the maximum amount of space allocated during the assembly(in bytes), and the total execution time taken for the assembly (in @sc{cpu}seconds).@node traditional-format@section Compatible output: @code{--traditional-format}@kindex --traditional-formatFor some targets, the output of @code{@value{AS}} is different in some waysfrom the output of some existing assembler. This switch requests@code{@value{AS}} to use the traditional format instead.For example, it disables the exception frame optimizations which@code{@value{AS}} normally does by default on @code{@value{GCC}} output.@node v@section Announce Version: @code{-v}@kindex -v@kindex -version@cindex assembler version@cindex version of assemblerYou can find out what version of as is running by including theoption @samp{-v} (which you can also spell as @samp{-version}) on thecommand line.@node W@section Control Warnings: @code{-W}, @code{--warn}, @code{--no-warn}, @code{--fatal-warnings}@code{@value{AS}} should never give a warning or error message whenassembling compiler output. But programs written by people oftencause @code{@value{AS}} to give a warning that a particular assumption wasmade. All such warnings are directed to the standard error file.@kindex @samp{-W}@kindex @samp{--no-warn}@cindex suppressing warnings@cindex warnings, suppressingIf you use the @code{-W} and @code{--no-warn} options, no warnings are issued.This only affects the warning messages: it does not change any particular ofhow @code{@value{AS}} assembles your file. Errors, which stop the assembly,are still reported.@kindex @samp{--fatal-warnings}@cindex errors, caused by warnings@cindex warnings, causing errorIf you use the @code{--fatal-warnings} option, @code{@value{AS}} considersfiles that generate warnings to be in error.@kindex @samp{--warn}@cindex warnings, switching onYou can switch these options off again by specifying @code{--warn}, whichcauses warnings to be output as usual.@node Z@section Generate Object File in Spite of Errors: @code{-Z}@cindex object file, after errors@cindex errors, continuing afterAfter an error message, @code{@value{AS}} normally produces no output. If forsome reason you are interested in object file output even after@code{@value{AS}} gives an error message on your program, use the @samp{-Z}option. If there are any errors, @code{@value{AS}} continues anyways, andwrites an object file after a final warning message of the form @samp{@var{n}errors, @var{m} warnings, generating bad object file.}@node Syntax@chapter Syntax@cindex machine-independent syntax@cindex syntax, machine-independentThis chapter describes the machine-independent syntax allowed in asource file. @code{@value{AS}} syntax is similar to what many otherassemblers use; it is inspired by the BSD 4.2@ifclear VAXassembler.@end ifclear@ifset VAXassembler, except that @code{@value{AS}} does not assemble Vax bit-fields.@end ifset@menu* Preprocessing:: Preprocessing* Whitespace:: Whitespace* Comments:: Comments* Symbol Intro:: Symbols* Statements:: Statements
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -