pTAL Reference Manual (H06.03+)

Pointers
HP pTAL Reference Manual523746-005
10-6
Address Types
A pointer is associated with two data types:
You cannot explicitly declare or change the address type of a pointer. pTAL determines
the address type based on the pointer declaration.
Every identifier you declare in a pTAL program has an object data type and an address
type. Table 10-2 on page 10-7 lists the address type for all pTAL constructs except
simple variables. The address type of a simple variable is the same as the address
type of a pointer to data of the same object data type as the simple variable.
Data Type Description
Object data type Data type of the objects that the pointer can reference
Address data type Data type of the addresses that you can store in the pointer
Table 10-1. Address Types
Data Type
Address
Type Target Data
Pointer
Size
Example
BADDR Byte 16-bit address to 1-byte-
aligned data
32 STRING .s;
WADDR Word 16-bit address to 2-byte-
aligned data
32 INT .i;
CBADDR Byte 16-bit address to 1-byte-
aligned, read-only data
32 STRING s ='P':="A";
CWADDR Word 16-bit address to 2-byte-
aligned, read-only data
32 INT i = 'P' := 123;
SGBADDR Byte 16-bit address to 1-byte-
aligned, 'SG'-relative
data
16 STRING .SG s;
SGWADDR Word 16-bit address to 2-byte-
aligned, 'SG'-relative
data
16 INT .SG i;
SGXBADDR Byte 32-bit address to 1-byte-
aligned, 'SG'-relative
data
32 STRING .SGX s;
SGXWADDR Word 32-bit address to 2-byte-
aligned, 'SG'-relative
data
32 INT .SGX i;
EXTADDR Byte 32-bit address to data 32 INT .EXT x;
PROCADDR N.A. First address of
procedure code
32 PROC x;
BEGIN
END;