pTAL Conversion Guide

TAL Standard Routines
pTAL Conversion Guide527302-002
17-7
$LADR
expression
is an expression whose value is:
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 17-5 on page 17-7, $INT
returns -1 although the argument to $INT is a positive number.
If the value of the expression in Example 17-5 on page 17-7 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 information about SG and SGX variables, see Section 4, Data Representation.
$LADR
$LADR is a TAL routine for which pTAL has nothing similar.
$LADR converts a 32-bit extended address to a 16-bit standard address.
identifier
is the name of a variable whose data is allocated in extended memory. If the data
type of identifier is STRING or is a substructure, $LADR returns a 16-bit byte
address; otherwise, $LADR returns a 16-bit word address.
Because native architecture does not support 16-bit addresses, $LADR cannot return a
meaningful value. You must change your algorithm to accommodate the 32-bit
addresses on native architecture.
TAL pTAL
INT
INT(32)
FIXED
REAL
REAL(64)
UNSIGNED(1-16)
UNSIGNED(17-31)
Any that TAL allows and:
SGBADDR
SGWADDR
SGXBADDR
SGXWADDR
Example 17-5. $INT Routine
INT i;
i := $INT(%HFFFFFF%D);
( identifier )
VST016.vsd
$LADR