pTAL Reference Manual (H06.03+)
Hardware Indicators
HP pTAL Reference Manual—523746-005
13-5
Condition Codes
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 15-1 on page 15-4):
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 on page 13-5
apply
When Condition Codes Are Not Accessible
The following exceptions override the conditions in When Condition Codes Are
Accessible on page 13-5:
•
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.










