Playing with Fuzix on the Pico

The 6809 and especially the 68000 are fine targets for high level languages. Where the 6809 was still limited to a 64K address space, multiple stacks are available with less code overhead. I do prefer the 6809 and 68000 over Intel for a much more orthogonal instruction set. You can see much of the PDP-11 in there, the CPU where much of the research on compilers was done.

I’m not in orbit, but I have heard about Stallman attempting to base GCC on a Pascal compiler.

I found this: The Short History of GCC development

Hoping to avoid the need to write the whole compiler myself, I obtained the source code for the Pastel compiler, which was a multi-platform compiler developed at Lawrence Livermore Lab. It supported, and was written in, an extended version of Pascal, designed to be a system-programming language. I added a C front end, and began porting it to the Motorola 68000 computer. But I had to give that up when I discovered that the compiler needed many megabytes of stack space, and the available 68000 Unix system would only allow 64k.

I then realized that the Pastel compiler functioned by parsing the entire input file into a syntax tree, converting the whole syntax tree into a chain of “instructions”, and then generating the whole output file, without ever freeing any storage. At this point, I concluded I would have to write a new compiler from scratch. That new compiler is now known as GCC; none of the Pastel compiler is used in it, but I managed to adapt and use the C front end that I had written.

The even earlier Unix “version 0” was written for a PDP-7.

V1 didn’t have a C compiler, much less K&R. Yes, it is believed that the first C compiler by Ritche was based on Thompson’s B compiler. But I think PCC was a separate code base.

The first compiler was “pre K&R”, i.e. the syntax was even more archaic that true K&R as per the book.

Here is the first C compiler ported to run on Linux: GitHub - vegesm/first-cc-gcc: The first C compiler made to work under modern GCC

1 Like

I was looking into early C questions in response to comments on this thread, accumulated a bunch of tabs, but never shared anything. Here are some findings:

Warren Toomey’s 2009 Usenix paper The Restoration of Early UNIX Artifacts (6 page PDF)

Collection of 1972 documents “Preliminary Unix Implementation Document” (Bell Labs) (281 page PDF) (See page 97 for the start of the text)

1974 C reference manual (Bell Labs, 33 page PDF)

C is a new computer language designed for both non-numerical and numerical applications.The fundamental types of objects with which it deals are characters, integers, and single- and double-precision numbers, but the language also provides multidimensional arrays, structures containing data of mixed type, and pointers to data of all types.

C is based on an earlier language B, from which it differs mainly in the introduction of the notions of types and of structures. This paper is a reference manual for the original implementation of C on the Digital Equipment Corporation PDP-11/45 under the UNIX time-sharing system. The language is also available on the HIS 6000 and IBM S/370

PDP11/20 Handbook 1972 (234 page PDF) (I think I was hoping to get clues about memory size, virtual memory, paging, but why the 11/20? I don’t know.)

Similarly

1 Like

Lars, I have since read a bit more about GCC history. From memory… Stallman’s first attempt was to adapt a free Pascal compiler from Berkeley (LLNL), but it was too inefficient. I believe the second attempt was based on PCC. By this time RMS had established a long tradition of peeking at Symbolics Lisp machine code and rewriting it for MIT (and LMI and TI) to contain no proprietary code. You had to call this “pre clean room” (e.g. like the BIOS clones) because Stallman’s mind was on both sides of the “wall.”

Here’s another B compiler. It it’s written in B, by modifying the old C compiler.

1 Like

I am only like 50% certain but I think the Sharp MZ series had a C compiler in the 1980s. I am 100% certain there was a Pascal compiler, possibly by HiSoft in UK.

Here’s their old archived page mentioning products and some of the microcomputers: https://web.archive.org/web/20111029231706/http://www.hisoft.co.uk/about/about.html
[added: found a fresher page to the same info: HiSOFT | About Us | Website Design | Programming]

And here’s decompiled HiSoft C for ZX Spectrum: GitHub - oldcompcz/HiSoft-C: Disassembled code of HiSoft C compiler for ZX Spectrum

1 Like

There were a bunch of 8bit compilers for 8080/Z80 (BDS, Whitesmiths, etc).

For Pascal there were also several and they mostly followed pascal-s which was a reference small pascal. Pascal-S – Pascal for small machines and the default behaviour is to generate and execute a p-code so if you’ve got a cross compiler or write a small p-code interpreter it’s trivial to bootstrap on any platform.