pTAL Reference Manual (G06.24+, H06.09+, J06.03+)

CALL that_proc;
END;
PROC main_proc2 MAIN; ! This MAIN procedure is not MAIN
BEGIN ! in the object file
CALL some_proc;
END;
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;
NOTE: The EpTAL compiler ignores INTERRUPT.
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 (page 274).
VARIABLE
means the compiler treats all parameters of the subprocedure as if they are optional, even if
some are required by your code. If you add parameters to the VARIABLE subprocedure
declaration, all procedures that call it must be recompiled. The following example declares a
VARIABLE subprocedure:
SUBPROC v (a, b) VARIABLE;
INT a, b;
BEGIN
Procedure Attributes 249