"Small C" Slightly OT
- I came across Small C on the Dr. Dobbs web site.
The original version was published in 1980 and could compile itself. An optimizing version was published in 1983 and it's been ported to a variety of other systems such as the 6502 but not the 1802.
I downloaded it to a Vista machine and, rather to my surprise, the .exe ran fine and compiled itself. I had to poke around to find a 16 bit linker that would handle its object file
but once I found one it linked and the resulting .exe works just like the original!
It won't work on my 64 bit Win7 system but it's still sort of amazing that the 30 year old code compiles and runs on the many times removed hardware and software. I think the author mentions he wanted it for his 1.8Mhz NorthStar and now it's running on my 2GHZ machine - boy is it quick! I haven't tried anything other than the compiler and hello world but that runs through a lot of code by itself.
There are several other available C compilers that could be considered for 1802 targets including GCC, LCC and LLVM. These are newer, more complete, builds but Small C is the first one that I've been able to get a complete working build of. If you're interested in playing with the guts of a compiler this could be something to start with.
- Please do!
--- In firstname.lastname@example.org, Lee Hart <leeahart@...> wrote:
> On 9/12/2012 9:20 PM, Charles Richmond wrote:
> I had assumed that there was about zero interest in 8TH, given the large
> number of much bigger and more powerful versions of FORTH already "out
> there". But the comments in this thread have encouraged me to move it up
> the list a bit. :-)
> If you would not be forgotten
> When your body's dead and rotten
> Then write of great deeds worth the reading
> Or do these great deeds, worth repeating.
> -- Ben Franklin, from Poor Richard's Almanac
> Lee A. Hart http://www.sunrise-ev.com/LeesEVs leeahart@...