The information in this article applies to:
SUMMARY
Page 34 of the Microsoft FORTRAN "Advanced Topics" manual includes a
discussion of using the NEAR attribute with a COMMON block. By
default, in Microsoft FORTRAN each COMMON block is placed into its own
data segment to save space in the default data segment (DGROUP). The
drawback to this method is that a far pointer is required to access
data from a COMMON block which makes the compiled code larger and
slower. To address this problem, use the NEAR attribute with small,
frequently accessed COMMON blocks. To use this technique, sufficient
space must be available in the default data segment.
MORE INFORMATIONThe following code example demonstrates using the NEAR attribute to place data in COMMON blocks into the default data segment. Sample Code
The source listing describes each COMMON block as follows:
The map file indicates that each COMMON block is included in DGROUP.
In the listing below, note that the segment address of each COMMON
block is 005Dh, the DGROUP segment address:
The object listing includes a description of the manner in which the
compiler grouped all segments, including the NEAR COMMON blocks, into
DGROUP. That portion of the object listing is as follows:
Additional query words: kbinf 4.00 nofps 4.01 4.10 5.00 5.10
Keywords : |
Last Reviewed: November 3, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |