Binder Manual (G06.24+, H06.03+)
Using Binder
Binder Manual—528613-003
2-13
Binding Mixed-Language Programs
The following example shows a sample Binder session for binding a C-series Pascal
program:
Note the following points about these examples:
•
The file MAINOBJ is the user’s main object file.
•
The files EXTRAOBJ and MOREOBJ are user files.
•
For C-series Pascal programs, you must also specify the correct Pascal run-time
library, PASRUN or PASRUNS. Use PASRUN for programs that run in user code
space; use PASRUNS for programs that run in system or user library space or that
contain a main program written in another language. On C-series systems,
PASRUN and PASRUNS reside in the subvolume containing the Pascal compiler.
On D-series systems, the Pascal run-time library is named PASLIB. PASLIB
resides in the system library. See the Pascal Reference Manual for additional
information.
Binding Mixed-Language Programs
The rules that govern binding mixed-language programs are determined by the run-
time environment. Before the D-series Release Version Updates (RVUs), C,
COBOL85, FORTRAN, Pascal, and TAL each had its own run-time environment.
These language-specific run-time environments were different from one another and
often incompatible. The Common Run-Time Environment (CRE) provides a shared
run-time facility for these languages. Under CRE, you can write mixed-language
programs without the restrictions imposed by the C-series compilers and run-time
environments.
All the object code in a single object file must be either compiled to operate under CRE
or compiled to operate under the pre-CRE conventions. Refer to the discussion of
Binding Rules on page 2-6 for more information.
There are additional restrictions in the areas of naming global variables and routines,
sharing global data, interlanguage procedure calls, and input and output. For more
information on these subjects, refer to the Common Run-Time Environment
Programmer’s Guide and the language reference manuals and programmer’s guides
for the languages you are using.
The following restrictions apply to binding mixed-language programs compiled with C-
series compilers or D-series compilers (with the ENV OLD directive):
•
You cannot bind programs containing both C and FORTRAN routines.
ADD * FROM mainobj
SELECT SEARCH (extraobj, moreobj)
SELECT SEARCH $SYSTEM.PASCAL.PASRUN
SELECT RUNNABLE OBJECT ON
SELECT LIST * OFF
SET HEAP 2 PAGES
BUILD exobj