KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Article: Q38163
Product(s): See article
Version(s): 2.20 2.30
Operating System(s): MS-DOS
Keyword(s): ENDUSER | | mspl13_basic
Last Modified: 9-AUG-1989

Question:

CodeView is failing on an .exe produced using the /DOSSEG linker
switch. CodeView responded to an attempt to run with this .exe
with a "not enough space" diagnostic. What is the problem?

Response:

The modules below demonstrate the problem. In this case, compiling the
C source module and assembling the MASM source module with the
appropriate CodeView switches, then linking with the /CO /DO switches
generates a bad .exe. The problem is that CodeView displays source
with extended ASCII characters.

To work around this problem, put .DOSSEG in the MASM modules
being linked, and omit the /DO switch rather that trying to
force the linker to do the work. Also, switching the order of
the linker switches may solve the problem.

The following example demonstrates the problem:

#include <stdio.h>
main ()
  {
  long int getds(void), getdsq(void);
  printf("ds.DATA  = %lX\nds.DATA? = %lX\n",getds(),getdsq());
  }

**************************************************************
;        DOSSEG could be put here
        .MODEL  small
        .DATA
array   dd      0
        .DATA?
arrayq  dd      ?
        .CODE
        PUBLIC  _getds,_getdsq
_getds  PROC
        mov     ax,SEG array
        mov     dx,ds
        ret
_getds  ENDP
_getdsq PROC
        mov     ax,SEG arrayq
        mov     dx,ds
        ret
_getdsq ENDP
        END

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.

Copyright Microsoft Corporation 1986-2002.