KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q30646: Cannot Create .COM Files in C Compiler

Article: Q30646
Product(s): See article
Version(s): 3.00 4.00 5.00 5.10
Operating System(s): MS-DOS
Keyword(s): ENDUSER | | mspl13_c
Last Modified: 16-JUN-1988

The Microsoft C Compiler Versions 3.00, 4.00, 5.00, and 5.10 do not
support the creation of .COM programs. This is because the smallest
memory model that can be created is Small Model, which has one Code
segment and one Data segment, while .COM programs can only have one
segment.

   .EXE files are converted to .COM files using the MS-DOS utility
EXE2BIN (see your MS-DOS manual and/or Page 51 of Ray Duncan's
"Advanced MS-DOS"). The .COM programs cannot contain more than one
declared segment; however, the Microsoft C compiler creates segments
named _DATA, _TEXT, CONST, _BSS, etc.
   There are no compiler options to create a "Tiny model" program.
For this reason, most .COM programs are written in assembler.
   One way to use the C Compiler in creating .COM programs is to
compile with the /Fa option to create an assembly listing. The .ASM
file(s) can then be modified so it only uses one segment.

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.