COM files are usually faster and smaller, but are limited to 64k total for
code, data and stack space. EXE files are multi-segmented, and calls to
routines in other segments generate larger code (since passing the seg:ofs
is required, unlike a COM, which goes directly to the offset).
Will
Regarding...
Will DeWitt wrote:
> COM files are usually faster and smaller, but are limited to 64k total for
> code, data and stack space. EXE files are multi-segmented, and calls to
> routines in other segments generate larger code (since passing the seg:ofs
> is required, unlike a COM, which goes directly to the offset).
> Will
As I recall-- and please don't hesitate to correct me if I'm mistaken:
a. Programs stored in .COM file format are perfectly welcome to have
more than 64k of code, data, & stack space; it just needs to be
allocated dynamically. That is, you can have a disk buffer, for example,
of several hundred kilobytes as long as you allocated it at run time
rather than reading it from the pgrm file (which you'd be unlikely to do
anyway). Similarly, if you wanted to load an additional overlay or
overlay like file at run time-- you'd be most welcome to do so too.
b. Regarding "EXE files are multi-segmented and calls to routines in
other segments generate larger code..." I think your debating the
relative merits & costs of far code vs. near code memory models. While
it would be unlikely for a program in a .COM file format to use far
code, it isn't impossible. The suggestion, however, that .EXE pgrms use
far code exclusively or even predominately seems quite unjustified.
Regarding the original question:
"Could anyone tell my why you would want to use a com file over an exe
file
or vise versa? What are advantages and disadvantages of either one?"
I think the answer it that .COM programs simply lend themselves to
"tiny" programs if for no other reason than that they are programed in a
memory model called "tiny" and they are smaller than there similar .EXE
counterparts by virtue of not having the .EXE header. Do note that for
applications programs, the difference was probably largely insignificant
even in the XT days (which, for me was just yesterday as my "main"
computer is a Turbo XT (H/Z-158)<g>).
Cordially,
Richard Kanarek
P.S. Note to the original poster: Didn't you go rather wild
cross-posting your original post?