as: HPPA Directives

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