TAL Reference Manual
Compiler Directives
TAL Reference Manual—526371-001
16-72
Example of RP Directive
If you manipulate data stack contents without the compiler’s knowledge (with CODE
statements, for example), you should use the RP directive to calibrate the compiler’s
internal RP count.
If the compiler decrements (or increments) the RP register below (or above) its initial
value in a procedure or subprocedure, the compiler issues a warning of RP register
underflow (or overflow). If the source program is correct, use the RP directive to
calibrate the compiler’s internal RP count.
After each high-level statement (not CODE, STACK, or STORE), the compiler’s
internal RP setting is always 7 (empty).
Modularize use of the RP directive and CODE, STACK, and STORE statements where
possible; they are not portable to future software platforms.
Example of RP Directive
This example sets the compiler’s internal RP count:
INT c;
INT PROC a;
BEGIN
!Lots of code
RETURN 1;
END;
PROC b (g);
INT g;
BEGIN
INT i;
IF g THEN
STACK 0
ELSE
BEGIN
STACK c;
CODE (DPCL); !Called routine returns a 16-bit
! integer by way of the register stack
! without knowledge of the compiler
? RP 0 !Set compiler’s internal RP count to 0
END;
STORE i;
!More code
END;
PROC m MAIN;
BEGIN
c := @a;
CALL b (0);
END;










