pTAL Guidelines for TAL Programmers
Coding Guidelines
pTAL Guidelines for TAL Programmers—527256-002
2-40
Hardware Indicators
In pTAL, you cannot apply an @ operator to a procedure name or procedure pointer
name that you pass as an actual parameter, unless the formal parameter is type
PROCADDR, in which case the @ operator is required; therefore, in pTAL, an @
operator is:
•
Invalid if the formal parameter is a PROC or PROCPTR
•
Required if the formal parameter is a PROCADDR
Hardware Indicators
In TAL, you can test the following hardware indicators:
•
Condition code (<, <=, =, <>, >=, >)
•
Carry indicator ($CARRY)
•
Overflow indicator ($OVERFLOW)
You test the value of the condition code (CCL, CCE, CCG) to determine whether the
result of a preceding operation was less than, equal to, or greater than zero,
respectively.
You test the value of the carry indicator using the $CARRY built-in routine to determine
whether a carry occurred on a previous operation.
You test the value of the overflow indicator using the $OVERFLOW built-in routine to
determine whether an arithmetic overflow occurred on a previous operation. The
overflow indicator can also be set by a divide-by-zero and by the TAL scan operators.
Example 2-43. @ Operator
PROC a(i);
INT i;
BEGIN
END;
PROC b(p);
PROCPTR p(a);
INT a;
END PROCPTR;
BEGIN
END;
PROC c(pa);
PROCADDR pa;
BEGIN
END;
PROC d;
BEGIN
CALL b(a); ! OK
CALL b(@a); ! ERROR: @ operator is not valid
CALL c(a); ! ERROR: @ operator is required
CALL c(@a); ! OK: @ operator is required
END;