Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!decvax!decwrl!glacier!well!few From: few@well.UUCP Newsgroups: net.micro.pc Subject: Re: Query: can MS C generate .COM files? Message-ID: <1012@well.UUCP> Date: Wed, 30-Apr-86 03:27:50 EDT Article-I.D.: well.1012 Posted: Wed Apr 30 03:27:50 1986 Date-Received: Wed, 30-Apr-86 23:47:48 EDT References: <2479@pogo.UUCP> Reply-To: few@well.UUCP (Frank Whaley) Distribution: na Organization: Whole Earth Lectronic Link, Sausalito CA Lines: 42 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 you KNOW it to be impossible, would you please >explain why? As far as I have been able to uncover, it is mostly impossible. microsoft's small-model run-time code makes at least (the smallest I have produced) four references to DGROUP, which is (in essence) the address of the data segment used while the program is running. This value is determined at load time (by the EXE file loader), and the references are "fixed-up" by the loader. The presence of "fix-ups" is noted by EXE2BIN, who complains that the file cannot be converted (as the program cannot simply be read into memory). Clever library coders can get around these references. [Begin Horn-tooting] I was one of the first to produce COM files with Lattice C, and still use it to produce Device Drivers and other Binary Goodies. [End Horn-tooting]. Note also that msc does not require that a run-time startup module be linked first (ala crt0.o), thus insuring that the program will "begin at the beginning". Instead, the Starting Address will occur at some address other than the CS:0100H required of COM files. Again, EXE2BIN will squawk. Finally, (oops, a fuzzy part here -- where's that damn manual...) COM files must be built with no stack segment (the linker should always complain), but I forget why (too many late hours). Some enterprising individual may write a run-time startup for msc (including all of the undocumented Flags and Gizmos, not to mention new versions of some library routines) which would allow COM files to be produced, but I have to charge money for that kind of stuff. Bon Compute! -- Frank Whaley EFS Management Software, Inc. UUCP: hplabs! ihnp4!ptsfa! seismo!lll-crg!well!few ARPA: well!few@lll-crg.ARPA