TAL Programmer's Guide
Getting Addresses of Procedures and Subprocedures
Using Procedures
11–52 096254 Tandem Computers Incorporated
Getting Addresses of
Procedures and
Subprocedures
To get the address of a procedure or subprocedure, prefix its identifier with @. For
example, to assign the address of MY_PROC to MY_VAR, specify:
my_var := @my_proc;
When prefixed to procedure or subprocedure identifiers, @ yields 16-bit addresses as
follows:
Item Address Yielded by @ Operator
Procedure Procedure entry point (PEP) number of the procedure
LORed with code segment information
Subprocedure Word address of the subprocedure’s entry point in the
current code segment
The LOR operator performs a bit-wise logical OR operation on INT or STRING values
and returns a 16-bit result, as described in Section 5, “Using Expressions.”
You can get the PEP number, which is contained in bits <7:15> of the procedure’s
address, as follows:
PROC my_proc MAIN; !Declare MY_PROC
BEGIN
INT pepnum;
!Some code
pepnum := @my_proc.<7:15>; !Assign PEP number of MY_PROC
!More code
END;
You can get the code location of a subprocedure as follows:
PROC my_proc;
BEGIN
INT sub_loc;
SUBPROC my_subproc; !Declare MY_SUBPROC
BEGIN
!Some code
sub_loc := @my_subproc; !Assign address of MY_SUBPROC
!More code
END;
END;
Applying @ to a procedure name and using PEP or XEP table entries are not portable
to future software platforms.