pTAL Reference Manual (H06.08+)

Built-In Routines
HP pTAL Reference Manual523746-006
15-54
$INT_OV
expression
is an expression whose value is an INT, INT(32), UNSIGNED(1-16),
UNSIGNED(17-31), FIXED, REAL, REAL(64), SGBADDR, SGWADDR,
SGXBADDR, SGXWADDR, or EXTADDR value.
If expression is not a FIXED, REAL, or REAL(64) value, $INT returns the low-order
(rightmost) 16 bits of expression. $INT never causes overflow. $INT does not
explicitly maintain the sign of expression. In Example 15-43 on page 15-54, $INT
returns -1 although the argument to $INT is a positive number.
If the value of the expression in Example 15-43 on page 15-54 is a FIXED, REAL, or
REAL(64) value, $INT returns the result of converting expression arithmetically to an
INT value$INT does not just truncate an expression. If the converted value of
expression is too large to fit in 16 bits, an exception trap occurs.
For details on SG and SGX variables, see Section 3, Data Representation.
$INT_OV
$INT_OV converts its argument to an INT value and sets $OVERFLOW in some
cases.
Example 15-43. $INT Routine
INT i;
i := $INT(%HFFFFFF%D);
Example 15-44. $INT Routine
PROC p;
BEGIN
INT .SG a;
SGXBADDR b;
INT i;
INT .EXT e;
i := $INT(a); ! OK: a is INT
i := $INT(@a); ! OK: @a is SGWADDR
i := $INT(b); ! OK: b is SGXBADDR
i := $INT(i); ! OK: i is INT
i := $INT(@b); ! ERROR: @b is WADDR
i := $INT(@i); ! ERROR: @i is WADDR
i := $INT(@e); ! OK: @e is EXTADDR
END;
Note. $INT_OV is supported in the D40 and later product versions.
expression
( )
VST689.vsd
$INT_OV