VMS Help  —  MACRO  MACRO Compiler Directives
3..SET_REGISTERS READ=<R3,R4>, WRITTEN=R5 JSB DO_SOMETHING_USEFUL In this example, the read/written attributes are used to explicitly declare register uses which the compiler cannot detect. R3 and R4 are input registers to the JSB target routine, and R5 is an output register. This is particularly useful if the routine containing this JSB does not use these registers itself, or if the SET_REGISTERS directive and JSB are embedded in a macro. When compiled with /FLAG=HINTS, routines which use the macro would then have R3 and R4 listed as possible input registers, even if they are not used in that routine.

13  –  .SYMBOL ALIGNMENT

    This directive associates an alignment attribute with a symbol
    definition for a register offset. You can use this directive
    when you know the alignment of the base register. This attribute
    guarantees to the compiler that the base register has the same
    alignment, which enables the compiler to generate optimal code.

    Format

      .SYMBOL_ALIGNMENT  argument-list

13.1  –  Parameters

 argument-list

    One of the arguments listed in the following table:

    Option  Description

    long    Declares longword alignment for any symbol that you
            declare after this directive.
    quad    Declares quadword alignment for any symbol that you
            declare after this directive.
    none    Turns off the alignment specified by the preceding
            .SYMBOL_ALIGNMENT directive.

13.2  –  Description

    The .SYMBOL_ALIGNMENT directive is used to associate an alignment
    attribute with the fields in a structure when you know the base
    alignment. It is used in pairs. The first .SYMBOL_ALIGNMENT
    directive associates either longword (long) or quadword (quad)
    alignment with the symbol or symbols that follow. The second
    directive, .SYMBOL_ALIGNMENT none, turns it off.

    Any time a reference is made with a symbol with an alignment
    attribute, the base register of that reference, in effect,
    inherits the symbol's alignment. The compiler also resets the
    base register's alignment to longword for subsequent alignment
    tracking. This alignment guarantee enables the compiler to
    produce more efficient code sequences.

13.3  –  Example

  OFFSET1 = 4
  .SYMBOL_ALIGNMENT LONG
  OFFSET2 = 8
  OFFSET3 = 12
  .SYMBOL_ALIGNMENT QUAD
  OFFSET4 = 16
  .SYMBOL_ALIGNMENT NONE
  OFFSET5 = 20
      .
      .
      .
  CLR1 OFFSET2(R8)
      .
      .
      .
  MOVL R2, OFFSET4(R6)

      For OFFSET1 and OFFSET5, the compiler will use only its
      tracking information for deciding if Rn in OFFSET1(Rn) is
      aligned or not. For the other references, the base register
      will be treated as longword (OFFSET2 and OFFSET3) or quadword
      (OFFSET4) aligned.

      After each use of OFFSET2 or OFFSET4, the base register in the
      reference is reset to longword alignment. In this example, the
      alignment of R8 and R6 will be reset to longword, although the
      reference to OFFSET4 will use the stronger quadword alignment.

14  –  .USE LINKAGE

    OpenVMS I64 only.

    Establishes a temporary named or anonymous linkage that will
    be used by the compiler for the next CALLS, CALLG, JSB, BSBB,
    or BSBW instruction processed in lexical order. This directive
    is used when the target of the next CALLS, CALLG, JSB, BSBB,
    or BSBW instruction is not a name, but a run-time value (for
    example, CALLS #0, (R6)). When the compiler sees the next
    CALLS, CALLG, JSB, BSBB, or BSBW instruction, it will use the
    associated linkage to decide which registers need to be saved and
    restored around the call. After the instruction is processed, the
    temporary linkage is reset to null.

    Format

      .USE_LINKAGE  [linkage_name] [,input] [,output] [,scratch]

                    [,preserve]

14.1  –  Parameters

 linkage_name

    The name of a linkage previously defined with the .DEFINE_LINKAGE
    directive. If you specify a linkage_name, you cannot specify an
    input, output, scratch or preserve clause.

 input=<>

    Register set that indicates those registers from which the
    routine called by the next CALLS, CALLG, JSB, BSBB, or BSBW
    instruction receives input values.

 output=<>

    Register set that indicates those registers to which the routine
    called by the next CALLS, CALLG, JSB, BSBB, or BSBW instruction
    assigns values that are returned to the routine's caller.
    Registers included in this register set are not saved and
    restored around the call.

 scratch=<>

    Register set that indicates registers that are used within the
    routine called by the next CALLS, CALLG, JSB, BSBB, or BSBW
    instruction. This parameter is for documentation purposes only.

 preserve=<>

    Register set that indicates those registers which the routine
    called by the next CALLS, CALLG, JSB, BSBB, or BSBW instruction
    will preserve. Registers included in this register set are not
    saved and restored around a call to the routine, since the called
    routine will perform that task.
Close Help