pTAL Reference Manual (G06.24+, H06.09+, J06.03+)

WADDR w1, w2;
EXTADDR e1, e2;
IF e1 <> e2 THEN
BEGIN
IF < THEN ... ! OK: e1 and e2 are EXTADDR values
END;
IF w1 '<>' w2 THEN
BEGIN
IF < THEN ... ! OK: Original test is unsigned
END;
IF w1 <> w2 THEN
BEGIN
IF < THEN ... ! ERROR: cannot test condition code
END; ! set by signed comparison of
! 16-bit addresses
Using Hardware Indicators Across Procedures
Topics:
Testing a Hardware Indicator Set in the Calling Procedure (page 244)
Returning a Condition Code to the Calling Procedure (page 244)
Returning the Value of $OVERFLOW or $CARRY to the Calling Procedure (page 245)
Testing a Hardware Indicator Set in the Calling Procedure
A called procedure cannot test the value of a hardware indicator that was set in the procedure
that called the hardware indicator. To achieve this effect:
1. In the calling procedure:
a. Test the value of the hardware indicator and set a variable to reflect its value.
b. Pass the variable to the called procedure.
2. In the called procedure, test the variable that you passed to the procedure in FIX_THIS_LINK.
Example 198 Testing a Hardware Indicator Set in a Calling Procedure
PROC b(status); ! Called procedure
INT status;
BEGIN
IF status <> 0 THEN ... ! Test parameter value from PROC a
END;
PROC a; ! Calling procedure
BEGIN
INT i, j, k;
...
j := i;
IF <> THEN k := 1 ! Test hardware indicator and set k
ELSE k := 0;k
CALL b(k); ! Call PROC b, passing k
END;
Returning a Condition Code to the Calling Procedure
A called procedure can return a condition code value to its caller by using the RETURNSCC
procedure attribute in its procedure or subprocedure declaration and a RETURN statement.
244 Hardware Indicators