pTAL Reference Manual (H06.08+)

Hardware Indicators
HP pTAL Reference Manual523746-006
13-6
Condition Codes
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 functions RETURN
statement is a byte value. The byte value is not sign-extended.
INT PROC p;
BEGIN
RETURN "A"; ! P is an INT function but the
END; ! expression in the RETURN statement
! yields a single byte
PROC p1;
BEGIN
INT i;
i := p; ! Condition code is accessible because
END; ! p returns an INT value
The left side of the assignment statement must be one of:
°
A local or sublocal simple variable:
PROC p;
BEGIN
INT i; ! Declare a local simple variable
i := i + 1; ! Condition code accessible
END;
°
The address cell of a local pointer:
INT i;
INT .ptr; ! Declare a local pointer
@ptr := f(i); ! Condition code is accessible if
! f specifies RETURNSCC
°
A value parameter:
PROC p (param);
INT param; ! Value parameter
BEGIN
INT i := 0;
param := i; ! Condition code is accessible
END;
The left side of the assignment statement cannot be:
°
A STRING variable:
STRING s;
s := "a"; ! Condition code is not accessible
°
An UNSIGNED(n) variable:
UNSIGNED(12) u;
u := %HFFF; ! Condition code is not accessible