Xref: news2.mv.net comp.os.msdos.djgpp:2588 From: Stewart McDonald Newsgroups: comp.os.msdos.djgpp Subject: Re: Paths and .COM files Date: Wed, 10 Apr 1996 17:00:39 +1000 Lines: 25 Message-ID: References: <4kdelk$hji AT freenet-news DOT carleton DOT ca> NNTP-Posting-Host: cheese.pcug.org.au Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII In-Reply-To: <4kdelk$hji@freenet-news.carleton.ca> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp On 9 Apr 1996, Paul Derbyshire wrote: > This may be slowly heading off topic, but I'm curious: what IS the > difference between a .COM and a .EXE, aside from the MZ ZM thing and the > file extension? > Is there a difference in the code, in its functioning, in how DOS > allocates it memory? A com file is a binary image of a program. Dos allocates 64k, loads the com file at offset 100h (512), creates a psp (info from dos to the executable) at offset 0, and JMPs to 100h into the segment. An exe file, can be many formats. The standard dos is something like this (don't expect it to be right, but the idea is right): MZ/ZM Followed by info about the exe file, such as the expected entry point (offset within the first segment), memory required and stuff, followed by (i think) all the seperate segments (data,stack,code,etc) and I have no idea how dos handles this...... Cia0, Joker/JAM Australia