CRE Programmer's Guide

CRE Services
Common Run-Time Environment (CRE) Programmer’s Guide528146-004
2-39
TNS CRE Memory
The Extended Stack
The TNS CRE works with the extended stack model used by both TAL and FORTRAN.
No other languages use this model.
The model of the extended stack uses three data blocks:
$EXTENDED#STACK is the extended stack itself, allocated in extended memory.
EXTENDED#STACK#POINTERS is a structure with two fields.
#SX acts as the extended stack S-register.
#MX points to the last usable byte of memory.
EXTENDED#STACK#FRAME is a single field L-register.
The User Heap
The TNS CRE manages the heap and allocates blocks from the heap to any routine in
your program that requests heap space. The C language includes syntax to request
Figure 2-15. Organization of a Large-Memory- or Wide-Memory Model Program
Running in the TNS CRE
21 6VST .VSD
CRE Data
Run-Time Library Data
User Data Stack
User Global Data
Heap Control Block (HCB) Pointer
Master Control Block (MCB) Pointer
64K
32K
G[2]
G[1]
G[0]
User Data Segment
User Heap
[#HEAP]
Extended Data Segment