pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
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;
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
An IF statement that tests a hardware indicator must either:
• Immediately follow the statement that establishes the value of the hardware indicator
INT a;
a := a - 1;
IF < THEN ... ! OK: hardware indicator tested immediately
a := a + 1;
IF $CARRY THEN ... ! OK: hardware indicator tested
! immediately
CALL WRITEREAD(...);
IF <> THEN... ! OK: hardware indicator tested
! immediately
a := a - 1;
BEGIN
IF < THEN ... ! ERROR: intervening BEGIN is invalid
...
Hardware Indicators in Conditional Expressions 241