pTAL Conversion Guide

Expressions
pTAL Conversion Guide527302-002
13-10
Relational Operators and Condition Codes
Relational Operators and Condition Codes
TAL
A condition code (a 2-bit field in the processor status word)—reflects the value of the
most recently evaluated arithmetic or conditional expression:
pTAL
pTAL simulates this 2-bit field when you use a condition code. You can access this field
only by means of the condition code notation.
If the root operator in the conditional expression of an IF statement is a relational
operator (<, =, >, <=, <>, >=, '<', '=', '>', '<=', '<>', '>='), pTAL sets the condition code
according to the result of the comparison.
Relational operators that test the condition code (for example, IF < THEN...) do not set
the condition code.
For more information, see Section 20, Hardware Indicators.
Group Comparison Expressions
TNS and native processes treat odd-byte addresses that refer to data declared with
.EXT differently. For TNS processes, you use a word address to access word-aligned
data in the user data segment. You use a byte address to access all data in an
extended memory segment. TNS processes ignore the low order bit in an extended
memory byte address when they access word-aligned data; therefore, if you use an
odd-byte address to access a 16-bit, 32-bit, or 64-bit word in an extended memory
segment, the TNS process accesses the 16-bit, 32-bit, or 64-bit word that begins one
byte before the odd-byte address you specify.
For native processes, you access all data using a byte address. A native process does
not ignore the low-order bits of addresses; therefore, when you use an odd-byte
address to access a 16-bit word that you have declared with .EXT, you access the data
beginning at the odd-byte address.
These differences can affect TAL and pTAL programs that use group comparison
expressions, as in the following IF statement:
IF a = b FOR 1 WORDS -> @p THEN... ;
Condition Code Meaning
CCL Condition code less than
CCE Condition code equal
CCG Condition code greater than