Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!decvax!decwrl!pyramid!micropro!well!ljz From: ljz@well.UUCP Newsgroups: net.micro.pc Subject: Re: Query: can MS C generate .COM files? Message-ID: <1045@well.UUCP> Date: Wed, 7-May-86 21:07:48 EDT Article-I.D.: well.1045 Posted: Wed May 7 21:07:48 1986 Date-Received: Thu, 8-May-86 23:42:48 EDT References: <2479@pogo.UUCP> Reply-To: ljz@well.UUCP (Lloyd Zusman) Distribution: na Organization: Whole Earth Lectronic Link, Sausalito CA Lines: 37 Keywords: C, .COM, Query In article <2479@pogo.UUCP> maybee@pogo.UUCP (Joe Maybee) writes: >It is possible, using MS C, to generate an .EXE >file that can be converted to a .COM file? > >If so, could you tell me how it's done? > >If you KNOW it to be impossible, would you please >explain why? You can do it, but the easiest way is also expensive. In the library is a startup routine that sets up a stack, defines certain globals, etc., etc. This routine then passes control to your main() routine. Microsoft's startup routine is meant for .EXE files, which means that there's a STACK segment and some other things that make it impossible to generate a .COM file. Microsoft will *sell* you the source code to this module for $500.00 (!!) if you want to modify it so that you can create a .COM file. This is another example of what, in my opinion, is a user-hostile attitude on the part of Microsoft. Lattice C and others not only *give* you the source to this startup module, but will give you the source to an alternate startup module expressly for producing .COM files. You could write your own startup module and link it in ahead of Microsoft's library. It would need an 'ORG 100h' statement and no segment labeled 'STACK' ... that's all (I think) you need to ensure that EXE2BIN can convert the .EXE to a .COM. That part's fairly easy. The hard part is figuring out exactly what Microsoft does in its startup module and duplicating that (otherwise, you couldn't get the command line args, the stream-oriented file stuff wouldn't work right, etc.). Given Microsoft's "we-don't-give-a-damn" attitude for people who buy less than 100 copies of its software at a time, I fear you will have a difficult time getting the info from them. Sorry to give you such bad news. If anyone has been able to get more satisfaction from Microsoft on this than I have, then I'd love to see a posting of how to do this .COM file thing.