TAL Reference Manual

Procedures
TAL Reference Manual526371-001
13-4
Usage Considerations
proc-body
is a BEGIN-END construct that contains local declarations and statements, as
described in Procedure Body
on page 13-13.
FORWARD
specifies that the procedure body is declared later in the source file.
EXTERNAL
specifies that the procedure body is declared in another compilation unit.
Usage Considerations
The maximum size of a single procedure is 32K words minus either the Procedure
Entry Point (PEP) table in the lower 32K-word area of the user code segment or the
External Entry Point (XEP) table in the upper 32K-word area. The PEP and XEP tables
are system tables in which the operating system records entry points of procedures.
The PEP table contains the entry points for procedures located in the current code
segment. The XEP table contains the entry points of procedures located in other code
segments.
For more information on public names and parameter pairs, see Section 17, “Mixed-
Language Programming,” in the
TAL Programmer’s Guide.
Examples of Procedure Declarations
1. This example declares a function that has two formal parameters:
INT PROC mult (var1, var2);
INT var1, var2;
BEGIN
RETURN var1 * var2;
END;
2. This example shows a FORWARD declaration:
PROC to_come (param1);
INT param1;
FORWARD;
3. This example shows EXTERNAL declarations:
PROC proc_a; EXTERNAL;
PROC proc_b; EXTERNAL;