|
GE-115 Emulator
An Emulator of the General Electrics GE-115 computer
|
The single interchange format shared by the toolchain and the (future) real-machine loader. One small big-endian header carrying origin and entry, followed by the flat machine-code image.
Three tools must agree on one byte layout:
--image) and reads it (auto-detected)../ge prog.bin).It is also the format intended for injection into the real GE-120 through the card-reader interface (binary mode): a minimal hardware/ROM bootstrap reads the 12-byte header to learn where to place the image and where to jump.
The single definition lives in binimage.h / binimage.c, compiled into all three tools — there is no second copy of the layout.
All multi-byte fields are big-endian (the machine's native order).
length image bytes.image bytes to mem[origin .. origin+length) and sets the program counter to entry.origin + length must not exceed 0x10000 (64 KiB address space).origin=0x0000, entry=0x0000, length=6; image = 0a 00 47 f0 00 00 (HLT ; JU 0x0000).
ENTRY <expr> directive sets the entry point; default = the load origin (lowest address emitted). --org N sets that origin.gemu reads the header (binimage_read), loads the image at origin via ge_load_image (origin-aware, parity primed), then ge_enter(entry) seeds the program counter and drops the sequencer into the alpha (fetch) phase — the direct binary path does not run the peripheral LOAD bootstrap.
The format is closed under the toolchain — verified byte-identical:
and for real decks:
gdis auto-detects the GE12 magic on input, so a unified .bin is recognised whether or not --bin is given; a non-matching file falls back to raw (--bin) or .cap parsing.
ge_clear) seeds the eight 16-bit segment-base / change registers there (identity bases N<<12). A flat image that spans this window will overwrite them with its own bytes (or zeros in reconstructed gaps), which can break segment-base addressing. Programs that load across low memory must re-establish these bases (or the loader must preserve them). See docs/ISA.md §4 for the addressing model. gemu's direct binary-load path re-seeds the identity bases after loading (ge_seed_segment_bases), so a depunched diagnostic runs correctly: funktionalcpu reaches its documented idle HLT at PO=0x175a (asserted in tests/roundtrip.sh).mem[0x0E00]) to pick a sub-test. Set it with ./ge fk.bin --poke 0x0E00=0xNN. With it 0, funktionalcpu takes the "no test
selected" idle halt (0x175a). Driving the memory-test halts (3465 / 1466–146B / 19DE) needs the exact option-byte encoding and installed-memory sizing, which is still being recovered from the diagnostic listing (an option value of 0x10 runs off the loaded image into high memory) — tracked as evidence work.docs/ISA.md §4.2.