Library /sys$common/syshlp/helplib.hlb  —  MACRO  /MIGRATION  MACRO Compiler Directives, .SET REGISTERS, Description
    The aligned and unaligned qualifiers to this directive allow
    you to override the compiler's alignment assumptions. Using the
    directive for this purpose in certain cases can produce more
    efficient code.

    The read and written qualifiers to this directive allow implicit
    reads and writes of registers to be declared. They are generally
    used to declare the register usage of called routines and are
    useful for documenting your program.

    With one exception, the .SET_REGISTERS directive remains in
    effect (ensuring proper alignment processing) until the routine
    ends, unless you change the value in the register. The exception
    can occur under certain conditions when a flow path joins the
    code following a .SET_REGISTERS directive.

    The following example illustrates such an exception. R2 is
    declared aligned, and at a subsequent label, 10$, which is
    before the next write access to the register, a flow path joins
    the code. R2 will be treated as unaligned following the label,
    because it is unaligned from the other path.

            INCL R2          ; R2 is now unaligned
             .
             .
             .
            BLBC R0, 10$
             .
             .
             .
            MOVL R5, R2
            .SET_REGISTERS ALIGNED=R2
            MOVL R0, 4(R2)
      10$:  MOVL 4(R2), R3   ; R2 considered unaligned
                             ; due to BLBC branch

    The .SET_REGISTERS directive and its read and written qualifiers
    are required on every routine call that passes or returns data in
    any register from R2 through R12, if you specify the command line
    qualifier and option /OPTIMIZE=VAXREGS (OpenVMS Alpha only). That
    is because the compiler allows the use of unused VAX registers as
    temporary registers when you specify /OPTIMIZE=VAXREGS.
Close Help