pTAL Guidelines for TAL Programmers
Coding Guidelines
pTAL Guidelines for TAL Programmers—527256-002
2-47
Hardware Indicators: Testing in a Called Procedure
pTAL programs running as native processes cannot set a hardware indicator in one
procedure and test its value in a called procedure. If you have code as in
Example 2-58 on page 2-47, you must set a variable to the condition code and pass
the variable to the called procedure, as in Example 2-59 on page 2-47.
Example 2-58. Testing a Hardware Indicator in a Called Procedure (TAL Only)
PROC check_read;
BEGIN
IF <> THEN ... ! Test condition code returned by READX proc
...
END;
PROC a;
BEGIN
CALL readx(...);
CALL check_read;
END;
Example 2-59. Passing the Value of a Condition Code to a Procedure
LITERAL cc_eql,
cc_lss,
cc_gtr;
PROC check_read(cond);
INT cond;
BEGIN
IF cond = cc_gtr THEN...
...
END;
PROC a;
BEGIN
INT cond_code;
CALL readx(...);
IF < THEN cond_code := cc_lss ! Save condition code
ELSE IF = THEN cond_code := cc_eql
ELSE cond_code := cc_gtr;
CALL check_read(cond_code); ! Pass condition code
END;