🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #3760

Re: Generating 80x86 code from a compiler (NO DOS)

#3760
From: Steve Resnick
Date: Tue, 13 Oct 1992 15:33
49 lines
3055 bytes
In article <JT.92Oct13145625@fizyk1.fuw.edu.pl> jt@fuw.edu.pl (Jerzy Tarasiuk) writes:
>>>>>> On Tue, 13 Oct 1992 03:17:03 GMT, draper@ais.org (Patrick Draper) said:
>PD> In article <9210061742.AA05172@deepthought.cs.utexas.edu> STDN%MARIST@VM.MARIST.EDU (Dan Newcombe) writes:
>>What I want to do is this:
>>  Generate pure 80x86 code from a compiler that could be used without
>>DOS.  I don't want stuff like INT 21 and all of those functions.
>
>PD> You'll can do it with Borland C++, and I'm sure quite a few others. The two
>PD> things you'll want to watch for is 1) the runtime libary and 2) the startup
>PD> code. Borland includes the startup code for it's compiler, which you can
>PD> modify and reassemble. The Borland 3.1 compiler also has source code for the
>PD> runtime library which you can analyze to determine what functions don't use
>PD> DOS.
>PD> Straight C won't generate DOS, or BIOS calls. If you throw away the standard
>PD> runtime library, you are reduced to writing your own functions. It's a lot
>PD> of work, but it can be done. As a reference, I recommend P.J. Plaugher's
>
>Seems would need compiler source code first and Borland surely don't
>publish it (the startup code is useful if want to produce program which
>can run in environment other than DOS, but it doesn't help run compiler
>- must compile compiler first).
>There is a GNU C compiler available with full source, so it can be used
>for this purpose (to have compiler source, compile it and run without
>DOS). But it is still a lot of work, what's about files without DOS ?
>What way use a compiler without files ?


You don't need source to the compiler. All you need is to write your own
startup code (which I have done) which sets up whatever runtime environment is
necessary. main (or something else) can be called to run your C program.
Most of the RTL is not going to work, since there are either DOS or BIOS calls
used in the RTL.

I have not encountered a real compiler which, as part of its code generation,
made DOS or BIOS calls. That's not legitimate code generation.

As for why you would use a compiler without accessing DOS? Embedded systems,
operating systems, any 80x86 application which needs to do things its own
way...


Cheers!
Steve

-- 
------------------------------------------------------------------------------
Steve Resnick - resnicks@netcom.com
"Sometimes you're the windshield, sometimes you're the bug." - M. Knopfler
-----------------------------------------------------------------------------
Technical Details
Message-ID: <1992Oct13.153327.22575@netcom.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!gumby!wupost!csus.edu!netcom.com!resnicks
References: <9210061742.AA05172@deepthought.cs.utexas.edu> <Bw1IGH.Cx6@ais.org> <JT.92Oct13145625@fizyk1.fuw.edu.pl>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!gumby!wupost!csus.edu!netcom.com!resnicks
From: resnicks@netcom.com (Steve Resnick)
Subject: Re: Generating 80x86 code from a compiler (NO DOS)
Message-ID: <1992Oct13.153327.22575@netcom.com>
Organization: What? Me organized? You should see my checkbook!
References: <9210061742.AA05172@deepthought.cs.utexas.edu> <Bw1IGH.Cx6@ais.org> <JT.92Oct13145625@fizyk1.fuw.edu.pl>
Date: Tue, 13 Oct 1992 15:33:27 GMT
Lines: 49