pTAL Reference Manual (H06.03+)

Procedures, Subprocedures, and Procedure
Pointers
HP pTAL Reference Manual523746-005
14-6
Procedure Attributes
INTERRUPT
causes the pTAL compiler to generate an interrupt exit instruction instead of an
EXIT instruction at the end of execution. Only operating system interrupt handlers
use the INTERRUPT attribute. An example is:
PROC int_handler INTERRUPT;
BEGIN
! Do some work
END;
RESIDENT
causes procedure code to remain in main memory for the duration of program
execution. The operating system does not swap pages of this code. The linker
allocates storage for RESIDENT procedures as the first procedures in the code
space. An example is:
PROC res_proc RESIDENT;
BEGIN
! Do some work
END;
CALLABLE
authorizes a procedure to call a PRIV procedure (described next). Nonprivileged
procedures can call CALLABLE procedures, which can call PRIV procedures.
Thus, nonprivileged procedures can only access PRIV procedures indirectly by first
calling CALLABLE procedures. Normally, only operating system procedures have
the CALLABLE attribute. In the following example, a CALLABLE procedure calls
the PRIV procedure declared next:
PROC callable_proc CALLABLE;
BEGIN
CALL priv_proc;
END;
PRIV
means the procedure can execute privileged instructions. Only PRIV or CALLABLE
procedures can call a PRIV procedure. Normally, only operating system
procedures have the PRIV attribute. PRIV protects the operating system from
unauthorized (nonprivileged) calls to its internal procedures.
The following PRIV procedure is called by the preceding CALLABLE procedure:
PROC priv_proc PRIV;
BEGIN
! Privileged instructions
END;
For information about privileged mode, see Privileged Mode on page 15-1.
Note. The EpTAL compiler ignores INTERRUPT.