Re: Free x86 C compiler wanted

Hans-Peter Diettrich <DrDiettrich1@aol.com>
6 Apr 2007 22:57:17 -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)
[4 later articles]
| List of all articles for this month |

From: Hans-Peter Diettrich <DrDiettrich1@aol.com>
Newsgroups: comp.compilers
Date: 6 Apr 2007 22:57:17 -0400
Organization: Compilers Central
References: 07-04-015
Keywords: C
Posted-Date: 06 Apr 2007 22:57:16 EDT

Jean-Sebastien Stoezel wrote:


> I am looking for a free C compiler supporting 186 processors.


Doesn't gcc do what you want?
[No, there's no working port to generate 16 bit x86 code. -John]


> Ideally the compiler would not generate code that is OS dependent (a
> bootloader would copy the code from PROM to RAM then branch to the
> program's entry.


Most programs still will call BIOS or other OS services, in the system
library, through interrupts. Did you do an disassembly of the file?


> Right now I am using msvc, I thought it could work by generating COM
> files but I cannot succeed in starting my application (CPU not
> booting). I tried different symbols (__astart, __main...), nothing
> seems to boot.
>
> Any thoughts?


If you say "not booting", it may be a problem of your bootloader?
Why at all do you copy the program into the RAM, instead of starting
from PROM?


Using MSDOS you can debug your program, to some degree.


An exe2bin utility did convert EXE files, in old MSDOS versions.


Did you set up the segment registers properly?
CS=startaddress>>4, SS (=DS?) and SP as appropriate...




AFAIR the entry point of an COM file simply is the first byte. Use an
JSR to this location, which would initialize the CS:IP properly, and
some programs (libraries) do an RTS to exit.


But before all that: is your framework set up properly? Interrupt
vectors etc.? A PSP (Program Segment Prefix) also may be required.


And wich start module did you use? A C compiler will prefix the program
code with a startup section, where the memory management, I/O system
etc. is initialized. A stand alone application may require a special
start module. In the source code of the start module you may find
further requirements, e.g. how the size of the stack and data segment is
determined by the program.


DoDi


Post a followup to this message

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