HLASM Programmer's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Object program linkage

HLASM Programmer's Guide
SC26-4941-06

You can combine two or more object modules, whether generated by the assembler or by another language processor, to produce a single load module. The object modules can be combined by the linkage editor, or z/OS binder, provided each object module conforms to the data formats and the required linkage conventions. This makes it possible for you to use different programming languages for different parts of your program, allowing each part to be written in the language best suited for it. Use the CALL system macro instruction to link an assembler language main program to subprograms produced by another language processor. Refer to the z/OS MVS Programming: Assembler Services Reference for details about linkage conventions and the CALL system macro instruction.

Figure 1 is an example of statements used to establish the assembler language program linkage to subprograms. See the applicable language programmer's guide for information about calling the language from an assembler language program.

If any input or output operations are performed by called subprograms supply the correct DD statements for the data sets used by the subprograms. See the applicable language programmer's guide for an explanation of the DD statements and special data set record formats used for the language.
Figure 1. Sample assembler linkage statements for calling subprograms
ENTRPT    SAVE           (14,12)
          LR             12,15
          USING          ENTRPT,12
          ST             13,SVAREA+4
          LA             15,SVAREA
          ST             15,8(,13)
          LR             13,15
          ⋮
          CALL           subprogram-name,(V1,V2,V3),VL
          ⋮
          L              13,SVAREA+4
          RETURN         (14,12)
SVAREA    DC             18F'0'
V1        DC             CL5'Data1'
V2        DC             CL5'Data2'
V3        DC             CL5'Data3'
          END

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014