pTAL Conversion Guide

Pointers
pTAL Conversion Guide527302-002
10-31
Pointer Arithmetic
Comparing Addresses to Addresses (pTAL)
Rules for comparing addresses to addresses:
The addresses must be the same type except that:
°
SGBADDR and SGXBADDR are interchangeable.
°
SGWADDR and SGXWADDR are interchangeable.
To compare EXTADDR addresses, you must use signed relational operators (<, =,
>,<=, <>, >=).
To compare all other address types, you must use either:
°
Unsigned relational operators ('<', '=', '>'. '<=', '<>', '>=')
°
Signed equal operator (=)
°
Signed not equal operator (<>)
The result of comparing two addresses is an INT value:
You can test the condition code after an IF statement that compares two addresses
only under the conditions described in Section 20, Hardware Indicators.
Comparing Addresses to Constants (pTAL)
You can compare addresses of these types to a 16-bit constant value:
BADDR
WADDR
SGBADDR
SGWADDR
SGXBADDR
SGXWADDR
The rules for Comparing Addresses to Addresses (pTAL)
on page 10-31 also apply to
comparing addresses to constants.
Result Meaning
Nonzero Relationship is true
Zero Relationship is false