Like HLL programs, assembler programs are classified as either conforming or non-conforming with respect to Language Environment®. For assembler programs, conformance depends on the linkage and register conventions observed, rather than the assembler used. By definition, a Language Environment-conforming assembler routine is defined as one coded using the CEEENTRY and associated Language Environment macros.
Conformance governs the use of assembler programs by call from an HLL program. Both conforming and non-conforming assembler subroutines may be called either statically or dynamically from C or C++, COBOL or PL/I. However, there are differences in register conventions and other requirements for the two types. These are described below. Rules for mixing languages, including assembler, are discussed in Mixing languages in Language Environment.
On entry into a Language Environment-conforming assembler subroutine, these registers must contain the following values when NAB=YES is specified on the CEEENTRY macro:
Language Environment-conforming HLLs generate code that follows these register conventions, and the supplied macros do the same when you use them to write your Language Environment-conforming assembler routine. On entry to an assembler routine, CEEENTRY saves the caller's registers (R14 through R12) in the DSA provided by the caller. It allocates a new DSA and sets the NAB field correctly in this new DSA. The first half word of the new DSA is set to binary zero and the back chain in the second word is set to point to the caller's DSA.
R13 must point to the routine's DSA at all times while the Language Environment-conforming assembler routine is running.
At any point in your code where you CALL another program, R12 must contain the common anchor area (CAA) address, except in the following cases:
On exit from a Language Environment-conforming assembler routine, R0, R1, R14, and R15 are undefined. All the other registers must have the contents they had upon entry.
The CEEENTRY macro automatically sets a module to AMODE (ANY) and RMODE (ANY). If you are converting an existing assembler routine to be Language Environment-conforming and the routine contains data management macros coded using 24-bit addressing mode, then you should change the macros to use 31-bit mode. If it is not possible to change all the modules making up a program to use 31-bit addressing mode, and if none of the modules explicitly sets RMODE (24), then you should set the program to be RMODE (24) during the link-edit process.
Non-conforming routines cannot use Language Environment callable services.
For more information or for explanations of the terms used in this section see the chapter on "Assembler Considerations" in the z/OS Language Environment Programming Guide.
[[ Contents Previous Page | Next Page Index ]]