www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/04/10/18:51:41

Xref: news2.mv.net comp.os.msdos.djgpp:2588
From: Stewart McDonald <smcdonal AT pcug DOT org DOT au>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Paths and .COM files
Date: Wed, 10 Apr 1996 17:00:39 +1000
Lines: 25
Message-ID: <Pine.SOL.3.91.960410165600.25608D-100000@supreme>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 960409110439 DOT 24867X-100000 AT is> <4kdelk$hji AT freenet-news DOT carleton DOT ca>
NNTP-Posting-Host: cheese.pcug.org.au
Mime-Version: 1.0
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019