Re: Free x86 C compiler wanted

George Neuner <gneuner2@comcast.net>
8 Apr 2007 09:52:06 -0400

          From comp.compilers

Related articles
Free x86 C compiler wanted js.stoezel@gmail.com (Jean-Sebastien Stoezel) (2007-04-06)
Re: Free x86 C compiler wanted ArarghMail704@Arargh.com (2007-04-06)
Re: Free x86 C compiler wanted DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-04-06)
Re: Free x86 C compiler wanted cmeerw@cmeerw.org (Christof Meerwald) (2007-04-06)
Re: Free x86 C compiler wanted cr88192@hotmail.com (cr88192) (2007-04-06)
Re: Free x86 C compiler wanted gneuner2@comcast.net (George Neuner) (2007-04-06)
Re: Free x86 C compiler wanted DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-04-08)
Re: Free x86 C compiler wanted gneuner2@comcast.net (George Neuner) (2007-04-08)
Re: Free x86 C compiler wanted nmh@t3x.org (Nils M Holm) (2007-04-08)
Re: Free x86 C compiler wanted ang.usenet@gmail.com (Aaron Gray) (2007-04-11)
Re: Free x86 C compiler wanted gah@ugcs.caltech.edu (glen herrmannsfeldt) (2007-04-11)
Re: Free x86 C compiler wanted lpsantil@gmail.com (lpsantil@gmail.com) (2007-04-13)
Re: Free x86 C compiler wanted kenney@cix.compulink.co.uk (2007-04-13)
| List of all articles for this month |

From: George Neuner <gneuner2@comcast.net>
Newsgroups: comp.compilers
Date: 8 Apr 2007 09:52:06 -0400
Organization: Compilers Central
References: 07-04-015 07-04-019 07-04-024
Keywords: MSDOS
Posted-Date: 08 Apr 2007 09:52:06 EDT

On 6 Apr 2007 22:59:58 -0400, George Neuner <gneuner2@comcast.net>
wrote:


>Additionally, COM files are non-relocatable and based at address
>0x100. If you load them anywhere else they don't work.
>
>[COM files can load anywhere in memory, sinec DOS sets the CS register
>to point at where they're loaded. If they're more than 64K, they do have
>to do their own segment register management. -John]


What I said previously was incomplete.


John is correct that COM files may be loaded into any segment.
Because segments can begin on any 16 byte paragraph, that means they
can be positioned pretty much anywhere in memory. However ...


COM is a raw binary format without relocation information. DOS and
CPM expect the code to begin at offset 0x100 within the load segment.
Most x86 compilers (including the OP's) produce position sensitive
code unless instructed otherwise. Unless the compiler produces
position independent code, it will not work if loaded at a different
offset.


The OP seems to be targeting an embedded system with no OS, however,
he is using an OS based compiler. He needs to be aware of the
compiler's default behavior so that he can adjust the options if
necessary.


George
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.