TAL Reference Manual

Compiler Directives
TAL Reference Manual526371-001
16-17
CHECK Directive
CHECK Directive
CHECK generates range-checking code for certain features.
The default is NOCHECK.
Usage Considerations
You can specify the CHECK directive in the compilation command or anywhere in the
source text.
CHECK turns the checking setting on for subsequent code.
NOCHECK turns the checking setting off for subsequent code.
PUSHCHECK pushes the current checking setting onto the directive stack without
changing the current setting.
POPCHECK removes the top value from the directive stack and sets the current
checking setting to that value.
Extended Stack
If the source code includes extended local arrays or structures, the compiler allocates
an extended stack in the automatic extended data segment. The compiler also
allocates two pointers (#SX and #MX) to the extended stack. #SX points to the first
free location in the current stack frame, and #MX contains the maximum allowable
value for #SX, less eight bytes.
If the value of #SX is greater than or equal to that of #MX, the extended stack
overflows. If CHECK is in effect, the compiler sets the S-register to %177777, causing
a stack overflow trap.
Unlabeled CASE Statement
If you omit the OTHERWISE clause of an unlabeled CASE statement and the selector
value is out of range (negative or greater than n), the compiler behaves as follows:
If the CHECK directive is in effect and if your program has enabled arithmetic
traps, a divide-by-zero instruction trap occurs.
VST1606.vsd
POPCHECK
PUSHCHECK
NOCHECK
CHECK