pTAL Reference Manual (H06.08+)
Data Representation
HP pTAL Reference Manual—523746-006
3-11
Incrementing and Decrementing Addresses
(Stepping Pointers)
If you increment or decrement a pointer, the number that you add to, or subtract from,
a byte address (such as BADDR) is the number of bytes to move the pointer. Similarly,
the number that you add to a word address (such as WADDR) is the number of 16-bit
words to move the pointer, not the number of 32-bit words.
If you step a byte address (such as BADDR), the number you specify is added to, or
subtracted from, the address in the pointer.
If you step a word address (such as WADDR), the address is incremented
decremented by twice the number you specify, because addresses on TNS/R and
TNS/E architecture are represented as byte addresses.
Computing the Number of Bytes Between Addresses
You can subtract two addresses except PROCADDR addresses. The address types of
both operands must be the same except that SGBADDR and SGXBADDR are
interchangeable, and SGWADDR and SGXWADDR are interchangeable.
Comparing Addresses to Addresses
You can compare addresses only if both addresses are the same address type, except
that:
•
SGBADDR and SGXBADDR are interchangeable with one another
•
SGWADDR and SGXWADDR are interchangeable with one another
You must use signed relational operators (<, =, >,<=, <>, >=) to compare EXTADDR
addresses. For all other address types, you must use unsigned relational operators
(‘<‘, ‘=’, ‘>’, ‘<=’, ‘<>’, ‘>=’), or signed equal (‘=’) or signed not equal operators (‘<>’).
The result of comparing two addresses is an INT value that indicates whether the
relationship is true (nonzero) or false (zero).
You can test the condition code after an IF statement that compares two addresses
only if certain conditions are met. These conditions are described in Section 13,
Hardware Indicators.
Comparing Addresses to Constants
You can compare a BADDR, WADDR, SGBADDR, SGWADDR, SGXBADDR, or
SGXWADDR address to a 16-bit constant value. The requirements for Comparing
Addresses to Addresses on page 3-11 also apply to comparing addresses to
constants.
Comparing PROCADDRs and PROCPTRs
You can compare PROCADDR addresses and PROCPTR addresses for equality and
inequality. The result of comparing the addresses of two different procedures is always
“not equal,” but the result of comparing the two addresses of the same procedure is not
always “equal.”










