TAL Programmer's Guide
Testing Hardware Indicators
Using Expressions
096254 Tandem Computers Incorporated 5–25
Testing Hardware
Indicators
Hardware indicators include condition code, carry, and overflow settings. Arithmetic
and conditional operations, assignments, and some file-system calls affect the setting
of the hardware indicators. To check the setting of a hardware indicator, use an IF
statement immediately after the operation that affects the hardware indicator.
Condition Code Indicator The condition code indicator is set by a zero or a negative or positive result:
Result
State of Condition
Code Indicator
Negative CCL
0 CCE
Positive CCG
To check the state of the condition code indicator, use a relational operator (with no
operands) in a conditional expression. Using a relational operator with no operands is
equivalent to using the relational operator in a signed comparison against zero. When
used with no operands, signed and unsigned operators are equivalent. The result
returned by such a relational operator is as follows:
Relational Operator Result Returned
< or '<' True if CCL
> or '>' True if CCG
= or '=' True if CCE
<> or '<>' True if not CCE
<= or '<=' True if CCL or CCE
>= or '>=' True if CCE or CCG
An example is:
IF < THEN ... ;
File-System Errors
File-system procedures signal their success or failure by returning an error number or
a condition code. Your program can preserve the returned condition code for later
operation as follows:
CALL WRITE( ... );
IF >= THEN
system_message := -1; !True
ELSE
system_message := 0; !False
IF system_message = -1 THEN ... ;