gtpg2m4aGeneral Macros

TMSPC-Prolog for ISO-C Functions Calling TPF Macro Services

This general macro is used with ISO-C support. It is required for writing C library functions in assembler language and must be the first executable code after the BEGIN macro.

The TMSPC macro is the first part of an interface between external assembly language library routines and ISO-C programs. The interface begins with a call (in the external function) to the TMSPC macro (normally at the beginning of the program) preserving the C environment. The TMSEC macro completes the interface. TMSPC generates code that stores all registers in the calling program's ISO-C stack frame. It may allocate a stack frame for the function.

TMSPC can be used to migrate C library functions from TARGET(TPF) to ISO-C.

Format




label
A symbolic name can be assigned to the macro statement.

FRAMESIZE
Specify one of the following:

0
Indicates that the function does not use the C language stack itself but does call another function that requires a stack frame to save and restore registers and the return address. TMSPC allocates the minimum size stack frame. This is the default.

n
The number of bytes of storage in the stack frame to be reserved for the function's use. This value is added to the size of the minimum stack frame.

NO
Indicates no stack frame is to be allocated. When FRAMESIZE=NO, TMSPC returns the address of the library work space in Rx.

MIGRATION
Specify one of the following:

NO
Uses C language register conventions for the parameter list address (R1) and the current stack frame address (R13). This is the default.

YES
The parameter list address is loaded into both R1 and R6, and the current stack frame address is loaded into both R13 and R7. This reduces the amount of rewriting required to migrate TARGET(TPF) library functions to ISO-C.

LWS
Specify one of the following:

NO
Indicates that no base register is to loaded with the library workspace (LWS) address. This is the default.

Rx
Register Rx will be loaded with the LWS address and the LWS will be addressable using Rx. Rx must be a valid base register equate and must not conflict with any other registers set up by the TMSPC macro.

PPANAME=function name|''
The function name specified is placed in the function name field (PPA1) in TMSPC. If PPANAME is a null string (''), the label for the TMSPC macro is used if there is one. If there is no label, the name of the program calling the TMSPC macro is used. The PPANAME parameter can be useful for debugging or for user exits that process calls to ISO-C functions written in assembler.

BASE
Specify one of the following:

R8
Sets the program base register to R8. This is the default.

Ry
Sets the user-specified program base register.

Entry Requirements

Return Conditions

Programming Considerations

Examples