pTAL Conversion Guide

TAL Standard Routines
pTAL Conversion Guide527302-002
17-11
$OVERFLOW
$OVERFLOW
$OVERFLOW is a TAL routine for which pTAL has a built-in routine with the same
name but slightly different behavior.
$OVERFLOW routine a value that indicates whether an overflow occurred during
certain arithmetic operations.
TAL
$OVERFLOW returns -1 if the overflow bit is on in the TNS environment register;
otherwise, $OVERFLOW returns 0. You can test or read $OVERFLOW anywhere in
your program. For example, in TAL, a procedure can pass $OVERFLOW as an actual
procedure parameter. An arbitrarily complex arithmetic or conditional expression can
reference $OVERFLOW as an operand. You must have detailed knowledge of which
TNS operators alter the overflow bit and how they alter it in order to use $OVERFLOW
correctly in TNS processes.
variable TAL pTAL
UNSIGNED field Returns the bit offset of the
16-bit word that contains the
UNSIGNED field
Reports an error (use
$BITOFFSET instead of
$OFFSET)
Item that is not a field in a
structure
Returns zero Reports an error
Structure array whose lower
bound is nonzero
Returns an offset as though
the structure array’s lower
bound were zero
Reports an error (but
$OFFSET applied to a
substructure array whose
lower bound is nonzero
returns the appropriate
offset)
Would result in a return value
greater than 2
16
-1
Truncates the value to 16
bits
Reports an error
VST105.vsd
$OVERFLOW