pTAL Reference Manual (H06.08+)
Hardware Indicators
HP pTAL Reference Manual—523746-006
13-14
Using Hardware Indicators Across Procedures
•
If an outer IF statement’s conditional expression uses a signed operator (= or <>)
to compare two 16-bit addresses, an inner IF statement’s THEN or ELSE clause
cannot test the condition code established by the outer IF statement’s conditional
expression.
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 on page 13-14
•
Returning a Condition Code to the Calling Procedure on page 13-15
•
Returning the Value of $OVERFLOW or $CARRY to the Calling Procedure on
page 13-16
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
Step 1b.










