📄 c-hppa.texi
字号:
@c Copyright 1991, 1992, 1993, 1994, 1995, 1998@c Free Software Foundation, Inc.@c This is part of the GAS manual.@c For copying conditions, see the file as.texinfo.@page@node HPPA-Dependent@chapter HPPA Dependent Features@cindex support@menu* HPPA Notes:: Notes* HPPA Options:: Options* HPPA Syntax:: Syntax* HPPA Floating Point:: Floating Point* HPPA Directives:: HPPA Machine Directives* HPPA Opcodes:: Opcodes@end menu@node HPPA Notes@section NotesAs a back end for @sc{gnu} @sc{cc} @code{@value{AS}} has been throughly tested and shouldwork extremely well. We have tested it only minimally on hand written assemblycode and no one has tested it much on the assembly output from the HPcompilers.The format of the debugging sections has changed since the original@code{@value{AS}} port (version 1.3X) was released; therefore,you must rebuild all HPPA objects and libraries with the new assembler so that you can debug the final executable.The HPPA @code{@value{AS}} port generates a small subset of the relocationsavailable in the SOM and ELF object file formats. Additional relocationsupport will be added as it becomes necessary. @node HPPA Options@section Options@code{@value{AS}} has no machine-dependent command-line options for the HPPA.@cindex HPPA Syntax@node HPPA Syntax@section SyntaxThe assembler syntax closely follows the HPPA instruction setreference manual; assembler directives and general syntax closely follow theHPPA assembly language reference manual, with a few noteworthy differences.First, a colon may immediately follow a label definition. This issimply for compatibility with how most assembly language programmerswrite code.Some obscure expression parsing problems may affect hand written code whichuses the @code{spop} instructions, or code which makes significantuse of the @code{!} line separator.@code{@value{AS}} is much less forgiving about missing arguments and othersimilar oversights than the HP assembler. @code{@value{AS}} notifies youof missing arguments as syntax errors; this is regarded as a feature, not abug.Finally, @code{@value{AS}} allows you to use an external symbol withoutexplicitly importing the symbol. @emph{Warning:} in the future this will bean error for HPPA targets.Special characters for HPPA targets include:@samp{;} is the line comment character.@samp{!} can be used instead of a newline to separate statements.Since @samp{$} has no special meaning, you may use it in symbol names.@node HPPA Floating Point@section Floating Point@cindex floating point, HPPA (@sc{ieee})@cindex HPPA floating point (@sc{ieee})The HPPA family uses @sc{ieee} floating-point numbers.@node HPPA Directives@section HPPA Assembler Directives@code{@value{AS}} for the HPPA supports many additional directives forcompatibility with the native assembler. This section describes them onlybriefly. For detailed information on HPPA-specific assembler directives, see@cite{HP9000 Series 800 Assembly Language Reference Manual} (HP 92432-90001).@cindex HPPA directives not supported@code{@value{AS}} does @emph{not} support the following assembler directivesdescribed in the HP manual:@example.endm .liston.enter .locct.leave .macro .listoff@end example@cindex @code{.param} on HPPABeyond those implemented for compatibility, @code{@value{AS}} supports oneadditional assembler directive for the HPPA: @code{.param}. It conveysregister argument locations for static functions. Its syntax closely followsthe @code{.export} directive.@cindex HPPA-only directivesThese are the additional directives in @code{@value{AS}} for the HPPA:@table @code@item .block @var{n}@itemx .blockz @var{n}Reserve @var{n} bytes of storage, and initialize them to zero.@item .call Mark the beginning of a procedure call. Only the special case with @emph{noarguments} is allowed.@item .callinfo [ @var{param}=@var{value}, @dots{} ] [ @var{flag}, @dots{} ]Specify a number of parameters and flags that define the environment for aprocedure.@var{param} may be any of @samp{frame} (frame size), @samp{entry_gr} (end ofgeneral register range), @samp{entry_fr} (end of float register range),@samp{entry_sr} (end of space register range).The values for @var{flag} are @samp{calls} or @samp{caller} (proc hassubroutines), @samp{no_calls} (proc does not call subroutines), @samp{save_rp}(preserve return pointer), @samp{save_sp} (proc preserves stack pointer),@samp{no_unwind} (do not unwind this proc), @samp{hpux_int} (proc is interruptroutine).@item .codeAssemble into the standard section called @samp{$TEXT$}, subsection@samp{$CODE$}.@ifset SOM@item .copyright "@var{string}"In the SOM object format, insert @var{string} into the object code, marked as acopyright string.@end ifset@ifset ELF@item .copyright "@var{string}"In the ELF object format, insert @var{string} into the object code, marked as aversion string.@end ifset@item .enterNot yet supported; the assembler rejects programs containing this directive.@item .entryMark the beginning of a procedure.@item .exitMark the end of a procedure.@item .export @var{name} [ ,@var{typ} ] [ ,@var{param}=@var{r} ]Make a procedure @var{name} available to callers. @var{typ}, if present, mustbe one of @samp{absolute}, @samp{code} (ELF only, not SOM), @samp{data},@samp{entry}, @samp{data}, @samp{entry}, @samp{millicode}, @samp{plabel},@samp{pri_prog}, or @samp{sec_prog}.@var{param}, if present, provides either relocation information for theprocedure arguments and result, or a privilege level. @var{param} may be@samp{argw@var{n}} (where @var{n} ranges from @code{0} to @code{3}, andindicates one of four one-word arguments); @samp{rtnval} (the procedure'sresult); or @samp{priv_lev} (privilege level). For arguments or the result,@var{r} specifies how to relocate, and must be one of @samp{no} (notrelocatable), @samp{gr} (argument is in general register), @samp{fr} (infloating point register), or @samp{fu} (upper half of float register).For @samp{priv_lev}, @var{r} is an integer.@item .half @var{n}Define a two-byte integer constant @var{n}; synonym for the portable@code{@value{AS}} directive @code{.short}.@item .import @var{name} [ ,@var{typ} ]Converse of @code{.export}; make a procedure available to call. The argumentsuse the same conventions as the first two arguments for @code{.export}.@item .label @var{name}Define @var{name} as a label for the current assembly location.@item .leaveNot yet supported; the assembler rejects programs containing this directive.@item .origin @var{lc}Advance location counter to @var{lc}. Synonym for the @code{@value{as}}portable directive @code{.org}.@item .param @var{name} [ ,@var{typ} ] [ ,@var{param}=@var{r} ]@c Not in HP manual; @sc{gnu} HPPA extensionSimilar to @code{.export}, but used for static procedures.@item .procUse preceding the first statement of a procedure.@item .procendUse following the last statement of a procedure.@item @var{label} .reg @var{expr}@c ?? Not in HP manual (Jan 1988 vn)Synonym for @code{.equ}; define @var{label} with the absolute expression@var{expr} as its value.@item .space @var{secname} [ ,@var{params} ]Switch to section @var{secname}, creating a new section by that name ifnecessary. You may only use @var{params} when creating a new section, notwhen switching to an existing one. @var{secname} may identify a section bynumber rather than by name.If specified, the list @var{params} declares attributes of the section,identified by keywords. The keywords recognized are @samp{spnum=@var{exp}}(identify this section by the number @var{exp}, an absolute expression),@samp{sort=@var{exp}} (order sections according to this sort key when linking;@var{exp} is an absolute expression), @samp{unloadable} (section contains noloadable data), @samp{notdefined} (this section defined elsewhere), and@samp{private} (data in this section not available to other programs).@item .spnum @var{secnam}@c ?? Not in HP manual (Jan 1988)Allocate four bytes of storage, and initialize them with the section number ofthe section named @var{secnam}. (You can define the section number with theHPPA @code{.space} directive.)@cindex @code{string} directive on HPPA@item .string "@var{str}"Copy the characters in the string @var{str} to the object file.@xref{Strings,,Strings}, for information on escape sequences you can use in@code{@value{AS}} strings.@emph{Warning!} The HPPA version of @code{.string} differs from theusual @code{@value{AS}} definition: it does @emph{not} write a zero byteafter copying @var{str}.@item .stringz "@var{str}"Like @code{.string}, but appends a zero byte after copying @var{str} to objectfile.@item .subspa @var{name} [ ,@var{params} ]@itemx .nsubspa @var{name} [ ,@var{params} ]Similar to @code{.space}, but selects a subsection @var{name} within thecurrent section. You may only specify @var{params} when you create asubsection (in the first instance of @code{.subspa} for this @var{name}).If specified, the list @var{params} declares attributes of the subsection,identified by keywords. The keywords recognized are @samp{quad=@var{expr}}(``quadrant'' for this subsection), @samp{align=@var{expr}} (alignment forbeginning of this subsection; a power of two), @samp{access=@var{expr}} (valuefor ``access rights'' field), @samp{sort=@var{expr}} (sorting order for thissubspace in link), @samp{code_only} (subsection contains only code),@samp{unloadable} (subsection cannot be loaded into memory), @samp{common}(subsection is common block), @samp{dup_comm} (initialized data may haveduplicate names), or @samp{zero} (subsection is all zeros, do not write inobject file).@code{.nsubspa} always creates a new subspace with the given name, evenif one with the same name already exists.@item .version "@var{str}"Write @var{str} as version identifier in object code.@end table@node HPPA Opcodes@section OpcodesFor detailed information on the HPPA machine instruction set, see@cite{PA-RISC Architecture and Instruction Set Reference Manual} (HP 09740-90039).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -