pTAL Reference Manual (H06.08+)

Pointers
HP pTAL Reference Manual523746-006
10-9
BADDR and WADDR
BADDR and WADDR
The address type of pointers is WADDR, except for STRING pointers, for which the
address type is BADDR.
SGBADDR, SGWADDR, SGXBADDR, and SGXWADDR
(System Globals)
The address type of a pointer to system global data is one of SGBADDR, SGWADDR,
SGXBADDR, or SGXWADDR. You can declare pointers to system global data by using
either .SG notation or .SGX notation. In either case, the pointer is not in system
globals, but the data is. pTAL allocates 16 bits for pointers you declare with .SG and 32
bits pointers declared with .SGX.
Example 10-4. BADDR and WADDR
INT a; ! Variable: address type is WADDR
INT .b; ! Pointer: address type is WADDR
STRING .c; ! Pointer: address type is BADDR
INT(32) d[0:9]; ! Direct array: address type is WADDR
INT .e[0:9]; ! Indirect array: address type is WADDR
Example 10-5. SGBADDR, SGWADDR, SGXBADDR, and SGXWADDR
STRING .SG s; ! s is 16 bits
INT .SG i; ! i is 16 bits
STRING .SGX t; ! t is 32 bits
INT .SGX j; ! j is 32 bits