Binder Manual (G06.27+, H06.04+, J06.03+)
Object File Structure
Binder Manual—528613-004
4-3
Primary and Secondary Entry Points
FORTRAN arithmetic statement functions, TAL SUBPROCs, and COBOL85
PERFORM ranges are routines that are invoked through branch to subroutine (BSUB)
instructions; these routines do not have their own code blocks. The code for such
routines must be contained in the same block as their callers. The location of the
routine’s code within the local code block is determined at compile time. Binder knows
nothing and does nothing about BSUB routines. Pascal and C do not use BSUB
routines.
Routine Scope
The scope or visibility of a routine name, code block name, or entry point name can be
public (global) or private. A routine’s status depends on the language as follows:
•
In FORTRAN and TAL, all user routines are public and are callable from anywhere
in the whole program.
•
In COBOL85, only user routines that are separately compiled are callable from
anywhere in the whole program.
•
In C and Pascal, some routines of a module are public, but others can be private to
the module. Specifically, in C, public routines are called external and private
routines are called static. In Pascal, public routines are explicitly exported from
their module, whereas nonexported routines default to private.
A private routine, code block, or entry point is limited to a module or to its
encompassing procedure, that is, a nested procedure. Public routine names must be
unique across the whole program. Private routine names need only be unique within
their scope. It is possible for private routines in different scopes to have the same
name, or even for a private routine to have the same name as a public routine. You
resolve ambiguities by prefixing the routine name with the name of its scope. This is
called qualifying the routine name.
To call or reference a private routine, you can use its unqualified name if it is unique to
the whole program. Otherwise, you must use the fully qualified name. For example,
you would refer to a routine P private to module M as M.P; you would refer to a routine
P private to public routine Q as Q.P. In Pascal and C, module names are not the
program or module declaration, however, but the file name. You name routines private
to a Pascal or C program by prefixing the routine name with the module scope name.
The module scope name is the name of the module’s primary source file.
Nested Routines
In Pascal and COBOL85, user routines can be textually nested within larger routines.
In the other languages, you cannot nest user routines. Nested routines are private to
the routine containing them.
You reference private routines by prefixing the inner routine name with the fully
qualified name of the outer routine. Here is an example of a nested routine in Pascal:
•
Routine P is directly nested within routine Q.