pTAL Reference Manual (H06.03+)

Hardware Indicators
HP pTAL Reference Manual523746-005
13-11
Hardware Indicators in Conditional Expressions
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
...
a := a + 1;
END;
IF $CARRY THEN ... ! ERROR: intervening END is invalid
CALL WRITEREAD(...);
firstchar := str_buff;
IF <= THEN... ! ERROR: intervening assignment
! statement is invalid
CALL WRITEREAD(...);
IF < THEN ... ! ERROR: previous statement does not
! set condition code
Be part of a nest of IF statements as described in Nesting Condition Code Tests on
page 13-12
The hardware indicator in the conditional expression of an IF statement must be the
first operand in the expression.
IF $CARRY THEN ... ! OK: hardware indicator is
! first operand
IF <= OR a >= 99 THEN ... ! OK: hardware indicator is
! first operand
IF I <= 999 AND > THEN ... ! ERROR: condition code must be
! first operand
IF a = b OR $CARRY THEN ... ! ERROR: $CARRY must be
! first operand
IF a = b OR $OVERFLOW THEN ... ! ERROR: $OVERFLOW must be
! first operand