Establishing the z/OS XL C/C++ environment
Before you can call a C or C++ function from assembler, you must
establish a suitable environment. To establish the environment, do
one of the following:
- Call the assembler program from within the C or C++ program
(from main() or another function). Since the assembler
call is from within the C or C++ program, the environment has already
been established. It is often simplest to call the assembler using
OS linkage conventions.
Note: In this , "OS linkages" and "OS linkage" conventions refer to the following group of specifications: OS, OS_UPSTACK, OS_DOWNSTACK, OS_NOSTACK, OS31_NOSTACK and REFERENCE. "OS" is used in syntax diagrams and examples as a representative specification. These specifications use different stack conventions. For more information on these specifications, see Using Linkage Specifications in C or C++.
- Use preinitialization to set up the z/OS® Language Environment®. See Retaining the C environment using preinitialization for information.
- Use the Language Environment CEEENTRY prolog macro with MAIN=YES specified so that z/OS Language Environment is initialized.