pTAL Conversion Guide

Hardware Indicators
pTAL Conversion Guide527302-002
20-15
Setting Hardware Indicators in TAL
Setting Hardware Indicators in TAL
When the condition code is accessible following an assignment statement, the numeric
value of the evaluated expression on the right side of the assignment statement
determines the value of the condition code.
The condition code is accessible after an assignment statement in pTAL only if all of
the following conditions are satisfied (however, see the exceptions that follow):
The right side of the assignment statement cannot:
°
Consist solely of a one-byte item
STRING s;
INT i;
i := s; ! Condition code is not available
°
Consist solely of a call to a pTAL built-in routine
i := $ABS(i); ! Condition code is not available
°
Be an expression that evaluates to one of the address types (WADDR,
EXTADDR, and so forth)
INT i;
INT .p;
@p := @i; ! Right side is a WADDR value,
! condition code not available
°
Be an expression that evaluates to a floating-point data type [REAL or
REAL(64)]
REAL r := 1.0E0;
r := r + 1.0E0; ! Right side is a floating point number,
! condition code not available
°
Be a constant or constant expression
INT a;
a := 2 << 3;
The following considerations, however, override the preceding conditions:
°
If the last operation on the right side of an assignment statement is a function
call, the following rules apply:
°
If the function specifies the RETURNSCC attribute, you can test the
condition code following the assignment statement, independent of the
data type of the value returned by the function.