Any assembly instructions that you provide need to work with the
instructions that are generated by the compiler. Before you provide
those instructions, you need to be aware of the characteristics of
compiler-generated HLASM source code.
You need to be aware that:
- Because the compiler uses relative-branching instructions, it
is not necessary to establish code base registers. When the compiler
detects user-embedded assembly statements, you can use the IEABRCX
DEFINE instruction to assist any branching instructions that might
rely on establishment of a code base register. For other instructions
(such as LA or EX) that rely on the establishment of a code base register,
you might need to add code to establish your own code base register.
To disable the effect of IEABRCX, you can add the instruction IEABRCX
DISABLE. For more information about the IEABRCX macro, see z/OS MVS Programming: Authorized Assembler Services Reference EDT-IXG.
- If the compiler needs to produce literals, GPR 3 will be set up
as the base register to address the literals. This addressability
is established after the prolog code. The literals are organized by
the LTORG instruction placed at the end of the epilog code. With the
presence of user-embedded assembly statements, the compiler assumes
there will be literals and establishes GPR 3 to address those literals.
- If you want code to be naturally reentrant, you must not use writable
static or external variables; such variables are part of the code.
- There is only one CSECT for each compilation unit. The CSECT name
is controlled by the CSECT option.
- Due to the flat name space and the case insensitivity required
by HLASM, the compiler prepends extra qualifiers to user names to
maintain the uniqueness of each name seen by HLASM. This is referred
to as name encoding. External symbols
are not subject to the name-encoding scheme as they need to be referenced
by the exact symbol names.
- The external symbols are determined by the compiler LONGNAME option.
- If the NOLONGNAME option is in effect:
- All external symbols are truncated to eight characters.
- All external symbols are converted to upper case.
- All "_" characters are replaced with the "@" character.
- If the LONGNAME option is in effect the compiler emits an ALIAS
instruction to make the real C name externally visible. Because the
length limit supported by the ALIAS instruction depends on the HLASM
release, the C compiler does not enforce any length limit here.
Note: The HLASM GOFF option is necessary to allow the ALIAS instructions
to be recognized. See
Figure 3.
- GPR 13 is established as the base of the stack space.
- GPR 10 and GPR 11 may be used exclusively to address static and
constant data. They should not be used in the user-embedded assembly
statements.
- The compiler will generate code to preserve FPR 8 through FPR
15 if they are altered by the function.
- For AMODE 31 functions: The compiler will generate code to preserve
the high halves of the 64-bit GPRs if they are altered or if there
are user-embedded assembly statements.
- The addressing mode is determined by the compiler option. When
the compiler option LP64 is in effect, the addressing mode is AMODE
64; otherwise it is AMODE 31.