pTAL Reference Manual (H06.03+)

Procedures, Subprocedures, and Procedure
Pointers
HP pTAL Reference Manual523746-005
14-25
Subprocedure Entry-Point Identifiers
To obtain the code address of a subprocedure entry-point identifier, preface the
identifier with @.
You can specify FORWARD subprocedure entry-point declarations, which look like
FORWARD subprocedure declarations.
Example 14-11. Subprocedure Entry-Point Identifiers
literal write_op,
read_op,
writeread_op,
readwrite_op;
int proc io (op, buf);
int op;
int .ext buf;
begin
int subproc do_read_op (buf);
int .ext buf;
forward;
int subproc do_write_op (buf);
int .ext buf;
forward;
int subproc do_writeread_op (buf);
int .ext buf;
begin
entry do_read_op;
call do_write_op (buf);
do_read_op:
! Perform read operation
end;
int subproc do_readwrite_op (buf);
int .ext buf
begin
entry do_write_op;
call do_read_op (buf);
do_write_op:
! Perform write operation
end;
case op of
begin
! write_op ! call do_write_op (buf);
! read_op ! call do_read_op (buf);
! writeread_op ! call writeread_op (buf);
! readwrite_op ! call readwrite_op (buf);
end;
end;