pTAL Reference Manual (G06.24+, H06.09+, J06.03+)

Condition Codes
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.
Topics:
When Condition Codes Are Accessible (page 237)
Typed Integer Constants (page 44)
When Condition Codes Are Accessible
The condition code is accessible after an assignment statement only if:
The right side of the assignment statement is not:
A 1-byte item:
STRING s;
INT i;
i := s; ! Condition code is not accessible
A call to a built-in routine (for a list of these, see Table 58 (page 276)):
I := $ABS(i); ! Condition code is not accessible
An expression whose value is an address type (for example, WADDR or EXTADDR):
INT i;
INT .p;
@p := @i; ! Right side is a WADDR value;
! condition code is not accessible
An expression whose value is 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 is code not accessible
A constant or constant expression:
INT a;
a := 2 << 3; ! Right side is a constant expression;
! condition is code not accessible
None of the exceptions in When Condition Codes Are Not Accessible apply
When Condition Codes Are Not Accessible
The following exceptions override the conditions in When Condition Codes Are Accessible
(page 237):
If the last operation on the right side of an assignment statement is a function call, these 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.
The numeric value returned by the function always determines the value of the condition
code.
If the right side of an assignment statement is an INT function, the condition code is
determined by the INT value returned by the function. The value returned is always an
INT, even if the expression in the function’s RETURN statement is a byte value. The byte
value is not sign-extended.
INT PROC p;
BEGIN
Hardware Indicators After Assignments 237