ASM | NOASM
Category
Language element control
Pragma equivalent
None.
Purpose
Enables inlined assembly code inside C/C++ programs.
Default
NOASM
Usage
To use this option, the z/OS® XL C/C++ compiler requires access to z/OS V2R1 High Level Assembler with APAR PI21235, or later. Ensure that the High Level Assembler library SASMMOD1 is included in STEPLIB concatenation of the compiler step.
Specify the ASM compiler option to instruct the compiler to recognize the __asm and __asm__ keywords (as well as the asm keyword).
If the NOASM option is in effect, any __asm or __asm__ statements will be treated as identifiers.
The ASM option implies the KEYWORD(asm) option.
When the ASM option is specified with TEST, the compiler forces NOTEST.
When the ASM option is specified with DEBUG(FORMAT(ISD)), the compiler forces DEBUG(FORMAT(DWARF)).
The METAL option implies the ASM and NOKEYWORD(asm) options.
- User labels in inlined assembly code are not supported by the compiler. If the labels are necessary, you must ensure that each label is uniquely defined because the inlined assembly code might get duplicated by various optimization phases, and therefore user labels might be defined multiple times when they are presented to the assembler.
- HLASM symbols within another asm block are not supported.
- If an asm statement is used to define data, it cannot contain assembly instructions for other purposes.
- The XL:* constraints are only supported for Metal C programs.
- Only asm statements that are used to define data can exist in global scope.
- Each assembly statement can define only one variable.
- The symbol used in the assembly statement must be unique within the scope of the source file and be valid according to the assembler's requirements.
- Referencing an external symbol directly without going through the operand list is not supported.
- Using registers that are reserved (for example, killing a register used by the linkage) is not supported.
IPA effects
The ASM option needs to be specified again in the IPA link step.
Predefined macros
__IBM_ASM_SUPPORT is predefined to 1 if ASM is specified.
Related information
- The ASMLIB | NOASMLIB compiler option
- Inline assembly statements (IBM extension) in z/OS XL C/C++ Language Reference