On Tue, Apr 27, 2004 at 06:33:35PM -0400, Sean 'Captain Napalm' Conner wrote:
C is a pretty poor match to the 6502 though---not
enough stack space (one
page) and anything you get out of the compiler will probably be worse than
what you can do by hand in assembly.
I had a toy C compiler for the C-64 years and years ago... I don't think I
tried to compile anything over about 25 lines with it - it was too cumbersome
to use and took forever to compile anything. I didn't know enough at the
time to do any code ananlysis, but from what I learned later on the VAX and
PDP-11 (and doing object code analysis), I can't imagine the 6502 could do
C well, for both stack usage (as you mentioned) and available registers
(unless you used lots of zero-page as pseudo-registers).
The 6809 is geared more towards C (and higher level
languages in general)
than the 6502.
I'm not as familiar with the 6809 as I am with the 6502... what differences
in architecture make it better? Larger stack frame? More (and larger)
registers?
(Z80) may produce mediocre code.
Is that inherent to the CPU architecture, or just a coincidence of how
much effort people have (or have not) put into C compilers for 8-bit
machines?
The 1802 gets around a lot of the limitations of the 6502, from these
aspects, but I don't recall seeing a C compiler for _that_ platform :-)
-ethan
--
Ethan Dicks, A-130-S Current South Pole Weather at 28-Apr-2004 07:50 Z
South Pole Station
PSC 468 Box 400 Temp -74.5 F (-59.2 C) Windchill -112.4 F (-80.2 C)
APO AP 96598 Wind 8.5 kts Grid 069 Barometer 677.5 mb (10719. ft)
Ethan.Dicks(a)amanda.spole.gov
http://penguincentral.com/penguincentral.html