pTAL Reference Manual (H06.03+)
Hardware Indicators
HP pTAL Reference Manual—523746-005
13-10
Hardware Indicators in Conditional Expressions
You cannot:
•
Reference a hardware indicator in an expression other than in the conditional
expression of an IF statement
INT i;
i := IF < THEN -i ELSE i; !ERROR: invalid in IF expression
•
Assign the value of a hardware indicator to a variable in an assignment statement
INT i;
i := >; ! ERROR: invalid in assignment statement
•
Pass a hardware indicator as an actual parameter to a procedure
INT i;
CALL p( < ); ! ERROR: invalid as parameter
call p (); ! Sets condition code indicator
while >= do ! OK
call p (); ! Sets condition code indicator
call p (); ! Sets condition code indicator
while > do ! OK
begin
...
call p (); ! Sets condition code indicator
end;
call q (); ! Doesn't set the condition code indicator
while > do ! ERROR: statement preceding WHILE
begin ! and last statement of WHILE
... ! must both set condition code indicator
call p (); ! Sets condition code indicator
end;
call p (); ! Sets the condition code indicator
while >= do ! ERROR: statement preceding WHILE
begin ! and last statement of WHILE
... ! must both set condition code indicator
call q (); ! Doesn't set condition code indicator
end;
int i;
...
i := i + 1;
while not $overflow do ! ERROR: not a condition code indicator
begin
...
i := i + 1;
end;
Example 13-5. Hardware Indicators in WHILE Statements (page 2 of 2)










