www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/19/18:17:38

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Size of EXE
Date: Sun, 19 Jan 1997 15:34:10 -0800
Organization: Two pounds of chaos and a pinch of salt
Lines: 36
Message-ID: <32E2AF72.1D42@cs.com>
References: <32dc427c DOT 81435113 AT news DOT mcgill DOT ca> <32E28746 DOT 2941 AT cam DOT org>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp104.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Tudor wrote:
> 
> DJGPP is a 32 bit protected mode compiler.
> So it attaches to the executable code for a dos extender&DPMI support
> like CWSDPMI and it kiks your kode into protected mode.

This is not precisely correct.  Unless you bind with the PMODE extender,
the only DPMI-related stuff that gets attached to djgpp executables is
the 2k stub loader which looks for a resident DPMI host and loads
cwsdpmi if it doesn't find one.

The rest of the djgpp startup code comprises such things as interrupt
and exception handling, PM<->RM mode switching, command line processing,
loading the environment from 'djgpp.env', long filename handling, and
more.  You also have the debugging information that gets attached to the
end of the object code.

The FAQ describes this in detail and recommends ways to reduce the size
of djgpp executables in chapter 8.15.

> But for a "hello world" program you don't need DPMI or 32bit code or
> protected mode or whatever advantage DJGPP has.so a "hello world"
> program is best made via pascal or turbo C.

Actually, by disabling as much of the startup code as possible and
packing the executable, it is possible to reduce a trivial program to
30k or less.  It's still large for what it does, but less cumbersome
than it might otherwise be.

-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I  |        fighteer AT cs DOT com         |
| Call me for your free AOL disk!  |   http://www.cs.com/fighteer   |
|  Chain letters, work-at-home schemes, free long distance, etc.,   |
|    are ILLEGAL!  Keep the Internet litter-free... don't SPAM.     |
---------------------------------------------------------------------

- Raw text -


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