pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
Table 47 Addresses in Simple Pointers (continued)
Kind of AddressData TypeAddressing Mode
32-bit or 64-bit
*
even-byte address, normally in the
automatic extended data segment (if you specify an odd-byte
address, results are undefined)
Any except STRINGExtended
*
64-bit addressing functionality added to the EpTAL compiler starting with SPR T0561H01^AAP. For more information,
see Appendix E, “64-bit Addressing Functionality” (page 531).
Assigning Addresses to Pointers in Structures
You can assign to pointers the kinds of addresses listed in Table 44 (page 126) and Table 45
(page 129). To assign an address to a pointer within a structure, specify the fully qualified pointer
identifier in an assignment statement. Prefix the structure identifier with @. For example, the
assignment statement to assign an address to ptr_x declared in substruct_a in struct_b
is:
@struct_b.substruct_a.ptr_x := arith_expression;
In the preceding example, @ applies to ptr_x, the most qualified item. On the left side of the
assignment operator, @ changes the address contained in the pointer, not the value of the item to
which the pointer points.
You can also prefix @ to a variable on the right side of the assignment operator. If the variable is
a pointer, @ returns the address contained in the pointer. If the variable is not a pointer, @ returns
the address of the variable itself.
Example 91 Assigning Addresses to Pointers in Structures
INT .array[0:99];
STRUCT .st;
BEGIN
INT .std_ptr;
INT .EXT ext_ptr;
INT .EXT32 ext32_ptr;
INT .EXT64 ext64_ptr;
END;
PROC e MAIN;
BEGIN
@st.std_ptr := @array[0];
@st.ext_ptr := $XADR(array[0]);
@st.ext_ptr := $XADR32(array[0]);
@st.ext32_ptr := @array[0];
@st.ext32_ptr := $XADR(array[0]);
@st.ext32_ptr := $XADR32(array[0]);
@st.ext64_ptr := @array[0];
@st.ext64_ptr := $XADR(array[0]);
@st.ext64_ptr := $XADR32(array[0]);
@st.ext64_ptr := $XADR64(array[0]);
END;
Example 92 (page 151) assigns the address of a structure to structure pointers declared in another
structure.
150 Structures