ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/09/12:35:05

From: "Christopher Nelson" <paradox AT gye DOT satnet DOT net>
To: <djgpp AT delorie DOT com>
Subject: Re: How to change Executable format to my own?
Date: Wed, 7 Jul 1999 20:08:41 -0600
Message-ID: <01bec8e6$ccdcac80$LocalHost@thendren>
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.71.1712.3
X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3
Reply-To: djgpp AT delorie DOT com

>On Mon, 5 Jul 1999, Andy Cooper wrote:
>
>> Hi,Well, I'm wondering whether anyone will be able to help me. I am
wanting
>> to get DJGPP C to produce executables in my own format.The plan is to
>> convert the output from DJGPP, into a flat memory executable that will
have
>> two segments, one for the program and the second for the data. These
segments
>> will have an address starting at zero.
>
>Sorry, I don't understand.  How can two sections begin at the same
>address (zero)?


intel x86 architecture allows using segment registers for separate data,
code, stack, and 2 extra segments.  each segment may have it's own base, so
in a fully segmented architecture, it's completely allowable to have data
AND code a 0.

alternatively, for DJGPP programs used as boot-loaders, or for operating
systems, you can have the compiler stick stuff where it wants to, then
subtract the data segment base to assume a base of 0.  from there it is
simply neccessary to properly initizlise the DS segment selector properly,
and you have 0-based data.  since code is already at 0, you can just stick
it in another similiar, but code-marked, segment.

    -={C}=-

- Raw text -


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