TAL Reference Manual
Expressions
TAL Reference Manual—526371-001
4-16
Testing Hardware Indicators
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:
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:
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:
Result State of Condition Code Indicator
Negative CCL
0 CCE
Positive CCG
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