TAL Programmer's Guide
Modular Programming Example
Sample Programs
096254 Tandem Computers Incorporated A–9
Compiling and Binding the
Modular Program
To compile each source file into an object file, you can issue the following compilation
commands You need do all these steps only once:
TAL /IN inits/ inito
TAL /IN ins/ ino
TAL /IN outs/ outo
TAL /IN msgs/ msgo
TAL /IN converts/ converto
To bind the modular object files into a single object file, you can issue the following
Binder commands. In this example, BINDS is the Binder IN file and the last five lines
represent the content of BINDS:
BIND / IN binds /
ADD * FROM converto
SELECT SEARCH (ino, outo, msgo, inito)
SELECT SEARCH $SYSTEM.SYSTEM.TALLIB
BUILD convert !
EXIT
You can then update the code or private data in a module such as INITS by issuing the
following commands:
TAL /IN inits/ inito
BIND / IN binds /
When you update a shared data block in a module, you must recompile all modules
that reference the updated data block. Similarly, when you update the declarations of
a shared procedure, you must recompile all modules that reference the updated
procedure.
Source Modules The following source modules for the modular program illustrate how you can break a
program into manageable modules. The source code for these modules are shown in
the remainder of this section:
Example Module Name Source File Name
A-6a. Mainline Module TPR_CONVERT CONVERTS
A-6b. Initialization Module INITIALIZATION_MODULE INITS
A-6c. Input File Module IN_FILE_HANDLER INS
A-6d. Output File Module OUT_FILE_HANDLER OUTS
A-6e. Message Module MESSAGE_MODULE MSGS