ADVENT #2 — flexi disc

A graphic with the names of the media featured in this series
Day 2: flexi disc

Yesterday introduced the austere language I use at the moment to program Alice, but I didn’t say much about how that got distilled into something that ran from a write-once tape.

Here’s an example of the tape for the trivial program

((lambda (v) (add v 22)) 12)

taken from the tape dump at the REPL:

  0: alice
  1: deferred pc:1 fp:1 r1:0 r2:0 blocked:1 completed:1 next: 0
  2: frame(0)
  3: lit:12
  4: lit:22
  5: sz:3
  6: frame(7)
  7:   feed(fp[4], abs[5])
  8:   reg[r1] = fp[4]
  9:   r1[1] = abs[3]
 10:   r1[2] = abs[4]
 11:   call(add, fp[4])
 12:   fp[0] = r1[0]
 13:   alice
 14:  frame(5)
 15:    lit: 34
 16:    blank
 17:    addr:2
 18:    addr:14
 19:    addr:20
 20:  frame(3)
 21:    lit:34
 22:    lit:12
 23:    lit:22 

What the heck does this mean? Is this the tape before or after? With this system, the point is for you to be able to work backwards from an executed tape to its state at any earlier point.

What I’ll point out in this installment is that this version of ARVM (which I run in JavaScript on my iPad) has four registers: pc —program counter, fp — frame pointer, r1 — general purpose base register 1, r2 — general purpose base register 2. r1, r2, fp are base registers. fp and pc are maintained by the runtime. r1, r2 are controlled by the program.

The last instruction would have been 13: Alice. Alice means halt, but it was unnecessary. The instruction 12: fp[0] = r1[0] filled the cell that satisfied execution and the machine simply stopped at that point.

Today’s removable media is the ’flexi disc’, or ‘Floppy ROM’. These were adaptations of the thin sheet plastic phonograph records used without much success to distribute music promotionally in magazines. Data was encoded in the then-interoperable ‘Kansas City‘ audio data format used more typically with data saved to micro cassettes.

Users, or the notional users anyway, would typically have recorded the disc from a magazine onto their own cassette tape prior to use.

Subscribe to Paper Tiger

Sign up now to get access to the library of members-only issues.
Jamie Larson
Subscribe