4 ms·
Crazy how small the PDP-11 is. 4096 words, 18 bits per word. One register, but the memory locations are called "registers". From the table on page 17 it look
by ErikCorry 4y ago
Crazy how small the PDP-11 is. 4096 words, 18 bits per word. One register, but the memory locations are called "registers".
From the table on page 17 it looks like all cells are two words, but strangely they all start on an odd address, rather than an even address.
Regular pointers seem to be tagged with a high bit of 0, while pointers to atoms (strings) have a high bit of 1. There may be other tags, couldn't find an explanation of the tagging. Probably there is at least one for integers? No support for floating point.
The atom/string is just a chain of conses, where the car is 3 characters packed into one 18 bit word, and the cdr is the next part of the chain. Since there's no space for a tag in the car that explains why bad stuff happens if you take the car of an atom.
There's a garbage collector in the program listing. It is described as non-compacting, which makes sense if all objects have the same size - no fragmentation possible, and allocation is just unlinking from the freelist. No description of how the GC works.
On page 12 there is also a routine for manually unlinking things to reuse their storage, so perhaps GC can be postponed with manual memory management.
- ErikCorry 4y agoUpdate: It's been pointed out that the manual unlinking is just for canonicalized symbols which otherwise would live forever.
- FullyFunctional 4y agoSomeone is documenting their findings on Lisp-1: https://github.com/erikcorry/understanding-lisp-1 https://github.com/erikcorry/understanding-lisp-1