pTAL Conversion Guide

Hardware Indicators
pTAL Conversion Guide527302-002
20-19
Setting Hardware Indicators in TAL
y := i + 1; ! ERROR: Left side is reference parameter
a[i] := a[i+1]; ! ERROR: Left side has index
s.s1[0] := i; ! ERROR: Left side has field and index
s.s2 := i; ! ERROR: Left side has field reference
i.<0:8> := i; ! ERROR: Left side has bit selection
i := str; ! ERROR: Right side is one-byte item
i := $ABS(i); ! ERROR: Right side is call to
! built-in routine
@k := @k + 1D; ! ERROR: Right side is address type
r := r + 1.0E0; ! ERROR: Right side is floating-point type
END;
Table 20-3. Setting Condition Codes in Assignment Statements (page 1 of 2)
To test condition codes after an assignment statement:
Left side must be one of: Left side cannot be: Right side cannot: *
A local or sublocal simple
variable:
PROC p;
BEGIN
INT i;
i := ...
A STRING variable:
STRING s;
s := ...
Consist solely of a one-byte
item:**
STRING s;
... := s;
The address cell of a pointer:
INT p;
p := ...
An UNSIGNED(n)
variable:
UNSIGNED(8);
u := ...
Consist solely of a call to a
pTAL built-in routine:
... := $ABS(x);
The address cell of a reference
parameter:
PROC p(i);
BEGIN
INT .i;
@i := ...
A global variable:
INT i;
PROC p;
BEGIN
i := ...
Be an expression that
evaluates to an address type
(WADDR, EXTADDR, and so
forth):
INT p;
... := $EXTADDR(0D);
* If the expression on the right side of an assignment statement is a function that specifies RETURNSCC, the
restrictions described above on the right side do not apply: you can test the condition code regardless of the data
type of the value returned by the function.
** An INT function that returns a one-byte value is allowed on the right side of the assignment.
Example 20-7. Testing Condition Code After Assignments (pTAL) (page 2 of 2)