TAL Programmer's Guide
Using Simple Pointers
Using Pointers
9–8 096254 Tandem Computers Incorporated
Assigning Addresses of Simple Variables or Arrays
To assign the address of a simple variable or array to a standard simple pointer, place
the variable or array identifier (prefixed by @) on the right side of the assignment
operator:
STRING .bytes[0:3]; !Declare indirect array BYTES
STRING .s_ptr; !Declare simple pointer S_PTR
INT i := 3; !Declare simple variable I
@s_ptr := @bytes[i]; !Assign address of
! BYTES[3] to S_PTR
You can assign the address of an INT simple variable or array to standard simple
pointers of different types. The FIXED simple pointer lets you view four words at a
time; the INT(32) simple pointer lets you view two words at a time:
INT .array[0:99]; !Declare INT array
FIXED .quad_ptr; !Declare FIXED simple pointer
INT(32) .dbl_ptr; !Declare INT(32) simple pointer
@quad_ptr := @array[0]; !Assign address of INT array
! to FIXED simple pointer
@dbl_ptr := @array[0]; !Assign address of INT array
! to INT(32) simple pointer
Assigning Converted Addresses
You can convert a word address to a byte address and assign it to a STRING simple
pointer. You then have byte access to the word item:
STRING .s_ptr; !Declare STRING simple pointer
INT .word[0:5]; !Declare INT array
@s_ptr := @word[3] '<<' 1; !Assign converted byte address
! of WORD[3] to S_PTR
To convert a standard (16-bit) address to an extended (32-bit) address and assign it to
an extended simple pointer, use the $XADR standard function:
INT .EXT ext_ptr; !Declare extended simple pointer
STRING s_array[0:1]; !Declare STRING array
@ext_ptr := $XADR(s_array[0]);
!Assign converted 32-bit address
! of S_ARRAY to EXT_PTR