Assembler programs
The following information describes some of the changes that are
specific to assembler programs:
- In the TPF 4.1 system,
assembler programs were limited to 4 KB in size; in the z/TPF system, assembler
programs can be larger than 4 KB. To exploit this capability, you
can change your assembler programs to use:
- The CLINKC, RLINKC, and SLINKC assembler linkage macros
- Multiple base registers
- Baseless instructions.
- You can use the CALLC general macro in assembler programs to call C language functions.
- In the TPF 4.1 system, the TMSPC
and TMSEC macros were provided to set up the interface between C language
programs and macro service routines written in assembler language.
In the z/TPF system,
the PRLGC and EPLGC macros set up this interface by simulating the
prolog and epilog code generated by the compiler.
The PRLGC and EPLGC macros were provided on the TPF 4.1 system through APAR PJ29640 so that new C library functions written on the TPF 4.1 system can be migrated with little or no changes; and the TMSPC and TMSEC macros are still supported on the z/TPF system so that library functions that were already coded with those macros can be migrated with little or no code changes. New library functions that are developed for z/TPF system must be coded with the PRLGC and EPLGC macros.
Note: Some TPF 4.1 library functions will require changes depending on how they are used. See Migrating your C library functions for details about the changes that might be required. - z/TPF basic assembler language (BAL) programs
can be repackaged into multiple entry point shared object libraries
to provide the following performance advantages and benefits:
- The program nesting level (PNL) has been replaced with the application stack. Maintaining the PNL information in the application stack is more efficient than keeping it in a separate control structure.
- An application stack frame is created for each BAL segment, which allows the application stack to be used by z/TPF assembler applications.
- Reduction of system overhead because of better program linkage (Enter/Back processing). Linkage has been changed from a system service to a function call (similar to C language).
- Reduction in system overhead for an application because two segments can be linked together as one unit, creating a shorter pathlength.
- Program expansion beyond 4 KB.
- There are no longer macros that begin with a dollar sign ($);
some of these macros were removed completely, and others were replaced
by or merged with a corresponding non-$ macro. The following are some
additional considerations related to the $ macros:
- The $DISBC, $GCOMC, $GETBC, and $GSWBC system macros were replaced by the DISBC, GCOMC, GETBC, and GSWBC system macros. In addition, these macros now have a required OWNER parameter for block owner support. See Main storage for more information about block owner support.
- The $LOCKC and $UNLKC system macros were replaced by the LOCKC and UNLKC system macros. The parameters remain the same.
- The $MONTC system macro, which provided an optional OLDSTATE parameter to save the first half (4 bytes) of the current PSW, is no longer supported with the z/TPF system. The MONTC system macro provides the same ability to save the first half (8 bytes) of the current PSW with the new PREVSTATE parameter.
- There are more assembler instructions available for your use in application programs. In addition to the z/Architecture® instructions for 64-bit operations (such as LG and STG), the z/TPF system now supports the immediate set of instructions (such as AHI, CHI, and so on).
- Structured programming macros (SPMs) cannot be called from a program that is running in 64-bit addressing mode. If you have application programs that use SPMs and must run in 64-bit addressing mode, you must rework that code so that it does not use the SPMs.
- 24-bit programming is no longer supported. For example, the MODE=24 parameter value is not supported for the MODEC macro and the SAM24 assembler instruction is not supported. Assembler programs that use 24-bit addressing mode must be changed.
- You must use the BEGIN macro to define transfer vectors in a program. When programs have transfer vectors declared in the usrtpf.cpy allocator file, you must update the BEGIN statements to declare the transfer vectors by using the TV parameter. (The TV parameter also accepts a list of transfer vectors.) In the allocator file, transfer vectors are numbered sequentially in the order in which they must appear in the TV parameter. If numbers are skipped in the allocator file, the application code must be changed to use the transfer vectors in the correct order; otherwise, you will not be able to use the TV parameter for the z/TPF system.
- The IDSPNL data macro is no longer supported. Program packaging, linkages, and program nesting have changed.
- The program attribute table (PAT) no longer contains entries for transfer vector programs.
- In the TPF 4.1 system, programs such as library routines can move code to the ECB or stack to be run.
- In the TPF 4.1 system,
the ENTDC, ENTNC, and ENTRC macros can be used to call a program segment
that is written in C language or to call a segment that is written
in C++ language
with C++ functions
that use
externC linkage. If the function in that C/C++ program requires any input parameters, register R1 (R1) must point to the parameters. Furthermore, there are restrictions for that C/C++ program if it can be called from an assembler language program; that C/C++ program must have a main( ) statement coded or it must have one and only one function defined. In the z/TPF system, you can continue to enter a C/C++ program and use traditional TPF 4.1 system parameter passing when you are migrating to the z/TPF system as long as you code a CPROC macro with the correct C/C++ function definitions. Add the CPROC statement to the assembler program directly or include it in the UPROC macro. See the z/TPF ENTDC, ENTNC, and ENTRC macros for possible changes to your applications. See the z/TPF CALLC macro for another way to call C/C++ programs. - The ECB register save area is expanded and moved in the z/TPF system.
- CE1SVP and CSTKLBAS are no longer supported for the z/TPF system. See Migrating your C library functions for more information about TPF 4.1 assembler programs that are C library functions written in BAL.
Additional information:
- See z/TPF General Services for more information about the BEGIN, CALLC, CLINKC, CPROC, ENTDC, ENTNC, ENTRC, EPLGC, PRLGC, RLINKC, SLINKC, and UPROC macros.
- See z/TPF Application Programming for more information about BAL repackaging, the application stack, and coding your own library functions.
- See z/TPF System Services for more information about the DISBC, GCOMC, GETBC, GSWBC, LOCKC, MODEC, MONTC, and UNLKC macros.
- See Migrating your C library functions for more information about specific changes that are required to migrate your own C library functions.
- See Migrating your application programs for more information about specific changes that are required for your application programs.