TAL Reference Manual
Procedures
TAL Reference Manual—526371-001
13-6
INTERRUPT
INTERRUPT
The INTERRUPT attribute causes the compiler to generate an IXIT (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
The RESIDENT attribute causes procedure code to remain in main memory for the
duration of program execution. The operating system does not swap pages of this
code. Binder 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
The CALLABLE attribute 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
The PRIV attribute 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. For more information on
privileged mode, see Section 15, Privileged Procedures
. The following PRIV procedure
is called by the preceding CALLABLE procedure:
PROC priv_proc PRIV;
BEGIN
!Privileged instructions
END;