pTAL Conversion Guide

Pointers
pTAL Conversion Guide527302-002
10-7
pTAL
°
The addressing mode to use when accessing the data:
°
Byte-addressed data, which can begin at any byte address
°
Word-addressed data, which must begin at an even-byte address,
regardless of which segment it is in
A pointer has two data types associated with it:
Figure 10-1 on page 10-7 shows two pointer declarations you might use in TAL: P1 is a
pointer to data in the user data segment; P2 is a pointer to data in an extended
memory segment.
In Figure 10-1 on page 10-7, the object data type of both P1 and P2 is INT because
both pointers point to data of type INT. The address type of P1 is WADDR, short for
“word address,” because an address stored in P1 must be the word address of data in
the user data segment. The address type of P2 is EXTADDR, short for “extended
address,” because an address stored in P2 must be 32 bits—usually, the address of
data in an extended memory segment.
Table 10-2 on page 10-8 lists the ten pTAL address types, the size and location of the
data to which a pointer of that type can point, and the pointer’s width on TNS and
native architectures. The examples show how you might declare pointers that have the
given address type. The names of the address types shown in Table 10-2 on
page 10-8 are reserved words in pTAL.
Data Type Description
Object data type Data type of the objects that the pointer can reference
Address type Data type of the addresses that you can store in the pointer
Figure 10-1. An Example of WADDR and EXTADDR Address Types (TAL)
%h8000 100CP1:
16 bits, data type: WADDR
data type: INT
%h8000:
%h00200000%c 200CP2:
32 bits, data type: EXTADDR
data type: INT
%h00200000%c:
VST004.vsd