FIX: MASM Generates a _TEXT Segment in Far Code Models

Last reviewed: September 16, 1997
Article ID: Q79285
6.00 6.00a 6.00b | 6.00 6.00a 6.00b
MS-DOS           | OS/2
kbtool kbfixlist kbbuglist

The information in this article applies to:

  • Microsoft Macro Assembler for MS-DOS, versions 6.0, 6.0a, and 6.0b
  • Microsoft Macro Assembler for OS/2, versions 6.0, 6.0a, and 6.0b

SYMPTOMS

When the assembly language module of a mixed-language program is placed in an overlay, the program hangs at startup. If the assembly module is placed in the root, the problem disappears. This problem occurs only when using the .MODEL directive in the Microsoft Macro Assembler (MASM) versions 6.0, 6.0a, or 6.0b.

CAUSE

MASM 6.0 generates a zero length _TEXT segment from source files that specify .MODEL medium, .MODEL large, or .MODEL huge. The startup code for Microsoft's high level languages is also declared in the _TEXT segment. The linker combines segments with the same name. If the assembly module is overlayed, the startup code is pulled into the overlay because the _TEXT segments will be combined. This means that the startup code is not available when the program starts executing, which causes the program to crash.

RESOLUTION

Work around this problem by removing the .MODEL directive and using full segment directives instead in any module that will be placed in an overlay.

STATUS

Microsoft has confirmed this to be a problem in MASM version 6.0, 6.0a, and 6.0b. This problem was corrected in MASM for MS-DOS version 6.1.


Additional reference words: 6.00 6.00a 6.00b buglist6.00 buglist6.00a
buglist6.00b fixlist6.10
KBCategory: kbtool kbfixlist kbbuglist
KBSubCategory: MLIss
Solution Type : kbfix


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: September 16, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.