TAL Programmer's Guide
Using Extended Data Segments
Managing Addressing
B–20 096254 Tandem Computers Incorporated
C-Series Extended Segment Allocation Program
Example B-3 shows a C-series version of the previous D-series extended segment
allocation program. This example is not portable to future software platforms:
Example B-3. C-Series Extended Segment Allocation Program
?INSPECT, SYMBOLS
?SOURCE $SYSTEM.SYSTEM.EXTDECS0 (
? ALLOCATESEGMENT, USESEGMENT)
PROC alloc_xsegment MAIN;
 BEGIN
 DEFINE error = ! ...! #; !Error handling routine
 INT .EXT px := %2000000D; !Initialize extended pointer
 ! to start of extended segment
 INT s;
 !Lots of code
 s := ALLOCATESEGMENT (0, 4096D);
 !Allocate extended segment 0;
 ! assign status value to S;
 ! request 2 pages (4K bytes)
 ! of extended memory
 IF s <> 0 THEN error; !Continue if segment 0 is
 ! allocated else return error
 CALL USESEGMENT (0); !Make segment 0 the current
 ! extended segment
 px := 5; !Assign 5 to first word of
 ! segment 0
 s := ALLOCATESEGMENT (1, 4096D);
 !Allocate extended segment 1;
 ! assign status value to S;
 ! request 2 pages (4K bytes)
 ! of extended memory
 IF s <> 0 THEN error; !Continue if segment 1 is
 ! allocated else return error
 CALL USESEGMENT (1); !Make segment 1 the current
 ! extended segment
 px := 2; !Assign 2 to first word of
 ! extended segment 1
 !Lots more code
 END;










