Light hammertone paint, orange hairline rules under small section legends, dark
lamps with amber lit ones, a red SEND button, and real hardware drawn on the plate:
a card edge slot with fingers and two screws for the 27C512 program cartridge, and a
DE-9 for the 6850 serial line. The cell dial keeps the LSB wedge at nine oclock and
labels the other seven lamps 1 to 7, which is better than labelling all eight:
the wedge already says which one is 0.
Also recorded in docs/hardware.md: the cartridge is a card edge one (a small PCB with
the EPROM, fingers into a 2x22 edge connector), with a bare ZIF-28 socket as the cheap
version. Neither needs a cable, because strict Harvard means there is no way to feed
a program in at run time -- swapping the chip is the delivery mechanism.
Dropping the decimal display is right on three counts and the mockup now reflects
it. The panel has the 64 cell ring with dp lit, the eight bit lamps of the pointed
cell with their bit numbers, the eight instruction lamps with the current one lit,
the dp bit bars, bakelite RUN / STEP / RESET, the eight input switches, the ZIF
cartridge and the serial line showing "> 12 34 + ." then "0046". A mechanical step
counter shows how far a single step run has gone.
Why it is better: numbers are the terminal job, and the "//->digits" machinery is
already in software where it belongs; the panel showing bits and position is the
truer picture of the machine; and it removes four Nixie tubes, four K155ID1 and the
170 V rail -- 150 to 300 CNY and a high voltage supply -- leaving only the 90 V neon
rail and 6 V for the bulbs.
panel_mockup_vintage.py now draws this state only panel, so the drawing and the
hardware stay in step.
Seven segment LEDs read as 1975, so the panel got a second mockup with period
display technology: four Nixie tubes for the digits (K155ID1 / 74141 BCD to
decimal drivers and a 170 V rail), a ring of 64 neon lamps with dp lit, grain of
wheat filament bulbs for the eight instruction lamps, neon bars for the ip and dp
rows, bakelite buttons with chrome bezels, hammertone paint and filled engraving,
and a second hand dial for the optional mechanical dp.
The honest costs: four IN-12 tubes are 100 to 240 CNY, four K155ID1 40 to 80, the
HV supply 20 to 40 more, 64 neon lamps around 60, plus a driver array for them --
a 6 bit to 1 of 64 decode is two 74LS154 and the lamps can be wired as an 8 by 8
matrix so only 16 high voltage transistors are needed, since a half selected
neon sees half the strike voltage and stays dark.
Rails become the 1960s set: 5 V for the TTL, 6 V for the bulbs, 90 V for the neon,
170 V for the tubes -- a transformer with several secondaries, or small modules
per rail. Both mockups are checked in with the scripts that draw them, so the
layout can be edited and regenerated.
hardware/panel-mockup.png (drawn by hardware/panel_mockup.py, no external assets
needed) is a 200 x 100 mm front panel sketch: four seven segment digits showing
the pointed cell, eight instruction lamps with the current one lit, a sixteen lamp
ip row and a six lamp dp row, RUN / STEP / RESET buttons, an eight switch input
byte with a SEND button, the 64 cell ring drawn as a dial with dp lit, the ZIF-28
socket for the 27C512 program cartridge, a UART line showing "> 12 34 + ." and
"0046", and the optional mechanical dp dial. Behind it all sits a 160 x 100 mm
Eurocard with about 34 DIP sockets, a 1 MHz can and a 5 V 2 A supply.
The script is checked in because the drawing is meant to be edited: python
hardware/panel_mockup.py out.png regenerates it.
The two things software cannot check by reading its own source are the 3 bit
packing and the bracket strategy, so both got a tool and a test.
New in the library (r8forge/tape.hh, src/tape.cc): the opcode numbering (taken
from ROT-8-viz enum, so the packed image and the hardware decoder cannot drift),
text <-> opcodes, opcodes <-> 3 bit bytes, the .r8t image with its trailer and
crc32, and a machine model that runs a packed tape the way a board would. The
model takes the bracket strategy as an option: backward scan with loop stack or
not, and jump-back-onto-the-[ (the contract) or past it (what the interpreters
do). All four combinations print the same thing, and the step count differs by
exactly the number of taken ] instructions -- which is what the test asserts.
Found and fixed while writing it: the loop stack discipline depends on the jump
convention. Jumping onto the [ means the [ re-pushes, so ] must pop on the jump;
jumping past it means the entry must stay until the loop exits. Mixing them up
emptied the stack on the second iteration of the calculator main loop -- caught
by the equivalence test on examples/calc.r8asm, not by reading the code.
Tools: r8forge_tape_pack (text tape -> image + --hex for $readmemh + --verify,
727 instructions become 273 bytes for hello, 62%, and the trailer sits past the
halt so address 0 of a ROM is instruction 0), and r8forge_tape_run now reads an
image directly and takes --loop-stack / --retest.
hardware/rot8.v: the 8 bit / 64 cell machine -- 3 bit opcodes from a byte
addressed memory read as a 16 bit window, a 6 bit dp with free wrap, the loop
stack bracket jump, blocking input, halt on ip == length, and a step counter that
counts instructions rather than cycles. hardware/tb_rot8.v loads a --hex image
and prints the OUT stream in tape_run format.
Verified with Icarus Verilog 14 (the RTL against tape_run --loop-stack --retest):
hello 577 instructions 417 steps 10 outs
term 16414 17643 11 (fed "lhi")
calc 51378 166741 19 (fed "12 34 + .": prints the prompt,
046 and the next prompt)
flagship 43676 100142 93
Every OUT stream identical. ctest -R rtl_sim runs that comparison from an 8 bit
build (11 tests in the default build now, where the RTL test self-skips because
the RTL is the 8 bit machine).
Two traps worth remembering: Icarus passes plusargs through as raw bytes, so an
absolute +HEX path containing non-ASCII (this checkout is under a Chinese
directory name) arrives mangled, $readmemh silently leaves the memory empty and
the machine obediently runs LEN steps of opcode 0 printing nothing -- run vvp
from the directory holding the hex with a relative name. And in_ready must not
be qualified with !in_valid or the input handshake deadlocks.