TAL Programmer's Guide
Using Simple Pointers
Using Pointers
096254 Tandem Computers Incorporated 9–9
Assigning the Content of Simple Pointers
To assign an address contained in a simple pointer (for instance, PTR1) to another
simple pointer (for instance, PTR2), specify @PTR1 on the right side of the assignment
operator:
INT array[0:99]; !Declare ARRAY
INT .ptr1 := @array; !Declare and initialize PTR1
INT .ptr2; !Declare PTR2
@ptr2 := @ptr1; !Assign content of PTR1 to PTR2
Accessing Data
With Simple Pointers
You access the data item to which a simple pointer points by using the pointer
identifier in statements. When you use the pointer identifier in statements, omit the @
operator.
You can use standard and extended simple pointers in any statement. For example, to
assign a value, say 45, to an array element, you can store the array address in a simple
pointer and then assign 45 to the pointer (without prefixing it with @):
INT .addr[0:2] := [1,2,3]; !Declare and initialize
! array ADDR
INT .sp := @addr[0]; !Declare and initialize
! standard simple pointer SP
! with address of ADDR[0]
sp := 45; !Assign 45 to ADDR[0]; ADDR
! now contains [45,2,3]
Accessing Data in Scans and Moves
Here are guidelines for using simple pointers in scan and move statements:
An array that is the object of a SCAN or RSCAN statement must be located in the
lower 32K-word area of the user data segment.
An extended simple pointer cannot be the object of a SCAN or RSCAN statement.
In a move statement, the destination pointer must point to a variable large enough
to accommodate the source data you want to copy.