TAL Programmer's Guide

Accessing the Upper 32K-Word Area
Managing Addressing
096254 Tandem Computers Incorporated B–5
You can associate an extended structure pointer with the structure pointer declared in
the preceding example and then assign the first byte address in the upper 32K-word
area of the current user data segment to the new structure pointer:
STRING .EXT ex_strc_ptr (struc_ptr);
!Declare EXT_STRC_PTR
@ex_strc_ptr := %200000D; !Assign first byte address in
! upper 32K-word area
Managing Data Allocation
in Upper 32K-Word Area
When you declare pointers, the compiler allocates storage for the pointers, but you
must manage allocation for the data at the address contained in each pointer. You
must remember which addresses you have used and the length of the item pointed to
by each pointer. When you initialize subsequent pointers, you must allow enough
space for the previous items. You can then use an assignment or move statement to
copy data to the address contained in the pointer.
For example, you manage standard allocation in the user data segment as follows:
PROC std;
BEGIN
STRING .EXT byte_ptr := %200000D;
!Initialize extended pointer with
! first byte address in upper
! 32K-word area for a 46-byte
! string constant
STRING .EXT str_ptr := @byte_ptr + 46D;
!Initialize extended pointer with
! first free byte address in upper
! 32K-word area
byte_ptr ':='
"This is a sample string to be scanned for an X";
!Move statement copies 46-byte
! string constant to the byte
! address stored in BYTE_PTR
!Lots of code
END;
Assigning Data to Simple Pointers
You can assign a value to the 32-bit byte address contained in an extended simple
pointer:
INT .EXT ep := %200000D; !Declare EP and initialize it
! with address of first byte
! in upper 32K-word area
ep := 5; !Assign 5 to word location at
! address %200000D