as: HPPA Directives

1 
1 9.13.5 HPPA Assembler Directives
1 --------------------------------
1 
1 'as' for the HPPA supports many additional directives for compatibility
1 with the native assembler.  This section describes them only briefly.
1 For detailed information on HPPA-specific assembler directives, see
1 'HP9000 Series 800 Assembly Language Reference Manual' (HP 92432-90001).
1 
1    'as' does _not_ support the following assembler directives described
1 in the HP manual:
1 
1      .endm           .liston
1      .enter          .locct
1      .leave          .macro
1      .listoff
1 
1    Beyond those implemented for compatibility, 'as' supports one
1 additional assembler directive for the HPPA: '.param'.  It conveys
1 register argument locations for static functions.  Its syntax closely
1 follows the '.export' directive.
1 
1    These are the additional directives in 'as' for the HPPA:
1 
1 '.block N'
1 '.blockz N'
1      Reserve N bytes of storage, and initialize them to zero.
1 
1 '.call'
1      Mark the beginning of a procedure call.  Only the special case with
1      _no arguments_ is allowed.
1 
1 '.callinfo [ PARAM=VALUE, ... ] [ FLAG, ... ]'
1      Specify a number of parameters and flags that define the
1      environment for a procedure.
1 
1      PARAM may be any of 'frame' (frame size), 'entry_gr' (end of
1      general register range), 'entry_fr' (end of float register range),
1      'entry_sr' (end of space register range).
1 
1      The values for FLAG are 'calls' or 'caller' (proc has subroutines),
1      'no_calls' (proc does not call subroutines), 'save_rp' (preserve
1      return pointer), 'save_sp' (proc preserves stack pointer),
1      'no_unwind' (do not unwind this proc), 'hpux_int' (proc is
1      interrupt routine).
1 
1 '.code'
1      Assemble into the standard section called '$TEXT$', subsection
1      '$CODE$'.
1 
1 '.copyright "STRING"'
1      In the SOM object format, insert STRING into the object code,
1      marked as a copyright string.
1 
1 '.copyright "STRING"'
1      In the ELF object format, insert STRING into the object code,
1      marked as a version string.
1 
1 '.enter'
1      Not yet supported; the assembler rejects programs containing this
1      directive.
1 
1 '.entry'
1      Mark the beginning of a procedure.
1 
1 '.exit'
1      Mark the end of a procedure.
1 
1 '.export NAME [ ,TYP ] [ ,PARAM=R ]'
1      Make a procedure NAME available to callers.  TYP, if present, must
1      be one of 'absolute', 'code' (ELF only, not SOM), 'data', 'entry',
1      'data', 'entry', 'millicode', 'plabel', 'pri_prog', or 'sec_prog'.
1 
1      PARAM, if present, provides either relocation information for the
1      procedure arguments and result, or a privilege level.  PARAM may be
1      'argwN' (where N ranges from '0' to '3', and indicates one of four
1      one-word arguments); 'rtnval' (the procedure's result); or
1      'priv_lev' (privilege level).  For arguments or the result, R
1      specifies how to relocate, and must be one of 'no' (not
1      relocatable), 'gr' (argument is in general register), 'fr' (in
1      floating point register), or 'fu' (upper half of float register).
1      For 'priv_lev', R is an integer.
1 
1 '.half N'
1      Define a two-byte integer constant N; synonym for the portable 'as'
1      directive '.short'.
1 
1 '.import NAME [ ,TYP ]'
1      Converse of '.export'; make a procedure available to call.  The
1      arguments use the same conventions as the first two arguments for
1      '.export'.
1 
1 '.label NAME'
1      Define NAME as a label for the current assembly location.
1 
1 '.leave'
1      Not yet supported; the assembler rejects programs containing this
1      directive.
1 
1 '.origin LC'
1      Advance location counter to LC.  Synonym for the 'as' portable
1      directive '.org'.
1 
1 '.param NAME [ ,TYP ] [ ,PARAM=R ]'
1      Similar to '.export', but used for static procedures.
1 
1 '.proc'
1      Use preceding the first statement of a procedure.
1 
1 '.procend'
1      Use following the last statement of a procedure.
1 
1 'LABEL .reg EXPR'
1      Synonym for '.equ'; define LABEL with the absolute expression EXPR
1      as its value.
1 
1 '.space SECNAME [ ,PARAMS ]'
1      Switch to section SECNAME, creating a new section by that name if
1      necessary.  You may only use PARAMS when creating a new section,
1      not when switching to an existing one.  SECNAME may identify a
1      section by number rather than by name.
1 
1      If specified, the list PARAMS declares attributes of the section,
1      identified by keywords.  The keywords recognized are 'spnum=EXP'
1      (identify this section by the number EXP, an absolute expression),
1      'sort=EXP' (order sections according to this sort key when linking;
1      EXP is an absolute expression), 'unloadable' (section contains no
1      loadable data), 'notdefined' (this section defined elsewhere), and
1      'private' (data in this section not available to other programs).
1 
1 '.spnum SECNAM'
1      Allocate four bytes of storage, and initialize them with the
1      section number of the section named SECNAM.  (You can define the
1      section number with the HPPA '.space' directive.)
1 
1 '.string "STR"'
11      Copy the characters in the string STR to the object file.  ⇒
      Strings Strings, for information on escape sequences you can use
1      in 'as' strings.
1 
1      _Warning!_  The HPPA version of '.string' differs from the usual
1      'as' definition: it does _not_ write a zero byte after copying STR.
1 
1 '.stringz "STR"'
1      Like '.string', but appends a zero byte after copying STR to object
1      file.
1 
1 '.subspa NAME [ ,PARAMS ]'
1 '.nsubspa NAME [ ,PARAMS ]'
1      Similar to '.space', but selects a subsection NAME within the
1      current section.  You may only specify PARAMS when you create a
1      subsection (in the first instance of '.subspa' for this NAME).
1 
1      If specified, the list PARAMS declares attributes of the
1      subsection, identified by keywords.  The keywords recognized are
1      'quad=EXPR' ("quadrant" for this subsection), 'align=EXPR'
1      (alignment for beginning of this subsection; a power of two),
1      'access=EXPR' (value for "access rights" field), 'sort=EXPR'
1      (sorting order for this subspace in link), 'code_only' (subsection
1      contains only code), 'unloadable' (subsection cannot be loaded into
1      memory), 'comdat' (subsection is comdat), 'common' (subsection is
1      common block), 'dup_comm' (subsection may have duplicate names), or
1      'zero' (subsection is all zeros, do not write in object file).
1 
1      '.nsubspa' always creates a new subspace with the given name, even
1      if one with the same name already exists.
1 
1      'comdat', 'common' and 'dup_comm' can be used to implement various
1      flavors of one-only support when using the SOM linker.  The SOM
1      linker only supports specific combinations of these flags.  The
1      details are not documented.  A brief description is provided here.
1 
1      'comdat' provides a form of linkonce support.  It is useful for
1      both code and data subspaces.  A 'comdat' subspace has a key symbol
1      marked by the 'is_comdat' flag or 'ST_COMDAT'.  Only the first
1      subspace for any given key is selected.  The key symbol becomes
1      universal in shared links.  This is similar to the behavior of
1      'secondary_def' symbols.
1 
1      'common' provides Fortran named common support.  It is only useful
1      for data subspaces.  Symbols with the flag 'is_common' retain this
1      flag in shared links.  Referencing a 'is_common' symbol in a shared
1      library from outside the library doesn't work.  Thus, 'is_common'
1      symbols must be output whenever they are needed.
1 
1      'common' and 'dup_comm' together provide Cobol common support.  The
1      subspaces in this case must all be the same length.  Otherwise,
1      this support is similar to the Fortran common support.
1 
1      'dup_comm' by itself provides a type of one-only support for code.
1      Only the first 'dup_comm' subspace is selected.  There is a rather
1      complex algorithm to compare subspaces.  Code symbols marked with
1      the 'dup_common' flag are hidden.  This support was intended for
1      "C++ duplicate inlines".
1 
1      A simplified technique is used to mark the flags of symbols based
1      on the flags of their subspace.  A symbol with the scope
1      SS_UNIVERSAL and type ST_ENTRY, ST_CODE or ST_DATA is marked with
1      the corresponding settings of 'comdat', 'common' and 'dup_comm'
1      from the subspace, respectively.  This avoids having to introduce
1      additional directives to mark these symbols.  The HP assembler sets
1      'is_common' from 'common'.  However, it doesn't set the
1      'dup_common' from 'dup_comm'.  It doesn't have 'comdat' support.
1 
1 '.version "STR"'
1      Write STR as version identifier in object code.
1