TAL Programmer's Guide

TAL and C Guidelines
Mixed-Language Programming
17–36 096254 Tandem Computers Incorporated
Example 17-1. D-Series TAL and C Extended Segment Management (Page 2 of 2)
C Code
#pragma symbols, inspect, strict
short arr[10];
char sarr[10];
char *s;
tal void MIGHT_LOSE_SEG (void);
main ()
{
s = &sarr[0];
*s = 'A';
arr[0] = 10;
MIGHT_LOSE_SEG (); /* Call TAL routine, which uses the*/
/* explicit extended data segment */
/* next two statements depend on the automatic extended */
/* data segment being restored after the call to TAL */
sarr[1] = *s;
arr[1] = arr[0] + 5;
}
For a TAL example program that manages an explicit extended data segment, see
Appendix B, “Managing Addressing.”