pTAL Conversion Guide
Expressions
pTAL Conversion Guide—527302-002
13-6
Comparing Addresses
Comparing Addresses
In pTAL, the rules for comparing address types are more restrictive than the rules for
comparing non-address types. Table 13-1 on page 13-6 shows valid address-type
comparisons in pTAL.
Topics:
•
Comparing Extended Addresses on page 13-6
•
Comparing Nonextended Addresses on page 13-7
Comparing Extended Addresses
The following rules apply when you compare extended addresses (EXTADDRs):
•
Use signed relational operators to compare extended addresses. Unsigned
operators are invalid.
•
If you compare an extended address to a constant, the constant must be a 32-bit
integer.
Table 13-1. Valid Address-Type Comparisons
Extended Addresses Nonextended Addresses
Operators Unsigned relational operators:
none
Unsigned relational operators:
•
'<'
•
'='
•
'>'
•
'<='
•
'<>'
•
'>='
Signed relational operators:
•
<
•
=
•
>
•
<=
•
<>
•
=
Signed relational operators:
•
=
•
<>
Abbreviated Forms Testing address type as a
Boolean:*
IF @p THEN
IF NOT @p THEN ...
Testing address type as a
Boolean:
IF @p THEN
IF NOT @p THEN ...
* pTAL only. In TAL, you cannot test an extended address as a Boolean value.