C Compilers for (MS)DOS
dave06a at dunfield.com
Thu Feb 23 04:45:58 CST 2006
> >How about anything that'd fit on an atari portfolio, in 64kb ram card?:)
> How about the Small-C interpreter? Should fit in 64K just fine:
I didn't see/respond to the original message as I was unsubbed during
a mail snafu...
I would urge you to take a look at the PC version of my Micro-C
It supports much more of the C language, is 1/2 the size, faster
and produces *WAY* better code than Small-C. (and no - it's
not based on or derived from Small-C).
[Don't get put-off by the fact that it's a "for sale" product - the PC
demo version is fully functional and not time-limited etc. - the
retail version gets you a bunch of extras (which you wouldn't
have room for on a portfolio anyway).]
Getting any of these tools to run on a Portfolio will be a challenge
however. The Portfolio has 128k of internal RAM - with DOS in ROM,
most of this is available as application storage, however some is set
aside for a "ramdisk". IIRC the minimum you can set this to is 8k.
With your 64k card, you therefore have somewhere around 110k
of usable RAM and 64k+8k of storage. CC86 (Small-C) is about
45k in disk usage, and I assume somewhere between 64k and
128k in-RAM usage. Micro-C has various components, however
the actual compiler (the only part you really need) is about 25k
in disk space, and about 90k in-RAM usage. I could build this
smaller with reduced symbol capacity if you needed.
Both Micro-C/PC and Small-C need an assembler. Small-C uses
MASM which is 85k in code size and (more) in RAM requirements,
so I think this alone will probably be a "show stopper".
Micro-C/PC supports several assemblers, the smallest of which is
probably A86. A86 uses about 35k of disk space, but I have not
tested it to see how much runtime it requires. IIRC A86 can also
create a .COM file directly.
There are other versions of Small-C which use Hendrixes "Small
assembler", which is no doubt smaller than MASM, and may allow
it to be used.
You could use an executable compressor (as long as it supports
the 8088) such as UPX, PKLITE etc. to reduce the disk space
requirements, however you may run into RAM space problems
On top of the requirements listed above, you need to consider
temporary files - both Micro-C and Small-C work by compiling
C source code to assembly code, which is stored in a temp
file - for all but the simplest of programs, this can get quite
I'm sure with a bit of tweaking, you could get either one to work
within the limits of the Portfolio ... but it would be quite limited and
you wouldn't have a lot left over.
If I wanted to put some work into it, I could build a custom/limited
version of Micro-C using my own ASM86 assembler (normally
used in my embedded toolset) and get all the modules to run in
64k. Not sure I want to do that - but it is possible.
PS: For an idea of how capable Micro-C is, note that almost all of my
software Including the much-debated ImageDisk, my other transfer
utilities, my simulators and nearly all of my commercial DOS based
tools are written in Micro-C/PC.
dave06a (at) Dave Dunfield
dunfield (dot) Firmware development services & tools: www.dunfield.com
com Collector of vintage computing equipment:
More information about the cctalk