Silicon observatory / No. 008

Inside the Rekursiv.

A processor that ships with no instruction set, has no addresses, only object numbers, and a memory that outlives the power switch. Linn, the Glasgow turntable maker, built it to run a factory.

1988INTRODUCED
40 bitDATA WIDTH
10 MHzCLOCK
not publishedTRANSISTORS
READY

02 / The machine

after BYTE, Nov 1988, Figure 1
TIME0
CYCLES0
INSTRUCTIONS0
MICROWORDS0
PAGE FAULTS0
GCs0
ALLOCATOR0
STALLED0

03 / Logik & Numerik

04 / The two stacks

SRAM inside the processor

Evaluation stack

Control stack

The evaluation stack holds operands, and each frame's receiver, arguments and temporaries; FP marks the first argument. The control stack holds a sender's CODE, PC, FP and SELF for every message send, and a µret for every microcode subroutine call. Recursive microcode lives here.

08 / Control store

The microcode the host wrote into the control store, one microword per line. The highlight is the next word to run. Click a word to set a breakpoint. Opcodes reach their routines through the control store map: a label on the left is where the map or a jump lands.

09 / Compiled program

Every method, with the instructions it became and where they live: NAM, or the fields of a method object in the store. The highlight is the instruction being executed. Click one to stop before it runs.

Workbench

Ready.
Lingo quick reference
class Point (x y) class Point3 : Point (z) Point >> x [ ^x ] Point >> + p [ ^Point new ... ] Point >> x: a y: b [ x := a. y := b ] main [ | t u | ... ]3 + 4 a max: b p x x := expr. ^expr Transcript show: 'text'; print: 42; cr "comments in double quotes" $a 'string' #symbol nil true falsec ifTrue: [...] ifFalse: [...] [c] whileTrue: [...] 1 to: n do: [:i | ...] n timesRepeat: [...] (a > 0 and: [b > 0])Array new: 5 a at: 1 put: x a at: 1 x printNl x isNil x class a == b a cons: b p car p cdr t copyTree Capitalised names are persistent globals. Blocks are inlined; there are no closures.
Microcode quick reference
LABEL: op a, b -> d | op ... ; comment .op 32 ADD map opcode 32 to ADD .boot ACTIVATE where the host starts main ALU mov add sub mul div mod and or xor shl shr lt gt le ge eq ne mkc mkobj cmp (sets Z N) teq tint tobj (set Z)OBJ get o, i -> d put o, i, v getx o, i, type -> d new t, n -> d size o -> d type o -> d STK push pop top settop pick drop ldfp stfp setsp CST cpush cpop SEQ jmp jz jnz jn jnn js rtf jtab next halt trap "msg", r... IO out kind, valueRegisters: R0–R15, SP (read only), FP, SELF, CODE, PC, ARG (read only). Literals: 7 nil true false @1 $a #sym next fetches the next instruction from NAM (CODE = nil) or from the method object in CODE, sets ARG, and jumps via the map.One word per cycle. Fields run left to right, at most one per unit. Objekt stalls the word on a page fault or GC and then the word carries on. That is why js/rtf can recurse.
Model & limitations

From BYTE (Pountain, Nov 1988): the units and memories of Figure 1, including the 16,384-word control store and the 524,288-word NAM. The 40-bit object number: object/raw bit, compact bit, a compact's 5-bit type and 32-bit data, and 38-bit numbers from a sequential allocator. A pager table of 64K slots hashed on the object number, holding size, type (an object number) and DRAM address, with type and range checks on every access. A collision squeezes the old object out to disk. Page faults stall below the level of instructions, with no restart. Two DRAM halves with an EndMem test in grabspace. The collector traces with disk fetches off, copies only new or modified objects to the other half, and as a second level squeezes objects out to disk. The host loads the control store over VME. The machine starts empty.

Not modelled: Klok and real timing; the 128-bit microword layout (the page shows fields, not bits); the parallel phases inside a microword (here fields run in order); the last-resort use of the spare DRAM half for a huge object (the page traps); offline renumbering of object numbers; the disk processor's B-tree; networks of Rekursivs; the C and Prolog instruction sets Linn planned. BYTE's control store map has 2048 entries for 10-bit opcodes, which only reach 1024; the page uses 1024. BYTE's Listing 1 as printed puts the copied CDR in the CAR, which mirrors the tree. The page copies faithfully and keeps the listing's CDR-first order.

This page's own: the LINGO-8 microcode and its opcode numbers; the Lingo-like language and its compiler; the compact type codes; symbols as compacts indexing a symbol table in the machine; the layouts of classes, methods and the root object; the hash (number mod slots); the VR status bits; spilling the new objects a written object refers to; keeping a modified disk object live in GC; disk timing (15 ms) and GC cost; the HADES protocol and the host's printer; Numerik's registers widened to 40 bits; and the warm start that preloads the image. A power cycle starts cold.

Keyboard: Space run/pause, S step, B back, R reset, P power cycle. Back undoes recent manual steps; running clears that history.

10 / The instruction set

LINGO-8 · opcode · microwords up to the routine’s next label · page's own

11 / What it got right, and what it got wrong

With hindsight

What it got right

What it got wrong