FORTRAN Reference Manual

Memory Organization
FORTRAN Reference Manual528615-001
12-10
Storage of Entities in Common Blocks
place entities in global storage; any program unit that makes reference to common
storage can use these entities. You can also use DATA and SAVE statements to place
specified entities in global storage and to store their addresses in the code area.
Three compiler directives affect the addressing and storage of entities in common:
EXTENDCOMMON, which provides indexed indirect addressing. (Note that this
directive affects only word and doubleword variables; it has no effect on arrays.)
LARGECOMMON, which allocates space for common blocks in extended memory.
(For more information, see the Extended Memory on page 12-11.)
HIGHCOMMON, which allocates space for common blocks in upper memory.
Figure 12-3 shows the difference between using the default common addressing and
EXTENDCOMMON addressing for entities stored in common blocks by the following
statement:
COMMON i, j, k
By default, FORTRAN allocates a pointer in primary global storage for each entity in a
common block in secondary global storage. If you specify the EXTENDCOMMON
directive, FORTRAN allocates only one pointer for each array and one pointer for all
scalars in the common block. The latter pointer points to the first entity in the block; the
Figure 12-3. Normal and EXTENDCOMMON Addressing
I
J
K
Reserved
2000
2001
2002
G[2002]
G[2001]
G[2000]
G[5]
G[4]
G[3]
G[0]
Normal Common
EXTENDCOMMON
I
J
K
2000
Reserved
G[2000]
G[0]
G[3]
VST1203.vsd