TAL Reference Manual

Standard Functions
TAL Reference Manual526371-001
14-6
Data Types of Expression Arguments
Data Types of Expression Arguments
Expressions can be any data type except STRING and UNSIGNED. INT and INT(32)
expressions, however, can include such operands as follows. In any other expressions,
all operands must be of the same data type.
INT Expressions
An INT expression can include STRING, INT, and UNSIGNED(1–16) operands. The
system treats STRING and UNSIGNED(1–16) operands as if they were 16-bit values.
That is, the system:
Places a STRING operand in the right byte of a word and sets the left byte to 0.
Places an UNSIGNED(1–16) operand in the right bits of a word and sets the
unused left bits to 0.
INT(32) Expressions
An INT(32) expression can include INT(32) and UNSIGNED(17–31) operands. The
system treats UNSIGNED(17–31) operands as if they were 32-bit values. Before
evaluating the expression, the system places an UNSIGNED(17–31) operand in the
right bits of a doubleword and sets the unused left bits to 0.
Signedness of Expression Arguments
The standard function, not the expression or its data type, dictates the signedness or
unsignedness of its argument.
For instance, standard functions that expect signed arguments treat unsigned
expressions as if they were signed. Conversely, standard functions that expect
unsigned arguments treat signed expressions as if they were unsigned.
$ABS Function
The $ABS function returns the absolute value of an expression. The returned value
has the same data type as the expression.
expression
is any expression.
$ABS
(
expression
)
VST1401.vsd