Home
| 32KOmnibus
| 4sale
| 8L
| 8a
| 8e
| 8i
| 8s
| C
| FPGA8i
| blog
| cables
| cad
| computerlab
| decmateI
| decmateII
| decmateIII
| df32emul
| documents
| dsd410
| flipchip
| frontpanel
| kc8a
| la36
| lab
| omnibus
| papertape
| pc04
| repair
| rk05
| rl02
| rx02
| rx08
| sbc6120
| software
| tc01
| tools
| tty33
| tty38
| tty43
| ttycards
| tu10
| tu55
| tu56
| typeset
| vt78
|
PDP-8 C Compiler
Every year or so for a while now, the topic of a PDP8 C compiler has come up in one or another discussion forum. The PDP-8 is not very suited for C -- there's no stack and consequently no recursion. There are no addressing modes suitable for accessing a stack even if you create one, and the conveniently addressable address space is only 4096 words long. Folks have argued about whether it was even possible, and how lame would it be if one did get it working. Recently, I decided to have a go at creating one, thereby creating a data point for the discussion. My C implementation is based on the following tools:
The compiled and linked "Hello World" comes in at about 1.7K, with the VM taking an additional 660 words. (This is with "fputc" stubbed with a routine to output on the TTY.) I estimate that adding support for proper stdio-style I/O would just about use the rest of the available 4K, unless most of it can be placed in field 0. You can download a snapshot of the code here, or browse the SVN repository here. Once you have extracted the snapshot, you can update to the bleeding edge with "svn update .". |
Last updated on 02/25/23 02:21 |
||||||||||||||||