Huge Addressing under OS/2

Last reviewed: July 17, 1995
Article ID: Q32206
The information in this article applies to:
  • Microsoft FORTRAN for MS-DOS, versions 4.1, 5.0, and 5.1
  • Microsoft FORTRAN for OS/2, version 4.1, 5.0 and 5.1

SUMMARY

When a huge array is allocated space, OS/2 allocates segments from the Segment Selector Table in increments of n+0i, n+1i, n+2i, etc., where "n" is the starting selector and "i" is the incremental value. The value of "i" must be determined at load time for different versions of the OS/2 and for different configurations of the similar versions. The way that huge addressing is performed under OS/2 is identical to the way in which MS-DOS accesses huge addresses. However, under MS-DOS, "i" is always 4,096.

Below is an example of how to obtain the value of "i" in a FORTRAN program. The value of "i" is 2 raised to the power returned by DosGetHugeShift. This information is discussed in detail in the Microsoft Press book "Inside OS/2" by Gordon Letwin, Section 9.2.2.

MORE INFORMATION

The following example shows how to obtain the value of "i" in a FORTRAN program:

       INTERFACE TO INTEGER*2 FUNCTION DosGetHugeShift
      + [ALIAS: 'DOSGETHUGESHIFT'] (SHIFT)
       INTEGER*2 SHIFT
       END
       INTEGER*2 SHIFT,DosGetHugeShift
       INTEGER*2 I
       I = DosGetHugeShift(SHIFT)
       PRINT *,'DosGetHugeShift = ',SHIFT
       PRINT *,'i = ',(2**SHIFT)
       STOP
       END


Additional reference words: kbinf 4.10 5.00 5.10
KBCategory: kbprg kbcode
KBSubcategory: FORTLngIss


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 17, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.