ROM Reconstruction
ROM Reconstruction
Goal: rebuild every KN5000 firmware image from disassembled source, byte for byte. Since 2026-10-29 the goal covers the data-only dumps too: the waveform ROM IC307, the rhythm ROM IC14, the other models’ wave, rhythm and custom-data images and the softlist floppies (see Data images rebuilt from typed source).
Byte-identity is the project’s only acceptance criterion. The gate is
make gate-all # every gated image of every model, and the 50 softlist floppies
which runs, in order (the image rows each target checks, as the root Makefile and the
scripts it calls define them at disassembly c6630b0d7, 2026-10-29; the MN10300 rows re-read at
39fc875ef, 2026-10-30):
| target | what it checks |
|---|---|
make gate |
rebuilds the KN5000 trees, then scripts/analysis/assert_images_assemble.py (each root source must assemble, asked of the assembler directly) and scripts/analysis/assert_byte_identical.py over 21 image pairs: main CPU v10, v9, v8, v7, v6 and v5; sub-CPU payload v1.42, v1.41 and v1.40 and their three update images; sub-CPU boot (IC30); table data; custom data (IC19); HD-AE5000 v2.06i, v2.01i, v1.15i and v1.10i; the waveform ROM IC307 and the rhythm ROM IC14. Then the SHA-1 of every uncommitted reference (v8, v6, v5, HD-AE5000 v2.01i, v1.15i and v1.10i, IC307), verify-rhythm-data-raw (IC14’s raw read, A19/A21 swapped, equals the rebuilt image with the two lines swapped back), the update images’ decompression check, the v1.41/v1.40 generators’ --check, the HD-AE5000 menu map’s --check, l2_symbol_reference.py --check and gui-check (the NAKA GUI headers, records and menu map are not stale) |
make gate-wsa1 |
the four SX-WSA1R images (prom_a, prom_b, prom_c, prom_d), then gui_menu_map.py --check (wsa1/docs/gui-menu-map.md is generated from the sources) |
make gate-kn7000 |
make -C kn7000 verify verify-sp7001 verify-picture verify-cnv verify-table80 verify-ic18 verify-ic18-full verify-935 verify-893 verify-wave verify-customdata verify-ic21-own verify-gui-map: program 941 and table 84; the SP7001 program 942, table 83 and BASEEXT.XAP; the IC19 picture ROM; the seven Style Convert converters; table build 80; the IC18 boot ROM and all of IC18 with its rhythm data; program builds 935 and 893; the four wave ROMs (IC203/IC204, IC207/IC208); the nine factory custom-style banks (IC21); all 2 MB of the owner’s own IC21 read (since 2026-10-31); and (since 2026-10-29) that the generated GUI menu maps are current |
make gate-kn2400 |
the KN2400 program image, and verify-kn2600: the KN2600 package’s uncompressed KN24PRG.DAT equals it byte for byte; since 2026-10-29 also verify-gui-map (the menu map is current) and symbols-check (the committed symbol files are what the generator writes) |
make gate-kn6000, gate-kn6500, gate-hdsx3 |
one program image each; gate-kn6000 also verify-customdata, the factory custom-style bank 01ctmini.ic18 that the KN6000 and KN6500 share; since 2026-10-29 each also verify-gui-map and symbols-check |
make gate-floppy |
make -C floppy gate: the 50 softlist diskettes (KN5000 14, SX-WSA1R 9, KN6000 21, KN7000 6), each rebuilt from typed FAT12 source and checked against its recorded SHA-1 |
and finally assert_toolchain_is_a_prerequisite.py, to prove the assembler is a
prerequisite of every image rather than a stale object comparing green forever. It
compares bytes and exits non-zero on any difference. A change that fails it is reverted,
not explained away. The MN10300 trees (KN7000 and its four siblings) have their own
assembler, kn7000/tools/kn7asm.py; how much of each model’s images is source is in
Every model: how much is source below.
⚠
compare_roms.pyis a similarity report, not the gate. It printsSimilarity: 100.00%, rounded to two decimals — in a 2,097,152-byte ROM that rounding covers up to 104 differing bytes, andgrep -c "Similarity: 100.00%"prefix-matches the failing lineSimilarity: 100.00% (N incorrect bytes)as well. It is useful for locating where a divergence sits, and it is what prints the twenty-five verification sections below (nineteen LLVM, six legacy ASL). It covers the KN5000 only. It is not an acceptance criterion; see Disassembly Workflow.A full similarity run needs
make clean-all && make all && make asl-allbefore it, becausemake allbuilds only the LLVM targets andcompare_roms.pysilently skips a section whose built file is missing — the short form prints nineteen sections, all reading100.00%, having never assembled the mirror.
Every model: how much is source
A green gate says nothing about how much of an image is real source rather than a
passed-through blob, so that is measured separately, per model, with the commands below
(run at disassembly 2319e9b94, 2026-10-24; the KN5000 row re-run at 8d0865c27, 2026-11-06):
| model | how much of the image is source | command (in the disassembly repository) |
|---|---|---|
| KN5000 | 99.9% of its 13 measured images (16,056,320 B; 15,634 B verbatim); 12 with no verbatim byte, the ported v6 and v5 among them (0 B since 2026-11-06); table data 99.3% (15,634 B: two stale SLIDE4K tails no source can rebuild). v8 is v9’s source; v1.41 and v1.40 are not measured on their own | python3 scripts/analysis/kn5000_source_coverage.py |
| SX-WSA1R | 100%: no .incbin left; 78.0% substantive, the rest verified filler emitted as .fill |
cd wsa1 && python3 scripts/analysis/source_coverage.py |
| KN7000 | 44.58% of program 941 (1,853,232 of 4,157,185 B): all 3,658 function blocks are instructions; the 2.3 MB data region still enters as .incbin_range |
cd kn7000 && python3 tools/coverage_score.py |
| KN2400 / KN2600 | 98.91% of the code ranges emitted as instructions (46.77% of the image) | kn2400/notes/conversion-stats.txt, written by the generator |
| KN6000 | 98.72% of the code ranges (36.64% of the image) | kn6000/notes/conversion-stats.txt |
| KN6500 | 98.96% of the code ranges (41.63% of the image) | kn6500/notes/conversion-stats.txt |
| HD-SX3 (most probably HD-SX6) | 99.53% of the code ranges (32.09% of the image) | hdsx3/notes/conversion-stats.txt |
The MN10300 rows measure something weaker than the TLCS-900 ones. kn5000_source_coverage.py
counts only verbatim blobs as debt, so typed data counts as source; the MN10300 generators
count instructions against .incbin_range passthrough, and the data regions of those
images are not typed yet. The MN10300 trees are described on
KN7000 Firmware Images,
KN2400 / KN2600 Disassembly and
KN6000 / KN6500 / HD-SX Disassembly.
The open-items register
Everything still open in the disassembly repository is collected in one generated file,
notes/open-items/REGISTER.md, written by python3 notes/open-items/collect_open_items.py --write
(set up 2026-10-31). It gathers four sources: items under the “Open” / “Left open” / “TODO” headings
of the notes and per-tree READMEs (and the repo-root “Known Disputed Interpretations” table), the
tracker issues in .beads/issues.jsonl that are not closed, the ; TODO and TODO(port) markers in
the sources (counted per tree and grouped), and the census: opaque declarations of the data census.
Each item gets a stable id and is joined with its triage row in notes/open-items/triage.json:
RESOLVED, ACTIONABLE or BLOCKED, with the area, the plan, the blocker and the owning lane. The
register’s own summary table gives the counts; read them there, at the commit you are looking at,
rather than from this page.
Firmware Version History
Official firmware updates were distributed on floppy disk. All versions are archived at archive.org.
Provenance note. The release dates below come from the update-disc listing, not from anything inside the ROM images, and no corresponding dates exist in the disassembly repository. Treat them as unconfirmed.
Main Board Firmware
| Version | Release Date | Source tree |
|---|---|---|
| v5 | 1997-11-12 | v5/maincpu/ (ported from v6), byte-identical; the earliest release held; the dump is not committed (MAME BIOS 5) |
| v6 | 1998-01-16 | v6/maincpu/ (ported from v7), byte-identical; the dump is not committed (MAME BIOS 4) |
| v7 | 1998-06-26 | v7/maincpu/, byte-identical |
| v8 | 1998-11-13 | built from the v9/maincpu/ sources with --defsym FW_VERSION_BYTE=0x08, byte-identical; the dump is not committed (see below) |
| v9 | 1999-01-26 | v9/maincpu/, byte-identical |
| v10 | 1999-08-02 | v10/maincpu/ — the primary disassembly target |
All six main-CPU releases are source-built; v8, v6 and v5 joined them on 2026-10-24. v8
(disassembly 96de17552, merged as 79ce44080) needs no tree of its own: cmp -l
against v9 prints one line, file offset 0x1FFFE8, 0x08 for 0x09, so the Makefile
assembles v9/maincpu/kn5000_v9_program.s again with llvm-mc --defsym FW_VERSION_BYTE=0x08
(the byte is a .set in v9/maincpu/boot/rom_end_structure.s that defaults to 0x09).
The v8 dump itself is not in the repository, which has a public remote: make copies it
from the private romset (KN5000_V8_REF=) into the git-ignored original_ROMs/ path and
refuses it unless its SHA-1 is a10a6f5a35175b74c3cfb42cef3bdf571c2858bb, and make gate
re-checks that hash. v5 and v6 are archived on
archive.org and selectable
as MAME BIOS options; their chip dumps are held in the private romset and copied the same way
(KN5000_V6_REF, KN5000_V5_REF). Their trees were generated from v7’s and v6’s by
scripts/converters/port_maincpu_version.py (v6/maincpu/README.md, v5/maincpu/README.md). How
far each is from v7 is measured in notes/kn5000-version-deltas-2026-10-24/ in the disassembly
repository.
The sub-CPU payload has the same shape: v142/subcpu/ and, since 2026-10-24,
v141/subcpu/ are source-built and gated, each together with its compressed update image.
The v1.41 tree is generated from v1.42 plus three recorded edits, the only real changes
between the two revisions, and v140/subcpu/ (since 2026-10-24) from v1.41 the same way. See
Sub-CPU Firmware Images.
The Source Tree Inventory lists every held image of every model with its state in the repository.
HD-AE5000 Firmware
| Version | Release Date | Notes |
|---|---|---|
| v1.10i | 1998-07-06 | Initial release. Dump in the private romset (MAME BIOS 0), not in the repository; byte-exact source tree hdae5000_v1_10i/ since 2026-10-30 |
| v1.15i | 1998-10-13 | Dump in the private romset (MAME BIOS 1), not in the repository; byte-identical to HKEXTROM.XAP inside the official AE5-115.exe installer and to the unversioned hd-ae5000.ic4; byte-exact source tree hdae5000_v1_15i/ since 2026-10-30 |
| v2.01i | 1999-01-15 | Added lyrics display (the installer calls it “v2.0i”; the ROM’s own signature reads v2.01i). Dump in the private romset (MAME BIOS 2), not in the repository; byte-exact source tree hdae5000_v2_01i/ since 2026-10-24 |
| v2.06i | unknown | The image the source tree rebuilds (hdae5000/hd-ae5000_v2_06i.s), MAME BIOS 3 |
Verification Sections
Primary build (LLVM)
| Section | Original image | Size | Base | Top-level source |
|---|---|---|---|---|
| maincpu v10 | kn5000_v10_program.rom |
2MB | 0xE00000 | v10/maincpu/kn5000_v10_program.s |
| maincpu v9 | kn5000_v9_program.rom |
2MB | 0xE00000 | v9/maincpu/kn5000_v9_program.s |
| maincpu v8 | kn5000_v8_program.rom (not committed) |
2MB | 0xE00000 | v9/maincpu/kn5000_v9_program.s, FW_VERSION_BYTE=0x08 |
| maincpu v7 | kn5000_v7_program.rom |
2MB | 0xE00000 | v7/maincpu/kn5000_v7_program.s |
| maincpu v6 | kn5000_v6_program.rom (not committed) |
2MB | 0xE00000 | v6/maincpu/kn5000_v6_program.s |
| maincpu v5 | kn5000_v5_program.rom (not committed) |
2MB | 0xE00000 | v5/maincpu/kn5000_v5_program.s |
| subcpu payload v142 | kn5000_subprogram_v142.rom |
192KB | 0x0400 | v142/subcpu/kn5000_subprogram_v142.s |
| subcpu v142 update image | kn5000_subprogram_v142_compressed.rom |
93,203B | 0x3E0000 | (compressed from the built payload — see below) |
| subcpu payload v141 | kn5000_subprogram_v141.rom |
192KB | 0x0400 | v141/subcpu/kn5000_subprogram_v141.s |
| subcpu v141 update image | kn5000_subprogram_v141_compressed.rom |
93,181B | 0x3E0000 | (compressed from the built payload, as for v142) |
| subcpu payload v140 | kn5000_subprogram_v140.rom |
192KB | 0x0400 | v140/subcpu/kn5000_subprogram_v140.s |
| subcpu v140 update image | kn5000_subprogram_v140_compressed.rom |
93,124B | 0x3E0000 | (compressed from the built payload, as for v142) |
| subcpu boot | kn5000_subcpu_boot.ic30 |
128KB | 0xFE0000 | subcpu/boot/kn5000_subcpu_boot.s |
| hdae5000 | hd-ae5000_v2_06i.ic4 |
512KB | 0x280000 | hdae5000/hd-ae5000_v2_06i.s |
| hdae5000 v2.01i | hd-ae5000_v2_01i.ic4 (not committed) |
512KB | 0x280000 | hdae5000_v2_01i/hd-ae5000_v2_01i.s |
| hdae5000 v1.15i | hd-ae5000_v1_15i.ic4 (not committed) |
512KB | 0x280000 | hdae5000_v1_15i/hd-ae5000_v1_15i.s |
| hdae5000 v1.10i | hd-ae5000_v1_10i.ic4 (not committed) |
512KB | 0x280000 | hdae5000_v1_10i/hd-ae5000_v1_10i.s |
| table data | kn5000_table_data.rom |
2MB | 0x800000 | table_data/kn5000_table_data.s |
| custom data | kn5000_custom_data.ic19 |
1MB | 0x300000 | custom_data/kn5000_custom_data.s |
| waveform IC307 | kn5000_waveform_rom.ic307 (not committed) |
4MB | 0x000000 (no CPU address) | waveform/kn5000_waveform_ic307.s |
| rhythm data IC14 | kn5000_rhythm_data_rom.ic14 (not committed; descrambled) |
4MB | 0x400000 | rhythm_data/kn5000_rhythm_data.s |
Legacy ASL mirror build
The project’s original ASL sources are kept in archive/asl/ and are still built and
compared: maincpu, subcpu boot, subcpu payload, table data, custom data and hdae5000 —
six more sections, all at 100.00%. They are built by make asl-all, which is not a
dependency of make all (nor of make gate-all, which never builds or checks the mirror),
so the full similarity run under Assembler has to name it explicitly.
The mirror is not a museum piece; it constrains the work. The ASL sources still
binclude several data blobs (initial_data.bin, wallpaper1_to_icons.bin and
icon_pixel_data.bin whole, icons_to_strings.bin up to file offset 0x7F2D8, …), so those
files must stay byte-identical on disk even after the LLVM sources stop referencing them.
Conversions therefore slice with .incbin "file", offset, length rather than splitting a
blob into new files.
The v1.42 sub-CPU firmware-update image
The sub-CPU payload is verified in both of the forms it ships in.
original_ROMs/kn5000_subprogram_v142_compressed.rom is the v1.42 payload as it appears
on a firmware-update disk (“Program DATA FILE PCK”, File Type 007, flashed to Custom Data
0x3E0000). It is an 11-byte header — "SLIDE4K" + NUL, then a 24-bit big-endian
decompressed size (03 00 00 = 196,608) — followed by the LZSS stream.
Because the payload itself is already source-built, recompressing the build output with
the factory stream’s own decisions must reproduce the update image exactly. The Makefile
rule does that and then seals it with cmp:
rebuilt_ROMs/kn5000_subprogram_v142_compressed.rom: \
rebuilt_ROMs/kn5000_subprogram_v142.llvm.rom \
original_ROMs/kn5000_subprogram_v142_compressed.rom
python3 scripts/build/compress_lzss.py $< $@ --strict --with-header \
--reference original_ROMs/kn5000_subprogram_v142_compressed.rom
cmp $@ original_ROMs/kn5000_subprogram_v142_compressed.rom
--with-header (added at the same time) emits and validates the SLIDE4K header;
--strict --reference replays the factory encoder’s match/literal decisions so the
output is byte-identical rather than merely equivalent. The section appears in
compare_roms.py as subcpu v142 update image.
See LZSS Compression for the format, and Sub-CPU Firmware Images for what this means for the v1.40 and v1.41 payloads.
Generated data with its own verification targets
Two families of compressed data are no longer bincluded as opaque payloads; they are rebuilt from checked-in sources and compared against factory slices.
| Target | What it rebuilds | Check |
|---|---|---|
make verify-demo-presets |
19 SLIDE4K demo-song presets, from .mid + .yaml sidecars |
19/19 byte-identical |
make verify-help-databases |
6 SLIDE8K help databases, recompressed from the five text listings and the stale German block | 6/6 byte-identical |
make verify-help-db-text |
the five live decompressed databases (0x9000 B each), from help_db_<lang>.txt |
5/5 byte-identical |
Demo presets. All 19 presets (entries 0–17 at 0x9C4050–0x9F94CA plus the Feature
Presentation at 0x8E0000) round-trip from a .mid file — the musical content, editable
in any DAW — and a .yaml sidecar carrying everything MIDI cannot express: song header,
cell topology, padding, stream order, running-status flags and the durations MIDI cannot
represent. compress_lzss.py --strict aborts the build if any payload stops matching the
factory stream, so an edit can never silently ship different music.
Help databases. The five live multilingual help databases (English, German, French,
Spanish, Indonesian) plus one stale sixth block are SLIDE8K — a previously undocumented
8 KB-window LZSS variant. The firmware itself supports both widths: the main-CPU routine
SLIDE_Parse_Header reads the digit in the magic and branches on it, 0x34 ('4') to
SLIDE_Decompress_4K_Init and 0x38 ('8') to SLIDE_Decompress_8K_Init. Each database
decompresses to exactly 0x9000 bytes.
Since 2026-10-29 the source of each live database is a UTF-8 text listing,
table_data/includes/help_databases/help_db_<lang>.txt, one entry per topic and page;
scripts/build/help_db_text.py builds the 0x9000-byte database from it, and that build
product is what compress_slide8k.py packs. The database layout and the listing format are on
LZSS Compression.
compress_slide8k.py --strict --reference replays the factory encoder’s decisions,
which is necessary because the final flag bytes carry nonzero unused bits that a plain
re-encode would not reproduce.
The sixth block, at ROM 0x983B3A, is a superseded German revision that nothing points at.
It is truncated, not merely corrupt: its stream decodes identically to the live German
database for exactly 0x55E0 output bytes, and the element that would produce output 0x55E0
is the first to read past 0x985FFF — because the factory image wrote the two Music Stylist
pointer tables at 0x986000/0x987000 straight over this obsolete block’s tail. It is
therefore kept as a byte-exact raw slice of the dump and is not rebuilt from source; a
whole-extent reference slice is still round-trip-verified by make verify-help-databases
to pin the bytes down.
Data images rebuilt from typed source (2026-10-29)
On 2026-10-29 the owner widened the goal from the program images to every dump that holds only
data: “ensure any data block in the source is only left as a generic binclude if there’s no
other better semantic representation for it.” The dumps that had no tree at all got one, and each
is gated. The plan and the per-lane outcomes are in
notes/data-semantics-2026-10-29/README.md
in the disassembly repository.
| image | source tree | gate target | what the source is |
|---|---|---|---|
| KN5000 waveform ROM IC307 (4 MB) | waveform/ |
make gate (verify-ic307-reference) |
per page, the directory and the 1,495 parameter records as typed rows; the 1,413 PCM waves built from committed WAV files |
| KN5000 rhythm ROM IC14 (4 MB, descrambled) | rhythm_data/ |
make gate (verify-rhythm-data-raw) |
no .incbin at all: 202 style records and 28,400 tracks, event by event; the raw read is checked by swapping A19/A21 back |
| KN7000 wave ROMs IC203/IC204, IC207/IC208 (4 x 16 MB) | kn7000/src/wave/ |
make -C kn7000 verify-wave |
per 2 MiB page a typed directory and parameter records; the 3,682 recordings built from WAV files; each stream split back into its Y and X chips |
| KN7000 IC18, the whole chip (boot ROM + “Technics Rhythms”) | kn7000/src/ic18/ |
make -C kn7000 verify-ic18-full |
no .incbin: boot.s, then rhythm.s and one file per style under styles/, every event on its own line |
| KN7000 custom-style banks (IC21), nine factory sets | kn7000/src/customdata/ |
make -C kn7000 verify-customdata |
the directory, slots, styles, pads and sounds typed; 679 small residue items (4,179 B) declared opaque |
| KN7000 IC21, the owner’s own unit (2 MB) | kn7000/src/ic21own/ |
make -C kn7000 verify-ic21-own |
USER MIDI SETTINGs, CUSTOM PANEL, system settings, FAVORITES, HOME PAGE and the CUSTOM bank typed; 191 residue items (2,256 B) opaque |
KN6000 / KN6500 custom-style bank 01ctmini.ic18 |
kn6000/src/customdata/ |
make -C kn6000 verify-customdata (in gate-kn6000) |
the same format as the KN7000’s IC21, typed |
| The 50 softlist floppies | floppy/ |
make gate-floppy |
boot sector, FATs and directory entries field by field; each file a unit its model’s format describer types |
The reference images of all of these stay out of the public repository: the Makefiles copy them, git-ignored, from the private romsets (or, for the floppies and the custom-style sets, regenerate them from the softlist disks) and refuse a copy whose SHA-1 differs from the one they record. A PCM body is a committed WAV file that the build converts back into the ROM’s bytes, and every picture is a committed PNG, JPEG or BMP; nothing a converter writes from them is tracked, and a clean checkout builds every conversion with no reference image present (2026-10-31, Media Files). The format pages are Waveform ROM Format, Rhythm ROM (IC14) and Floppy Disk Files and Formats; the KN7000 ones are KN7000 Wave ROM Format and the pages listed on KN7000 Firmware Images.
The existing KN5000 trees lost their last generic includes the same day: the HELP databases
became text listings (below), and the custom-data (IC19) style banks became typed
STYLE_SECTION records. Those banks hold the 30 sections of one style, not 30 styles.
The data-include census
scripts/analysis/data_incbin_census.py
is the instrument for that goal. It reads every git-tracked .s / .inc of each tree (as bytes),
sizes every .incbin and .incbin_range directive, and puts each one in the first class that
fits:
| class | meaning |
|---|---|
| generated | the bytes come out of a committed generator from committed source: compiled C under generated/, or a line marked census: generated -- <generator> |
| media | a self-describing file a viewer reads directly (PNG, JPEG, BMP, WAV, MIDI, …) |
| opaque | declared census: opaque -- <kind>: <why>, with a mandatory reason; kinds are pcm, compressed, code, unknown-dump and fill (personal removed 2026-10-31) |
| generic | anything else: an anonymous binary include. The goal is generic = 0 in every tree |
An include made from a standalone media file through a committed lossless converter (a PNG through
se_bitmaps.py, a WAV through pcm_wav.py, …) is generated, its marker naming the converter
and the file; since 2026-10-30 a column from media counts those entries per tree, so the table
shows how much of generated an ordinary viewer or player opens
(Media Files).
It measures how much data still enters the build as an unexplained blob. It does not measure
whether a typed field is named after what the firmware does with it: a field can be typed and
still carry an offset name. --snapshot writes docs/coverage/data-incbin-<date>-NN.{txt,json}
and --compare exits 1 when any tree’s generic bytes rose. The first committed snapshot is
docs/coverage/data-incbin-2026-10-30-01.txt,
measured at disassembly 28bad682a after the last data-semantics lanes merged (their summary is
the “Final state” section of notes/data-semantics-2026-10-29/README.md). The second,
docs/coverage/data-incbin-2026-10-30-02.txt,
measured at 141313939 after lane generic-zero merged (committed in 347fd0cf0; the section
“Generic 0” of the same README), reads generic 0 in every tree. The third and current,
docs/coverage/data-incbin-2026-10-30-03.txt,
measured at a9b5cf764 after lanes media-files, code-island and callee-walk merged (committed in
d91a7e405), still reads generic 0 everywhere, and adds the from media column. The fourth and
current, docs/coverage/data-incbin-2026-10-30-04.txt, measured at b84f732aa (committed in a25c88274), adds the HD-AE5000 v1.15i
and v1.10i trees (kn5000-hdae115, kn5000-hdae110: 8 generated includes each, 4 of them from
media, 0 opaque, 0 generic) and otherwise repeats -03. Two snapshots of 2026-10-31 follow: -31-01 (at d9d06262d, after lanes
ic21-own and hdae-ledgers, which add the trees kn7000-ic21own and the older KN5000 images) and the
current docs/coverage/data-incbin-2026-10-31-02.txt
(measured at 6ca33e656 after lanes media-build, mn10300-formats and mn10300-typer, committed in
c58fe3de7). Both still read generic 0 in every tree. Generic bytes per tree, before the work
(disassembly b58b8f696), after the twelve lanes that merged on 2026-10-29 (run at c6630b0d7), and
in the snapshots (-04 reads as -03 for these trees):
| tree | generic bytes before | after 2026-10-29 | snapshot 2026-10-30-01 | snapshot 2026-10-30-02 | snapshot 2026-10-30-04 |
|---|---|---|---|---|---|
| kn5000-v10 | 4,928 | 0 | 0 | 0 | 0 |
| kn5000-v9 | 4,928 | 0 | 0 | 0 | 0 |
| kn5000-v7 | 4,928 | 0 | 0 | 0 | 0 |
| kn5000-v6 | 5,130 | 0 | 0 | 0 | 0 |
| kn5000-v5 | 4,949 | 0 | 0 | 0 | 0 |
| kn5000-tabledata | 772,289 | 0 | 0 | 0 | 0 |
| kn5000-customdata | 639,296 | 0 | 0 | 0 | 0 |
| kn7000-table | 2,560,580 | 0 | 0 | 0 | 0 |
| kn7000-b80 | 4,064,860 | 0 | 0 | 0 | 0 |
| kn7000-program | 2,563,794 | 2,563,794 | 2,948 | 0 | 0 |
| kn7000-sp7001 | 5,176,151 | 2,646,270 | 3,044 | 0 | 0 |
| kn7000-b893 | 2,607,409 | 2,607,409 | 2,944 | 0 | 0 |
| kn7000-b935 | 2,602,613 | 2,602,613 | 3,044 | 0 | 0 |
| kn2400 | 1,993,350 | 1,993,350 | 18,853 | 0 | 0 |
| kn6000 | 2,630,724 | 2,630,724 | 18,810 | 0 | 0 |
| kn6500 | 2,140,036 | 2,140,036 | 18,930 | 0 | 0 |
| hdsx3 | 533,544 | 533,544 | 266 | 0 | 0 |
Every other tree (the new data trees above, the sub-CPU, boot, HD-AE5000, WSA1R and floppy
trees) was already at generic 0 in the first snapshot, and still is in the third. The eight trees still above 0 there were
the MN10300 program images, and each of their generic pieces was read by some instruction. Lane
generic-zero (disassembly c04e41079, c65a62c5b, 4653d696b) took them to 0 in the generators
(gen_data_s.py’s reader_rows pass, gen_image_s.py --rows), with no new opaque declaration:
- the KN7000’s 30-byte “switch records” were records whose first bytes an earlier pass had taken
for short strings;
record_start()stops that, and they are typed (REC_func_484C01F1_Result, resource-id-trie leaves, the SysEx each points at); the same fix types the KN6000’sfunc_4C02CA6A_Records_p0(func_4C02CBDA_Records_p0on the KN6500) and the KN2400’sfunc_5014A95C_Records_p0; - every other piece that some instruction reads is written as rows at the reads’ width and
signedness (
tab_u8…tab_u32), address words as.long Label/Label+N, with a header naming the readers; most are blocks whose address the code only passes to a routine, so the callee decides the layout; - the KN6000 / KN6500 code file’s two
.incbin_ranges (115 + 586 B) are typed:FirmwareVersionByte, the kernel’s version string,KernelServiceHash,KernelRamLayout,KernelParams, and its two interrupt dispatchers as code; - the KN2400’s
RamCodeTrailerhas a reader after all (RamSectionsCopy).
Opaque fell with it: bytes declared unread turned out to be record parts. The snapshot counts the
data that no instruction reads as opaque unknown-dump, each piece declared with the reader
search that found nothing (the snapshots):
| tree | generic -01 n / bytes | opaque -01 n / bytes | generic -02 | opaque -02 n / bytes | opaque -04 n / bytes | opaque -31-02 n / bytes |
|---|---|---|---|---|---|---|
| kn7000-program | 177 / 2,948 | 4298 / 82,196 | 0 / 0 | 3459 / 63,917 | 3449 / 63,392 | 2174 / 45,394 |
| kn7000-sp7001 | 179 / 3,044 | 4321 / 80,480 | 0 / 0 | 3482 / 62,187 | 3472 / 61,662 | 2196 / 43,654 |
| kn7000-b935 | 179 / 3,044 | 4309 / 83,003 | 0 / 0 | 3470 / 64,710 | 3460 / 64,185 | 2192 / 46,280 |
| kn7000-b893 | 176 / 2,944 | 4303 / 81,886 | 0 / 0 | 3464 / 63,600 | 3454 / 63,075 | 2177 / 45,007 |
| kn6000 | 380 / 18,810 | 3336 / 79,522 | 0 / 0 | 3197 / 70,137 | 2833 / 65,733 | 2347 / 54,782 |
| kn6500 | 386 / 18,930 | 3346 / 83,667 | 0 / 0 | 3213 / 74,371 | 2849 / 69,967 | 2364 / 59,027 |
| kn2400 | 431 / 18,853 | 5048 / 197,205 | 0 / 0 | 5051 / 196,479 | 5131 / 196,924 | 3419 / 155,297 |
| hdsx3 | 40 / 266 | 101 / 3,133 | 0 / 0 | 101 / 3,133 | 98 / 3,103 | 98 / 2,981 |
From -02 to -03 (and so -04) the KN7000 builds lost 8 opaque pieces / 507 bytes each to the kernel’s flash
tail, which is code, and 2 / 18 to the callee walk; the siblings’ falls are the callee walk’s, and the
KN2400’s rise (+80 / +445) too: the 12-byte blocks its switch descriptors point at are pieces of
their own now that the descriptors are records
(KN2400 / KN2600 Program Data).
From -04 to -31-02 opaque fell in every MN10300 tree: lane mn10300-formats typed the KN2400’s
effect descriptors and the KN7000’s sound lists, and lane mn10300-typer’s array-end rule, loop indexes,
stepped arrays and record chains typed the rest
(KN7000 Program Data Region).
Left open then, and settled on 2026-10-30: the KN7000’s func_487B8E34 (301 B declared
unknown-dump) and func_4C03B799_Table (“353 x s16”) were the MILK kernel’s flash-resident code,
which the generator now emits as code (lane code-island:
KN7000 Firmware Images). The other
item left open, that the reader walk did not follow an argument into the callee, so the reader-row
blocks kept the reader’s widths rather than the callee’s layout, is lane callee-walk’s: the walk now
follows a block’s address into the routine it is passed to, through register and stack arguments,
and writes the block as a record of what that routine reads (REC_<routine>_Arg<slot>). The KN6000’s
address-only reader rows fell from 339 pieces / 17,838 bytes to 151 / 11,022, the KN2400’s from 380 /
18,475 to 123 / 7,849, build 941’s from 50 / 1,037 to 39 / 682
(KN7000 Program Data Region).
The census measures binary includes, not names: a reader row is typed by width, not yet by meaning.
What those pieces became, and what is left opaque, model by model, is on
KN7000 Program Data Region,
KN6000 / KN6500 Program Data and
KN2400 / KN2600 Program Data.
The wave samples, which were the large opaque totals until snapshot -02 (4,170,480 B of PCM in
IC307 and 66,319,584 B in the KN7000 wave ROMs, one labelled item per recording), are generated
from WAV files since lane media-files: the class opaque pcm is empty in every tree of snapshots
-03 and later; since -31-02 the SX-WSA1R’s bitmaps are generated from media too, 225 entries,
95,342 B (Media Files).
Run it in the disassembly repository with
python3 scripts/analysis/data_incbin_census.py # the table
python3 scripts/analysis/data_incbin_census.py --list opaque --tree kn7000-program
What the source says each region is
The binclude audit of 2026-08-07 (analysis/binclude-audit-2026-08-07/) walked every
.incbin/binclude directive the repository then held: 598 directives, of which 505
were honest build products — compiled from C or assembly, or generated from documented
data. Since then the KN5000 trees have been cut into about 30,500 labelled .incbin slices
of compiled C and PNG-generated images, which that audit predates. The audit method, and the
discipline that keeps a conversion from silently asserting more than the dump supports, are
on the Disassembly Workflow page.
Table Data ROM: labelled source, not opaque halves
The LLVM source for the 2 MB table-data ROM pulls zero bytes out of anonymous blob
files. initial_data.bin, icons_to_strings.bin, wallpaper1_to_icons.bin and
icon_pixel_data.bin are not read by the LLVM build at all. The ten font glyph banks, the
87 UI bitmaps and the 177 icons are regenerated from committed PNGs
(scripts/build/font_images.py, ui_bitmaps_images.py, icon_images.py); the Composer
factory memory image is rebuilt from custom_data/styles/; and the stale German help block
and the style-record residue are derived from the live help-database streams by
scripts/generators/gen_stale_help_duplicate.py. The blobs stay on disk, byte-identical,
because the ASL mirror bincludes them (icons_to_strings.bin only up to file offset
0x7F2D8). Every remaining .incbin in the table-data sources carries a label, a length and
a comment saying what it is.
icons_to_strings.bin is audited end to end: all 742,024 bytes are accounted for — none
read by the LLVM build, 520,920 B (file 0x0-0x7F2D7) still bincluded by the ASL mirror,
and a 221,104-byte dead tail (ROM 0x9C4050-0x9F9FFF) that no build reads and that is a
stale duplicate of the now-source-built demo-song presets. It was documented rather than
deleted, because the file is a checked-in dump slice whose hash the audit quotes and because
giving those bytes a second source would be a byte-match trap. make audit-icons-blob
re-derives the map from the tree and the factory dump and fails if any of it drifts. Details
on the Table Data ROM page.
Symbol counts follow, from each file’s generated header at disassembly 3417969c0:
symbols/table_data_symbols_reference.txt holds 4,759 symbols, the sub-CPU payload’s
5,053, the HD-AE5000’s 4,099 and the sub-CPU boot ROM’s 200.
Region-by-region source map
| Region | ROM range | Now |
|---|---|---|
| Section directory + bitmap bank | 0x800000–0x82FFFF | table_data/preset_banks.s (+ generator) — 27 bitmaps the program ROM also carries; no preset data, despite the file name |
| Tone database | 0x830000–0x87FFEF | three modules: directory/offset table, 579 tone records, aux tables |
| UI bitmaps, frames, icon tables | 0x913000–0x944D77 | table_data/ui_bitmaps.s, symbolic descriptor tables |
| Font descriptors + glyph banks | 0x945C00–0x950A5F | table_data/fonts.s (10 fonts) |
| Music Stylist preset database | 0x951000–0x98156F | table_data/style_records.s, 1000 × 198 B records |
| Help index, intro strings, help DBs | 0x988000–0x9999D2 | table_data/help_databases.s + source-built SLIDE8K |
| Panel Memory factory presets | 0x99EC00–0x9ABF3F | table_data/panel_memory_presets.s |
| Composer factory memory image | 0x9B4000–0x9C3FFF | Composer_FactoryMemoryImage — one labelled 64 KB include of a build product, rebuilt from custom_data/styles/Composer_FactoryMemoryImage.styles (234 cells in the IC19 accompaniment-style cell/chain container) |
| Boot FDC command-layer driver | 0x9FD8A5–0x9FEA9C | table_data/boot_fdc_driver.s (2,316 lines) |
| Boot disk-format probe | 0x9FEB2B–0x9FEC6D | table_data/boot_disk_probe.s |
| Boot CP-serial driver | 0x9FEC6E–0x9FFB2E | table_data/boot_cpserial.s + table_data/boot_cpserial_isr.s + table_data/boot_cpserial_states.s |
| Boot C runtime (heap, strncmp, divide) | 0x9FFB2F–0x9FFE7F | table_data/boot_clib.s |
| Boot debug group (NOP-patched out) | 0x9FFE80–0x9FFEDF | table_data/boot_debug.s |
| Sub-CPU DSP data zones A0 / A / B | 0x00F7E6–0x01E17E | carved into labelled tables in v142/subcpu/subcpu_data_tables.s |
| Sub-CPU boot data region | 0xFF8000–0xFF828F | eight objects in subcpu/boot/kn5000_subcpu_boot.s: an 8-entry command-handler jump table, a RAM-test descriptor and the tone-generator velocity/touch front end |
| DSP effect + parameter name tables (maincpu) | 0xE32418–0xE33579 | DspParamUnit_Table (86 × 2), DspParamName_Table (86 × 17), DspEffectName_PtrTable (128 × u32) and DspEffectName_Strings (128 × 18) in ui_widgets/widget_descriptors.s (DSP Name Tables) |
| HD-AE5000 UI object + name tables | 0x2A5D2C–0x2A8499 | two index-parallel 790-entry pointer arrays and the name pool they index, in hdae5000/hdae5000_data_tables.s |
HD-AE5000 initialised .data image |
0x2F94B2–0x2FA133 | hdae5000/hdae5000_init_data.s — nine tables, 96 code pointers and 166 string pointers, all named from the firmware’s own registration calls |
| HD-AE5000 graphics bank | 0x2A858E–0x2F8DCD | re-split into eleven regions: five palette + bitmap pairs, laid out by a rule taken from the copy code in the title-screen procedures (HDAE5000_TtlScreenRProc, HDAE5000_TtlScreenR2Proc, HDAE5000_TtlScreenR3Proc) and confirmed byte-wise over the whole region, plus a string head |
Several of these regions are not what their file names say, and the names were kept while the descriptions were not:
bootcode_flash_handlers.binis not flash update handlers — it is the bootloader’s complete uPD72068 FDC command layer, a compact port of the maincpu FDC driver.bootcode_utils.binis not motor control, VGA display or a progress bar — it is the floppy disk-format probe plus the bootloader’s own CP-serial driver, which is independent of the runtimeCPanel_*stack in the program ROM.- The incbin boundary at 0x9FC6F6 was splitting a five-byte
ld A,(0x160002)in half. It byte-matched, but only by accident; the instruction is now emitted whole. - There is no “exponential pitch table at 0x13318” in the sub-CPU payload. 0x13318 is the
middle of
DSP_MixerGain_Curve(0x0131CF–0x0133CE), a 128-entry piecewise-exponential gain curve ending at digital full scale 0x7FFFFF00; the only proven consumer,DSP_MixerCoeff_Compute, treats its entries as amplitude. - The sub-CPU executable does not live at table-data 0x830000. That region is the tone database; where the runtime code payload is sourced from is a separate question.
HDAE5000_UiObject_PtrTable(0x2A5D2C, once labelledHDAE5000_GFX_DATA_1) is neither graphics nor code: all 3,160 bytes of it group into valid little-endian pointers — 769 into the UI descriptor pool, 20 into the RAM copy of the HD-AE5000’s.dataimage (0x239CC4–0x239FAE), and one NULL terminator. Its0x315is an entry count, not a byte size.- There is no
HDAE5000_Font_Dataregion. The address that label named holds no font, and fell 0x11818 bytes inside a 320×240 bitmap. - A 320×240 boot splash sits at 0x2E61CE, immediately after the 0x400-byte VGA palette.
- The sub-CPU boot ROM’s 96 KB of
0xFFis not erased flash. Apart from 2 KB at each end (0xFE0000–0xFE07FF and 0xFF7800–0xFF7FFF), which were read and came back blank, it was never dumped: 14,336 of the chip’s 131,072 bytes have ever been read, and only 4,352 are not0xFF. Any “the sub-CPU boot ROM is ~99% disassembled” figure computed over the whole file is meaningless.
Where the source still holds raw ROM slices
Measured at disassembly 3417969c0 (2026-10-06) — total bytes emitted by live .incbin
directives per ROM tree (python3 tools/incbin_bytes.py in this repository):
| ROM tree | .incbin bytes |
Character of what remains |
|---|---|---|
v10/maincpu |
870,502 | Overwhelmingly includes/generated/*.bin — C-compiled screen/widget data, an honest build product |
v9/maincpu |
851,032 | Same shape as v10 |
v7/maincpu |
851,232 | Same shape as v9, plus 10 live slices of committed includes/romslices/ (the ROM is no longer a build input — see the note below) |
v142/subcpu |
0 | No binary includes at all |
subcpu/boot |
0 | The 656-byte blob was carved into source; the ASL mirror still bincludes the file, so it stays on disk |
hdae5000 |
313,076 | Ten labelled slices, all pixel or palette data regenerated from committed PNGs and palette files: five 1,024-byte RGBX palettes, four 320×240 bitmaps and one 756-byte icon |
table_data |
1,303,899 | All labelled: BMPs, wallpapers, font glyph banks, bitmaps and icons regenerated from PNGs, and the source-built compressed payloads |
custom_data |
639,296 | Eleven slices of the factory-style-database sections; blob-level documentation judged adequate (this is one unit’s user-data area, not firmware) |
What that table does and does not say. These are bytes that the LLVM build pulls in as opaque binary. A slice that is labelled, sized and commented is not the same thing as disassembled code or a decoded structure — it is a boundary that someone has proved. The HD-AE5000 bitmaps, for instance, are fully identified and enter as 313,076
.incbinbytes regenerated from committed PNGs and palettes.
The v7 tree no longer reads its own ROM (since 1528605e8, 2026-08-21).
scripts/build/extract_v7_bins.py is retired and refuses to run without --force
(4b5e625f8). v7’s C data bins are compiled from the C it shares with v9/v10.
scripts/build/apply_v7_c_divergence.py then applies the differences recorded in
v7/maincpu/includes/v7_c_divergence.json, which are mostly pointer relocations by a
recorded per-range delta plus a small number of raw bytes. The last bytes with no source at all
were committed under v7/maincpu/includes/romslices/; since d89e64558 (2026-10-24) no .incbin
line of the tree reads that directory (only ; (was .incbin ...) comments name it), and
scripts/analysis/kn5000_source_coverage.py counts v7’s verbatim debt as 0 B (100.0 %
source) (re-measured at disassembly 130735749, 2026-10-31).
Additional known-unfinished items:
- Code hidden in maincpu
.byteis measured, per tree. At3417969c0the census rule still fires on 8v7regions (1,236 B). That is a ranking for hand audit, not a verdict: four of the eight are the same text strings it flags in v10 (the Italian, French and German wallpaper messages and a widget-name string). A further 275 CODE-flanked.byteruns of 63 B or less (2,043 B) remain in v7, 203 of them (1,338 B) in genuine-code context. On 2026-09-02 the same census gave 275,822 B for v7.v9andv10’s high-confidence confirmed-region backlog — the shapev9_v10_undisassembled_census.py --judgecan find and hand-audit — is at 0 B on both images, re-confirmed independently for each; the remaining debt in this shape is shorter misframed islands (real instructions run past a flanking.byterun, so fixing one means re-framing an instruction already present rather than filling a gap), which stood at about 14,727 B per image before this push and has since been partly converted on both: at3417969c0it is 139 runs (1,426 B) in v10 and 145 runs (1,495 B) in v9, of which 99 (809 B) and 105 (878 B) sit in genuine-code context. Converting a region creates new islands at its boundary, so an island count is only valid against the exact commit it was measured at — quote a fresh run, not this page. This is a different, larger category than the.incbinverbatim debt measured below: a long.byterun is exactly as undecoded as an.incbin, but it passes every “no.incbin” check, so no tool that only scans for.incbincan see it.scripts/analysis/v9_v10_undisassembled_census.py(v9/v10, and the same rule applied to v7) is the census. - The sub-CPU boot ROM source now spells the 0xFE0000–0xFF7FFF run as one
.fill 98304, 1, 0xff(cccbe2978, 2026-09-02). The bytes are unchanged, but the directive’s comment calls the run “erased flash”, which the dump does not support: apart from 2 KB read at each end (0xFE0000–0xFE07FF and 0xFF7800–0xFF7FFF), the range was never read, and its0xFFis assumed (see Dump Provenance). The comment, not the bytes, needs correcting in the disassembly. - The v1.41 and v1.40 sub-CPU payloads have had source trees since 2026-10-24
(
v141/subcpu/,v140/subcpu/, generated from v1.42 and v1.41 by recorded edits) and rebuild byte-identical inmake gate; see Sub-CPU Firmware Images.
Three items on this list were closed by the August waves, and a fourth, the HD-AE5000 UI
descriptor pool at 0x29DC12–0x2A5D2B, on 2026-09-25: it is now 769 typed HdaeUiObj_NNN
records generated by scripts/generators/gen_hdae5000_ui_pool.py. The HD-AE5000 string
table around 0x2A5D2C–0x2A8499 is no longer mis-decoded as instructions; the orphaned
table_data/includes/bootcode_*.bin slices are gone, along with 25 other unreferenced
artifacts, each recorded in analysis/orphans-2026-08-08/README.md with the dd that
regenerates it byte-for-byte (six bootcode_*.bin files remain because the ASL mirror still
bincludes them); and icons_to_strings.bin is now fully accounted for by
make audit-icons-blob, which reports no LLVM slices at all, 742,024 bytes unreferenced by
the LLVM build, and a 221,104-byte dead tail beyond file offset 0x7F2D8 that duplicates the
source-built demo-preset region and is read by nothing.
Three kinds of debt, not one
Disassembly debt in this tree comes in three distinct shapes, counted by three different instruments, and quoting any one of them as “the” debt figure is the mistake to avoid:
| kind | what it is | counted by |
|---|---|---|
| verbatim | bytes handed back through .incbin of a blob with no generating source |
scripts/analysis/kn5000_source_coverage.py |
code-as-.byte |
real instructions spelled as data directives | per-image census tools, e.g. scripts/analysis/v9_v10_undisassembled_census.py |
| data-as-code | data disassembled into plausible instruction mnemonics that re-assemble byte-exact | scripts/analysis/v10_data_as_code_census.py, wsa1/notes/data_as_code_audit.py, scripts/analysis/kn5000_rest_data_as_code_audit.py |
A .byte run is exactly as undecoded as an .incbin, but passes every “no .incbin” check
— and the third kind is invisible by construction: a re-assembly of a wrong interpretation
still reproduces the original bytes, so the byte gate cannot object to it either. Two
confirmed instances exist in HD-AE5000 — a 309-byte version
string disassembled as garbage instructions, and a 6,356-byte record table with zero call or
jump sites anywhere in the tree, loaded only as an address.
All thirteen TLCS-900 images of the time (before Main CPU v8 and sub-CPU v1.41, which are built from the v9 and v1.42 sources) have been censused for data-as-code, and a “clean” verdict has
not held everywhere. Sub-CPU boot, table data, custom data, prom_c and prom_d came
back clean and nothing since has contradicted it; for those the “every debt figure is a
lower bound” caveat below is lifted. (prom_c’s 84 remaining data-as-code markers are all
five-nop device-settle delays in real code, per its Wave 2 lane.) prom_a and prom_b
were reported clean as well, but the Wave 2 lanes then found and retyped data framed as code
in both — 1,958 B, eleven panel lookup tables and the panel LED wire maps in prom_a, nine
tables in prom_b — and the lanes’ marker counts there still stand at 855 and 112, so the
caveat applies to them again. It survives for v9, v7 and v142, whose seed-coverage
gaps run 51–74% — that much of their proven code is reached only through indirect or
computed dispatch that static analysis cannot follow, so a census there cannot rule out
further misdecoded spans.
A fourth, smaller kind: numeric cross-references
A branch whose operand is a number (jr z, 17, calr 2716, call 16569399) assembles
byte-exact but names nothing, which breaks the symbolic-cross-reference rule. Numeric
jr/jrl/calr operands are raw PC-relative displacements, so each target can be computed
from the address map, and scripts/converters/symbolize_numeric_branches.py does that,
inserting a structurally named label (_Return, _Loop, _Join, _Skip, _Helper, …) at
the target. Because the new label is used as an operand, a label placed even one byte wrong
changes the assembled displacement, so the byte gate does check this edit.
It deliberately leaves a residue numeric. A “branch” made of data decoded as code, or of
the operand bytes of a mis-framed instruction, would plant a meaningless label that the
gate cannot see. So every site must also be decoded identically by a second decoder (MAME’s
unidasm), and sites in text, pointer tables or absurd instruction neighbourhoods are refused.
An eight-judge review of 360 accepted sites found two phantom branches, both of which that
second-decoder rule now refuses. The review evidence is in notes/branch-symbolization-2026-09-25/.
| tree | numeric branch operands | of all branches | before the pass |
|---|---|---|---|
| maincpu v10 | 0 | 74,354 | 13,344 / 74,282 |
| maincpu v9 | 0 | 74,344 | 14,217 / 75,164 |
| maincpu v7 | 0 | 74,341 | 19,408 / 57,528 |
| subcpu v142 | 0 | 7,078 | 726 / 6,997 |
| HD-AE5000 | 0 | 7,195 | 877 / 7,146 |
| table data | 0 | 1,333 | 83 / 1,280 |
SX-WSA1R prom_a |
12 | 25,216 | 7,605 / 25,208 |
SX-WSA1R prom_b |
77 | 18,544 | 18,241 / 18,411 |
SX-WSA1R prom_c |
0 | 10,241 | 2,479 / 10,241 |
Counted with the one-liner in scripts/converters/README-symbolize-branches.md (the
“all branches” column drops the operand pattern), over the committed sources at 3417969c0
for the current columns and at the commit before the symboliser landed (b0bfd371^) for the
last; tools/branch_operand_counts.py <rev> in this repository runs exactly that over the
committed blobs. Those “before” figures reproduce the ones in the tool’s own docstring
exactly. v7’s
denominator grew by 16,320 branches during Wave 2 (3958235e → 5fc8d5bd), as v7 regions
were converted to instructions.
What remains is the refused residue in the SX-WSA1R: 12 sites in prom_a and 77 in
prom_b, which double as a list of places where a branch or its target is framed wrongly.
At be376096 the residue still included 585/611/2,102 in the main-CPU trees and six in
prom_c’s dead UNREFERENCED_TRAMPOLINES block; see
SX-WSA1R older-build remnants.
Verbatim debt across the seventeen measured TLCS-900 images
scripts/analysis/kn5000_source_coverage.py measures verbatim debt: bytes that enter
the build through an .incbin of a committed blob with no generating source. It measures
thirteen KN5000 images (main CPU v10, v9, v7, v6 and v5; sub-CPU payload v1.42; sub-CPU boot;
table data; custom data; HD-AE5000 v2.06i, v2.01i, v1.15i and v1.10i) and the four SX-WSA1R
images together, 18,153,472 B. It leaves out the gated KN5000 images that would count bytes
twice: v8 (v9’s source with one byte changed), the v1.41 and v1.40 payloads (generated from
v1.42’s) and the three compressed update images (re-encodings of the payloads). This is a
narrower question than “is this region understood”: a .byte run that spells real code
(tracked separately per image; see the maincpu figures above), or a wrong disassembly that
happens to re-assemble to the right bytes (see the data-as-code note above), is invisible to
it. Outside the five data-as-code-clean images above, every debt figure on this page is
therefore a lower bound.
Sixteen of the seventeen measured images are at zero verbatim debt: 100% source. Nothing in
maincpu v10, v9, v7, v6 or v5, the sub-CPU payload v142, the sub-CPU boot ROM, custom data, the four
HD-AE5000 versions, or any of the four SX-WSA1R images enters the build as an opaque blob. Even the eight flash-update boot banners round-trip from committed PNGs
(python3 scripts/build/mono_images.py verify reports ROUND TRIP EXACT: all 8 banners x
2 revisions (9,856 B), the same 616-byte-each files shared byte-for-byte between the two
firmware revisions). v9’s confirmed-region backlog (the high-confidence code-as-.byte
shape v9_v10_undisassembled_census.py --judge can find) is closed on both images:
re-running it directly against v9 (not mirrored from v10, whose source has since drifted
out of lockstep) finds zero confirmed hits beyond the same hand-audited DATA regions
already on record.
The one that is not is table data (below). Until 2026-11-06 the ported trees carried debt too. v6 was generated from v7 and v5 from v6 by
scripts/converters/port_maincpu_version.py; where no line of the older tree maps onto the
bytes, the port writes .byte rows under ; TODO(port): ..., and the raw bytes of each
tree’s C divergence file (v6/maincpu/includes/v6_c_divergence.json, likewise v5) are counted
with them. That was their debt; today it is none:
| Image | Verbatim debt | % source |
|---|---|---|
v6/maincpu |
0 B | 100.0% |
v5/maincpu |
0 B | 100.0% |
| table data | 15,634 B | 99.3% |
| all seventeen | 15,634 B | 99.9% |
(2026-11-06, disassembly 8d0865c27, from the command above; v7 fell to 0 B at d89e64558
on 2026-10-24; v6 and v5 were 3,615 B and 4,504 B on 2026-11-02, at fb8aaf94c, 150 B and
163 B earlier on 2026-11-06, at 0bb738536, and 5 B and 5 B later that day, at 3834c8773. Re-run rather than quoting this table.)
Since 2026-11-02 the v6 and v5 trees compile their own C: each NAKA blob takes its own address
(#define BASE, or a PORT_BASE(off) chain where the port moved parts of it), the work-RAM cell
header carries their own addresses, and the re-ordered name tables name their strings. The C-divergence
patch shrank from 10,353 to 212 raw bytes (v6) and from 11,626 to 220 (v5), so of that day’s 3,615 B
and 4,504 B, 3,403 B (v6) and 4,284 B (v5) were TODO(port) rows (lane kn5000-c, disassembly
notes/kn5000-c-2026-11-02/README.md).
Since 2026-11-06 the v6 and v5 trees have almost no port debt left: the bytes no v7 / v6 line mapped to
are written as the NAKA objects the firmware registers (tables, widget records, class definitions,
strings, work-RAM cells), as decoded code, or as case-offset tables, and the C spells its work-RAM
self-pointers. Verbatim debt was then 150 B (v6) and 163 B (v5), 100.0% source: 2 B / 7 B of TODO(port) rows,
halves of pointers cut by a C slice boundary, and 148 / 156 raw bytes of the C-divergence patch (lane
v6v5-port, disassembly notes/v6v5-port-2026-11-06/README.md, which lists the tool step behind each
change and the next step for what is left).
Later the same day the v6 and v5 trees lost their last port rows (lane v6v5-port2, disassembly
notes/v6v5-port2-2026-11-06/README.md, merged in 98ff6ff7c): the last ones, halves of pointers
cut by a C slice boundary, are whole pointers since the slices were re-cut, and the trees carry v7’s
RAM variable names with their own values. Their C compiles to their own bytes but for 5 (v6) and 5
(v5) bytes of work-RAM cell addresses: v6 / v5 have no MPVersion view, so the cells after
RAM_MPVersion_Window sit 4 bytes lower than the shared naka_ram_cells.h says. Verbatim debt was then
5 B and 5 B, 100.0% source.
Since lane v6v5-port3 (disassembly notes/v6v5-port3-2026-11-06/README.md, merged in 169e58ff0) the v6
and v5 trees have no port row left and their C compiles to their own bytes everywhere: the last five bytes,
work-RAM cell addresses after the MPVersion window cell that v6 and v5 do not have, are placed by the trees’ own
work-cell lines. Verbatim debt is 0 B in both (100.0% source), and their NAKA GUI C reads like v7’s (no numeric ROM
address or RAM cell left).
Until then 3,403 B (v6) and 4,284 B (v5) were TODO(port) rows and 10,353 B / 11,626 B
were raw bytes of the C-divergence files (lane kn5000-ports, disassembly
notes/kn5000-ports-2026-10-31/README.md section 5, measured with the same script; that lane
lowered them from 16,502 B / 19,310 B by writing rows as .long Label, .asciz and
aligned_string with scripts/converters/port_todo_typed.py). What is left needs the NAKA record
macros taught the v6 / v5 widget layouts, and per-version C (or typed slices) where v6 / v5 data
differ from v7’s C. The same lane moved the names the port had carried onto the wrong
procedure back where the firmware’s own name and pointer tables put them
(scripts/tools/port_fix_label_shifts.py); the name changed at 595 addresses in v6 and 633 in v5.
Table data: 15,634 B, which no source can rebuild. They are the stale ends of an older SLIDE4K
stream after demo songs 17 and 18 (the slices’ bytes past the stream the header’s size makes the decoder
read): demo song 17’s 15,559 B after a 398-byte repeat of its own stream end
(DemoSongPreset17_StaleStreamTail), and demo song 18’s 75 B, which are the same stream’s last bytes
(DemoSongPreset18_StaleStreamTail). [INFERENCE] An earlier Feature Demo. A stream’s window is everything
decoded before, and that stream’s start is overwritten, so no source can rebuild it. Until 2026-11-02 the
build copied them from the factory slices inside the two demo payloads, and the table counted 0 B. The demo
songs themselves are now encoded by the factory encoder (Okumura’s LZSS.C, N = 4096, F = 18) with no reference
stream; all 22 factory SLIDE4K streams are checked against it (disassembly
notes/misc2-2026-11-02/README.md, probes slide4k_encode_exact.py and slide4k_stale_tails.py; tracker
kn5000-3ei).
Before that, table data had reached zero on 2026-10-24. Until then the tool counted 318,468 B against it:
the six FTBMP01-06.BMP feature-demo slide images, genuine uncompressed 8bpp Windows BMPs
that were stored verbatim. They are now generated by scripts/build/ftbmp_images.py from a
committed PNG plus a JSON file holding each BMP header, and the build checks that the
round trip is exact (disassembly 4eb218937, merged as 1cdebf1f5); since 2026-10-31 the .BMP
files are git-ignored outputs of ftbmp_images.py build. The six images are in
the Image Gallery. The
only other slice ever counted against table data, a 17,570 B stale remnant duplicating the
live English/German help-database streams 0x8000 lower in the ROM, is derived from those
streams by a committed generator (gen_stale_help_duplicate.py).
How much of the data is actually explained
Byte identity says the source reproduces the ROM. It says nothing about whether anybody can state what a given range of bytes represents. That is a separate measurement, and it is the one that decides whether “the ROMs are done” is true.
Of the 12,386,304 bytes across the twelve distinct images, 96.80 % (11,989,987 B) are
CODE, evidenced data or verified filler – the census’s strict figure at 2319e9b94
(2026-10-24; it was 96.34 % at 7936b0a2 on 2026-10-06), which the disassembly README
publishes as the bytes understood component of its semantic score. After the September 25 semantic push (Wave 2),
whose twenty lanes turned named-but-unevidenced data into data whose header cites its
reader, it was 95.04 % (11,771,934 B); before that push it was 64.15 % (details
below). Part of the last rise is the instrument rather than the
tree: d6c4e0ead (2026-10-06) lets a compact block of one-line .incbin entries inherit
the header directly above it (v10 alone went from 90.03 % to 93.35 %), so 96.34 % and
95.04 % are not strictly comparable. Counting data that rests on a descriptive name alone as
well, the census reported 99.54 % after Wave 2. ⚠ That is the instrument’s grade, not an
audited figure: the hand-audited false-positive sample was last drawn for the September 2
run, when about 93.8 % (≈11.61 MB) could be explained, with a 95 % confidence interval of
86.7 % – 96.6 % (about 82 % under the strictest reading – that a section header does not
explain a 30 KB blob it happens to sit above). That day’s raw census reported 99.78 %, a
figure wrong by construction for the reasons itemised below.
python3 scripts/analysis/data_range_census.py # the census, all 12 images
python3 scripts/analysis/data_range_census.py --json out.json --targets 60
python3 scripts/analysis/data_range_census.py --selftest
The run after Wave 2 is committed as
notes/lanes/wave2-2026-09-25/census-after-wave2.txt in the disassembly repository (at
5fc8d5bd, toolchain tlcs900_backend@4d7fa4f6b37c, llvm-mc sha256 a7ee33d5…). That
file is only the first part of the output: it carries the reconciliation, the per-image
table and the strict / explained lines, and stops at the heading of the purpose-unknown
list. The research-target figures and the flag table further down this page are not in it.
All of them come from the second command above, re-run at be376096: its report (less the per-image progress
lines) matches the committed file line for line as far as the file goes, and the rest printed the research-target
totals, their split by reason and the three flags exactly as quoted here. be376096’s
sources no longer assemble with the current shared llvm-mc (they still use spellings such
as mul8rr that the later toolchain retired), so that re-run was made in a git archive
export of the commit, after make all, with PROJECTS_ROOT pointing at a directory whose
llvm-project/build/bin/llvm-mc is the a7ee33d5… binary. The lanes’ own before/after
figures, and what each could not do, are in lane-reports/*.json beside the committed
file.
The semantic score
Since 2026-10-06 (c2bf2d04a) the disassembly README has carried badges for a measured
semantic score, produced by make semantic-score (scripts/analysis/semantic_score.py).
It is the mean of the components a model has: four for the KN5000, three for the SX-WSA1R
(no C), two for the SX-KN7000 and two for the MN10300 siblings. Every number behind it, with its
commit, is in docs/badges/semantic-score.json, and the trend is in
docs/badges/semantic-score-history.csv. Byte identity is not a component, because every
image already passes the gate.
The script’s rules have changed twice. Rules 3 (2026-10-24) added the KN7000: program 941,
table 84 and the seven Style Convert converters, rated from the sources because the MN10300 trees
have no ELF, no dispatch census and no C. Its bytes component is the share emitted as source rather
than .incbin_range passthrough, an upper bound on the TLCS-900 definition (a byte spelled as
.byte or as an instruction counts whether or not its purpose is stated). Rules 4 (2026-10-24)
added program 942 (the SP7001 flash) to the KN7000, rated the KN2400, KN6000, KN6500 and HD-SX
plug-in as a model of their own, MN10300 siblings, and rated every routine label of the converted
code (func_<hex> counting as positional) rather than only the banner names, which is why the
KN7000’s names component reads 62.27 % below against 84.83 % under rules 3 (cdc6226f). The SP7001 table, BASEEXT.XAP, the IC18 boot ROM, table 80
and the IC19 picture image are not rated yet. Rules 5 (2026-10-31, lane hdae-ledgers,
disassembly cf8b62847) added KN5000 maincpu v8, v6 and v5, sub-CPU v1.40 and the HD-AE5000 v2.01i,
v1.15i and v1.10i to the KN5000 model, so its denominators grew (bytes 10,485,760 -> 18,546,688). At
6ca33e65 (2026-10-31, after lanes media-build, ic21-own, hdae-ledgers, mn10300-formats and
mn10300-typer; jump tables from dispatch-census-2026-10-31-01, whose rows -02 repeats; committed in
c58fe3de7):
| component | what it counts | KN5000 | SX-WSA1R | KN7000 | MN10300 siblings | all models pooled |
|---|---|---|---|---|---|---|
| bytes understood | KN5000, SX-WSA1R: the census’s strict figure (below); KN7000, siblings: the source share (above) | 96.07 % (17,817,177 / 18,546,688) | 94.80 % (1,988,071 / 2,097,152) | 99.32 % (13,073,153 / 13,162,201) | 97.80 % (12,111,806 / 12,383,893) | 97.40 % (44,990,207 / 46,189,934) |
| semantic names | linked symbols whose name says what the thing is, not an address or a position (MN10300 models: routine labels of the converted code) | 96.37 % (298,778 / 310,032) | 83.14 % (15,815 / 19,022) | 64.64 % (25,652 / 39,687) | 61.81 % (32,904 / 53,237) | 88.43 % (373,149 / 421,978) |
| jump tables resolved | jump/call tables whose every entry lands on a labelled instruction, spelled symbolically (the dispatch census in docs/coverage/) |
100 % (4,664 / 4,664) | 100 % (772 / 772) | — | — | 100 % (5,436 / 5,436) |
| C fields named | C struct members with a meaningful name rather than an index | 94.85 % (109,115 / 115,041) | — | — | — | 94.85 % (109,115 / 115,041) |
| score | the mean of the components | 96.82 % | 92.65 % | 81.98 % | 79.80 % | 95.17 % |
The pooled bytes figure mixes the two definitions (the MN10300 models are most of its
denominator), so compare the per-model columns, not the pooled one. The trend, from
semantic-score-history.csv: 75.75 % at the first measurement (f6458f02, 2026-10-06); 87.26 % when
the KN7000 was added (rules 3, 6b7dbde0) and 91.10 % once that day’s first wave was merged
(cdc6226f); 84.10 % under rules 4 (5615225f, KN7000 41.07 %, siblings 33.93 %); then, after the
data-semantics lanes typed the MN10300 data regions, 93.97 % (a84ab21d), 94.00 % after lane
generic-zero (347fd0cf) and 94.07 % at d91a7e40. Rules 5 read 95.12 % at d9d06262 (KN5000
97.09 % -> 96.82 %, from the added images: bytes 96.94 % at d91a7e40 against 96.07 % now, names 96.56 % against 96.37 %), and 95.17 % now: the
mn10300-formats and mn10300-typer lanes moved the KN7000 80.66 % -> 81.98 % and the siblings 78.98 % ->
79.80 %, the KN5000 and SX-WSA1R unchanged.
The grades
Every byte of every image lands in exactly one bucket:
- CODE — instruction statements.
- KNOWN-A — data whose header says what it represents and cites evidence: a reader, a call site, a record layout, a field, a findings file or script.
- KNOWN-B — data under a descriptive, non-address-derived name (
Font_Svc07_8x16,DrumKitNames), with or without a header, but with no evidence cited. Real understanding, resting on somebody’s naming judgement and nothing else. - UNKNOWN — an address-derived or absent label with no explanatory header, or a header of fewer than 40 words that admits the purpose is not established. (A longer admitting header can still grade KNOWN-B; either way the admission puts the region on the research-target list.)
- FILLER — a fill directive whose ROM bytes are verified uniform, run ≥ 16 bytes.
Strict is CODE + KNOWN-A + FILLER; explained adds KNOWN-B.
Separately, the census lists research targets: ranges whose purpose is not established — UNKNOWN bytes, any region whose header self-admits a gap whatever its grade, and undocumented data sandwiched between two instruction regions (“embedded-in-code”).
After Wave 2 (2026-09-25)
| image | CODE | KNOWN-A | KNOWN-B | UNKNOWN | FILLER | strict |
|---|---|---|---|---|---|---|
| v10 | 995,508 | 917,658 | 108,608 | 16,943 | 58,435 | 94.01 % |
| v9 | 995,358 | 917,199 | 109,203 | 16,943 | 58,449 | 93.98 % |
| v7 | 985,895 | 915,445 | 114,755 | 20,662 | 60,395 | 93.54 % |
| v142 sub-CPU | 128,860 | 65,969 | 1,687 | 44 | 48 | 99.12 % |
| sub-CPU boot | 3,604 | 870 | 35 | 0 | 126,563 | 99.97 % |
| table data | 19,426 | 1,800,585 | 95,143 | 0 | 181,998 | 95.46 % |
| custom data | 0 | 660,657 | 0 | 0 | 387,919 | 100.00 % |
| HD-AE5000 | 112,324 | 373,890 | 7,736 | 0 | 30,338 | 98.52 % |
prom_a |
324,950 | 107,566 | 24,023 | 1,355 | 66,394 | 95.16 % |
prom_b |
204,396 | 163,160 | 85,108 | 620 | 71,004 | 83.65 % |
prom_c |
207,511 | 177,152 | 10,409 | 0 | 129,216 | 98.01 % |
prom_d |
0 | 329,425 | 1,096 | 0 | 193,767 | 99.79 % |
| total | 3,977,832 | 6,429,576 | 557,803 | 56,567 | 1,364,526 | 95.04 % |
At 7936b0a2 (2026-10-06), after the census fix d6c4e0ead, the strict share per image was
v10 95.48 %, v9 95.02 %, v7 94.71 %, v142 99.41 %, sub-CPU boot 99.97 %, table data 98.93 %,
custom data 100 %, HD-AE5000 98.15 %, prom_a 95.33 %, prom_b 85.86 %, prom_c 98.01 %
and prom_d 99.79 %, or 96.34 % overall (docs/badges/semantic-score.json). At 2319e9b94
(2026-10-24, the first command above) it is v10 96.27 %, v9 96.24 %, v7 95.36 %, v142
99.41 %, sub-CPU boot 99.97 %, table data 98.93 %, custom data 100 %, HD-AE5000 98.15 %,
prom_a 95.34 %, prom_b 86.16 %, prom_c 98.02 % and prom_d 99.79 %, or 96.80 %
overall; the buckets total CODE 3,988,810 B, KNOWN-A 6,636,538 B, KNOWN-B 384,808 B,
UNKNOWN 11,509 B and FILLER 1,364,639 B. The
five-bucket split above has not been republished here since Wave 2; the HD-AE5000’s at
3417969c0 is on HD-AE5000, and the
SX-WSA1R images’ UNKNOWN, KNOWN-B and research-target figures at 3417969c0 are on
SX-WSA1R Disassembly.
before Wave 2 (3958235e) |
after (5fc8d5bd) |
|
|---|---|---|
| strict (CODE + KNOWN-A + FILLER) | 64.15 % | 95.04 % |
| KNOWN-A (evidence header) | 2,778,685 B | 6,429,576 B |
| KNOWN-B (name only) | 4,428,721 B | 557,803 B |
| UNKNOWN | 12,357 B | 56,567 B |
| research targets | 395,986 B in 26,553 ranges | 328,853 B in 5,077 ranges |
The research targets split by reason as 248,744 B self-admitted, 59,562 B with no
explanation and 20,547 B embedded-in-code (apportioned where a range has more than one).
By image: v10 70,509 B, v9 70,816, v7 77,018, v142 105, table data 7,999, HD-AE5000 1,280,
prom_a 21,094, prom_b 69,348, prom_c 9,588, prom_d 1,096; sub-CPU boot and custom data
none (tools/census_research_by_image.py out.json in this repository splits the census’s
JSON this way, with the census’s own target rule).
The thirteenth TLCS-900 image,
kn5000_subprogram_v142_compressed.rom, is deliberately outside the denominator: it is the v1.42 payload re-compressed, so its bytes are already counted underv142. Counting it would inflate the total with a duplicate.
Reading those numbers honestly
UNKNOWN went up, and that is the push working. A header that says “purpose not
established — searched X and Y” grades UNKNOWN (when it is under 40 words; a longer one is
still listed as a research target), while a plausible name with no header
grades KNOWN-B. The lanes’ rule was to replace names that hid a gap with admissions that
state it, so UNKNOWN rose from 12,357 B to 56,567 B while KNOWN-B fell by 3.87 MB — most
of that into KNOWN-A, some of it, correctly, into UNKNOWN. Two examples from the lane
reports: prom_a’s MIDI-in tables for two unidentified controllers now say so (192 B added
to research on purpose), and 24 streams in prom_c’s P7 pool are stated as unreferenced
(5,897 B). The admission is the true statement; the name it replaced was not.
96.80 % is the instrument’s grade, not an audited figure. KNOWN-A is keyword-graded
(grade_purpose() in scripts/analysis/data_range_census.py), by either of two routes: a
header of eight or more words carrying two evidence tokens, or a descriptive
(non-address-derived) name with a header of six or more words carrying one — and in both
cases no admission phrase. The evidence list holds specific tokens (read by, call site,
+0x, .py, …) but also any 0x and generic words such as entry, header, format and
see , so a header can earn an evidence token without citing any evidence. The only check of whether a grade means a reader
can say what the bytes are is a hand audit: 40 regions drawn from KNOWN-A ∪ KNOWN-B,
size-weighted, seed 90902 (--load … --sample 40 --seed 90902). That audit was run on the
2026-09-02 tree and has not been repeated since Wave 2. It found 3 of 40 failing outright —
7.5 %, Wilson 95 % interval 2.6 %–19.9 % — and a further 8 of 40 passing only at the
granularity of a whole blob. Its run is in notes/data-census-2026-09-02/ and
notes/DATA-CENSUS-2026-09-02.md. Until the sample is redrawn from the current tree, quote
96.80 % together with that sentence.
Some of the grading is known to be wrong in both directions (listed for Wave 3 in
notes/lanes/wave2-2026-09-25/WAVE3-LEADS.md — the first two below under “Instruments”, the
rest under “Open research”): a NAME = expr line is taken for an instruction owning the
next line’s bytes; a comment run is kept open across blank lines, so a file header can leak
into the first object and flip it to “admits” (98 B of false research target at 0xED0008
in v10, v9 and v7); a banner used to be credited only to objects within six lines, so
one-line .incbin entries further down a block stayed KNOWN-B (fixed by d6c4e0ead,
2026-10-06: a compact block now inherits the header above its first entry); single-line
headers are not credited; labels such as F64_2376 are read as address-derived; and
m_ldc_* macro lines are graded as data.
The instrument
Each image’s source tree is mirrored with a synthetic label inserted in front of every
byte-emitting line, the mirror is assembled and linked with the real linker script, and
the marker addresses come out of the ELF symbol table — so byte [addr(n), addr(n+1)) is
attributed to the source line marker n was written in front of. Two properties make it a
measurement rather than a tally:
- Inertness. A label emits no bytes, so the marked mirror must still be the dump.
Every image is objcopy’d to a raw binary and compared against
original_ROMs/: 12 of 12 byte-identical. A mirror that is not inert is refused rather than reported. - Reconciliation. Every byte lands in exactly one bucket and the per-image total must equal the dump size; the run aborts on a non-zero delta.
The CODE/DATA split is corroborated by a completely separate instrument,
scripts/analysis/l1_territory_map.py, which flattens the maincpu images through
llvm-mc -show-encoding and never sees a marker or a symbol table.
What the census structurally cannot see
- It classifies by the source’s own framing. A byte inside a
.bytedirective is DATA here even when it is a TLCS-900 instruction, and a byte inside an instruction is CODE here even when it is a string. Both errors exist in this tree — see the three kinds of debt above. - A region is only as explained as the one label and header attached to it. A
C-compiled struct can enter the ROM as a single large
.incbinwhose labels are offsets into it, so a region can be much larger than the object its label names. At2319e9b94, 100 regions of ≥ 8 KiB carry 2,948,497 B — 42.0 % of the explained figure — and 26 regions of ≥ 32 KiB carry 1,703,154 B. - A self-admitted open question is not the same as an unexplained region. A header
asking one question about an otherwise understood object — a font whose role, metrics
and loader are all established but whose encoding is not — trips the flag anyway. The
largest single research target, 15,120 B of
prom_bfonts, is of that kind. - The FILLER rule is byte-verified but arbitrary at the edge: uniform and ≥ 16 B. Shorter uniform runs are graded as data.
Code that may be misclassified as data
Three independent flags, reported as leads and not verdicts. Nothing is converted on the strength of them.
| flag | regions | bytes | what it means |
|---|---|---|---|
| embedded-in-code | 3,687 | 20,547 | an undocumented data region with an instruction region on both sides in the same file |
| code-shaped label | 8,812 | 360,387 | the label carries a routine token (_Loop, _Prologue, _Dispatch, Initialize*, …) |
| code-suspect | 1,100 | 25,424 | a label at or inside the region is the target of a call/jp/jr/jrl somewhere in the tree |
The name-based flag comes with its null, because without one it would be worthless: 55.1 %
of regions the source itself frames as CODE carry such a name, against 4.1 % of the data
regions of the three pure-data images (table_data, custom_data, prom_d), where a hit
can only be a false positive.
Disassembly status diagram

What kind of source emits each byte of the six KN5000 images that are not other builds’ copies (main CPU v10, table data, sub-CPU boot IC30, sub-CPU payload v1.42, custom data IC19, HD-AE5000). One pixel is 8 bytes, so each block’s area is proportional to its ROM size. The classes are the data census’s buckets above, with compiled C split out of the data:
Legend: green = assembly code · light green = compiled C (clang .incbin) ·
blue = data, purpose explained (census A) · cyan = data, named (census B) ·
red = data, purpose unexplained · gray = verified filler.
Generated by make rom-status DOCS_DIR=<this site> in the disassembly repository
(scripts/build/generate_rom_status_diagram.py, about a minute), at 2319e9b94
(2026-10-24). The same run printed:
| image | bytes | asm | C | data A | data B | data ? | filler |
|---|---|---|---|---|---|---|---|
| Main CPU v10 | 2,097,152 | 47.5% | 0.4% | 45.6% | 3.5% | 0.1% | 2.8% |
| Table Data | 2,097,152 | 0.9% | 0.0% | 89.3% | 1.1% | 0.0% | 8.7% |
| Sub CPU Boot IC30 | 131,072 | 2.7% | 0.0% | 0.7% | 0.0% | 0.0% | 96.6% |
| Sub CPU Payload v1.42 | 196,608 | 65.6% | 0.0% | 33.7% | 0.6% | 0.0% | 0.1% |
| HD-AE5000 v2.06i | 524,288 | 21.4% | 0.0% | 70.9% | 1.8% | 0.0% | 5.8% |
| Custom Data IC19 | 1,048,576 | 0.0% | 0.0% | 63.0% | 0.0% | 0.0% | 37.0% |
Read it with the census’s limits in mind: it describes what the source claims, so code
spelled as .byte is counted as data and data spelled as instructions as code. Compiled C
here is only the clang .incbin output under <tree>/includes/generated/ that
kn5000_source_coverage.py classifies as C. The sub-CPU boot ROM’s gray is mostly bytes
that were never read (see Dump Provenance). The picture that stood here
until 2026-10-24 dated from 2026-02-07; its generator then read the archived ASL paths, found
none of them and painted every image “undetermined”.
Original ROM Files
The original firmware dumps are stored in original_ROMs/:
| File | Size | Description |
|---|---|---|
kn5000_v10_program.rom |
2MB | Main CPU program ROM (also kn5000_v9_program.rom, kn5000_v7_program.rom) |
kn5000_v8_program.rom |
2MB | Main CPU v8: git-ignored, copied from the private romset and SHA-1-checked |
kn5000_subprogram_v142.rom |
192KB | Sub CPU payload (sent by main CPU at boot) |
kn5000_subprogram_v142_compressed.rom |
93,203B | Same payload as shipped on update disks |
kn5000_subprogram_v141.rom, kn5000_subprogram_v141_compressed.rom |
192KB, 93,181B | Sub CPU payload v1.41, both shapes — built by v141/subcpu/ |
kn5000_subprogram_v140.rom, kn5000_subprogram_v140_compressed.rom |
192KB, 93,124B | Sub CPU payload v1.40, both shapes — tracked, checked against each other |
kn5000_subcpu_boot.ic30 |
128KB | Sub CPU boot ROM |
kn5000_table_data_rom_odd.ic1 |
1MB | Table data ROM (odd words) |
kn5000_table_data_rom_even.ic3 |
1MB | Table data ROM (even words) |
kn5000_table_data.rom |
2MB | The two halves interleaved; the image the build compares against |
kn5000_custom_data.ic19 |
1MB | Custom data flash (user storage) |
hd-ae5000_v2_06i.ic4 |
512KB | HDAE5000 hard disk expansion ROM |
ROM interleaving: the table-data ROM uses 16-bit word-level interleaving across two
physical chips. kn5000_table_data.rom is built by alternating 16-bit words from
odd.ic1 and even.ic3, not individual bytes.
Dump Provenance
Byte-identity of a rebuild says nothing about whether the original file is a complete, faithful image of the physical part. Two of the files above are known not to be, and this section records what is measured versus what is assumed. It matters because everything downstream inherits the assumption.
kn5000_subcpu_boot.ic30 — partially dumped, deliberately
Owner testimony (Felipe, 2026-08-08), which is ground truth about what was physically
done. IC30 was dumped in small chunks, because the tooling could only copy a limited
amount at a time. He read the regions that appeared to hold the boot code needed to make
the emulator work, analysed that code, and — as far as he could assess at the time — found
no references to addresses in the regions he had not read. He concluded the remainder was
very likely 0xFF. He calls this an educated guess, not a fact, and intends a full
dump when he regains physical access to the instrument (it is currently in storage in
another country).
What is measured in the file today:
| Quantity | Value |
|---|---|
| File size | 131,072 bytes (sha1 d29429a9…) |
Bytes that are not 0xFF |
4,352 — 3.3% of the chip |
Non-0xFF content, block 1 |
file 0x18000-0x1904C = CPU 0xFF8000-0xFF904C, 4,173 B |
Non-0xFF content, block 2 |
file 0x1FE80-0x1FFB3 = CPU 0xFFFE80-0xFFFFB3, 308 B |
Non-0xFF content, block 3 |
file 0x1FFF0-0x1FFFF = CPU 0xFFFFF0-0xFFFFFF, 16 B |
| Windows actually read | 0xFE0000-0xFE07FF, 0xFF7800-0xFF97FF, 0xFFF000-0xFFFFFF — 14,336 B, 10.9% of the chip |
| Bytes never read | 116,736 — 89.1%, present in the file as assumed 0xFF |
The three window sizes are corroborated by the driver’s own comment and by the owner’s
dump script, whose chunking constant is 0x800. But note that the window boundaries are
documentary, not measurable: a byte that was read and came back blank is
byte-indistinguishable from a byte that was never read. Roughly 10 KB of the ranges the
driver comment says were dumped are also 0xFF.
MAME flags the file BAD_DUMP and states the assumption inline. A full re-dump would
convert 116,736 assumed bytes into measured ones and let that flag be removed.
What the educated guess survives. A structure-aware reference census over the
disassembled boot ROM — which rebuilds byte-identically, so the census is over ground
truth rather than a linear-decode guess — found 220 ROM-address operand references, all
in dumped windows, none in an undumped range. The 45 live interrupt-vector entries, the
45 ROM trampolines, and the one indirect CALL T,XWA (bounded by an 8-entry table) all
resolve into dumped space, as do the only two callbacks the loaded v1.42 payload makes
into IC30 (0xFFFEA1, 0xFFFE86). There is one honest counter-example, ROM_CHECKSUM
(0xFF8AB4), which reads 2 KB past the dumped window at 0xFE0000; it is
content-independent and its only caller returns immediately unless a strap is asserted.
The code island also does not run up against a dump boundary anywhere: 2,048 blank bytes precede it, 1,971 follow it, and the chip’s first 2,048 bytes were read and came back blank.
What the guess does not yet survive: a rigorous check. The adversarial re-verification
graded the educated guess UNDECIDED, not corroborated. Its objection
is method: the enumeration it asks for — the targets of real JP/JR/CALL/CALR
instructions plus the vector-table entries, taken out of a disassembly — has never been run
and committed as an auditable artifact, and raw byte scans do turn up candidates. Two
concrete ones: the little-endian long at 0xFF8C44 is 0x00FF42A3 and the one at
0xFF8C4A is 0x00FFCFEB, both pointing into never-read space. Neither survives contact
with the source — both fall inside the black-key comparison chain of
NOTE_VELOCITY_LOOKUP_CALCULATE, and neither constant appears as an operand anywhere in
the assembly — which is exactly the point: at this data volume raw scans manufacture
coincidences, so only a structure-aware enumeration counts. Redoing the check properly is
cheap and is still outstanding. See
Sub-CPU Boot ROM (IC30) for the full record.
What it cannot settle. A full IC30 dump would not answer the sub-CPU payload question. The payload is 196,608 bytes; the entire chip is 131,072; the undumped part is 116,736; the boot ROM has no decompressor; and IC30 is not in the main CPU’s address space at all. See Sub-CPU Payload Provenance.
kn5000_custom_data.ic19 — real content, but missing the payload region
The image is a genuine chip read — the 77,824-byte block of 0x00 at chip 0x0C0000 is
actively programmed content, and flash erases to 0xFF, so it cannot be padding. Ten
independent structural anchors land exactly where the firmware’s own hardcoded pointers
say they should, which rules out any rotated, offset or wrapped read.
But the last non-0xFF byte is at chip 0x0D344F, and chip 0x0E0000-0x0FFFFF
(CPU 0x3E0000-0x3FFFFF) — where a type-7 update disc writes the compressed sub-CPU
payload — is entirely blank. Since every dumped firmware version reaches that source, a
machine matching this image could not start its sub-CPU. Whether the region was never
programmed on that unit, or an install was interrupted, or the dump is truncated and
0xFF-padded, is unresolved: the three are byte-indistinguishable in the file. The
full argument, and the two free measurements that would decide, are on
Sub-CPU Payload Provenance.
The MAME driver papers over the gap with a ROMX_LOAD overlay of the compressed payload
carved from a genuine update floppy. That composite is a reconstruction, and nothing
in the ROM definition marks it as one.
Note also that a locally held
kn5000_custom_data_with_preset.ic19is not independent chip evidence: it is byte-identical to the canonical dump except for a 27,967-byte SLIDE4K blob grafted at chip0x0E0000— a different, smaller blob than the 93,203-byte v1.42 subprogram.
kn5000_v10_program.rom versus the physical program flash
A reasonable worry, given the KN7000 precedent — where the “program ROM” we hold turned out
to be the update payload, which deliberately omits the top 0x90FF of the part and so
leaves it neither shipped nor dumped — is whether the KN5000 main-program image has the same
blind spot. (On the KN7000 that gap was for a while assumed to hold the resident updater;
that assumption is refuted
— real hardware reads the region as erased — but the payload is not the whole chip point
stands, which is what makes the worry reasonable.)
It does not. The v10 update floppy’s HKMSPRG.SLD carries a SLIDE4K stream whose
header declares a decompressed size of 0x200000 — the full 2 MB — and decoding it
reproduces kn5000_v10_program.rom byte for byte (2,097,152/2,097,152, consuming
965,545/965,545 input bytes; independently reproduced twice with separately written
decoders). The type 001h and 007h handlers chip-erase the pair before writing, so an
update rewrites the entire device and no region is left uncovered.
That identity does not by itself prove how the file was acquired — a chip read of a v10-updated machine and a decompression of the disc must agree — but it makes the distinction moot for preservation purposes.
The same measurement establishes the v10 ↔ v1.42 pairing as fact rather than inference:
both images come off the same floppy. The v141 → v7/v8 and v140 → v5/v6 pairings that
MAME’s BIOS options assert are not measured — the v10 disc is the only KN5000 system-update
disc available here (the only other official installer on the machine is the HD-AE5000 v1.15
one, AE5-115.exe, whose HKEXTROM.XAP is the v1.15i image).
Reference disassembly files (.unidasm) are generated with MAME’s unidasm tool for analysis.
Assembler
The project uses a custom LLVM backend (llvm-mc -triple=tlcs900) for assembly. All
instructions are encoded natively — no workaround macros needed.
Build process:
llvm-mcassembles.sfiles to ELF object filesld.lldlinks with a linker script that sets the ROM base addressllvm-objcopyextracts the raw binary from the ELF- generated payloads (demo presets, help databases, the v142 update image) are
recompressed and
cmp-checked compare_roms.pyverifies every section byte-for-byte against the originals
cd technics-roms-disasm
make gate-all # the gate: every gated image of every model and the 50 floppies, byte-exact or non-zero exit
# the full KN5000 similarity report: expect TWENTY-FIVE sections, all 100.00%
make clean-all && make all && make asl-all && python3 scripts/build/compare_roms.py
make all # KN5000 LLVM sections only (nineteen) + compare
python3 scripts/build/compare_roms.py # compare whatever is already built
make verify-demo-presets # 19/19
make verify-help-databases # 6/6
make audit-icons-blob # coverage report for icons_to_strings.bin
Two toolchains, and the LLVM one is authoritative. The LLVM TLCS-900 backend encodes
the TLCS-900/H2 instruction set natively. A second set of sources for ASL (Alfred Arnold’s
Macro Assembler) is archived in archive/asl/ and is still built and verified; ASL supports
only the TMP96C141, so those sources carry 110+ workaround macros for the TMP94C241F’s own
instructions — which is why they are the archived set and not the primary one.
Source Organisation
Each firmware version has its own tree (v7/, v9/, v10/ for the maincpu; v142/ for
the sub-CPU payload), with shared/ modules included by more than one ROM.
The three maincpu trees are split by subsystem, not monolithic: each is about 157 .s
files across roughly twenty directories, and the three carry the same file layout so a
routine sits at the same path in all of them. The remaining images are far smaller and are
not split that way — v142/subcpu is 5 files, hdae5000 8, table_data 26, and the
sub-CPU boot ROM and custom-data flash are a single file each.
Symbol names live outside the sources, in symbols/*_symbols_reference.txt; the three
maincpu trees share maincpu_symbols_reference.txt and each also has a per-version file.
File and line counts move with every conversion; measure them rather than quoting one:
find v10/maincpu -name '*.s' | wc -l
find v10/maincpu -name '*.s' -exec cat {} + | wc -l
The per-file breakdown lives on the Source Code Map page, and the diagram view of how the directories relate is on Architecture Flowchart.
Instruction census
How the source spells its instructions, for the v10 main-CPU tree. Produced by
python3 notes/syntax-convergence-probes/mnemonic_census.py --root v10/maincpu
which prints to stdout and writes nothing unless given --out:
| Bucket | Sites | Distinct names |
|---|---|---|
| Instruction statements, total | 329,465 | 259 |
— a native LLVM mnemonic unidasm also has |
313,275 | 68 |
| — a tree-local synthetic name encoding the operand form | 12,599 | 154 |
— a .macro defined inside the tree |
3,589 | 35 |
| — unclassified | 2 | 2 |
At 3417969c0, after the 2026-10-02/03 native respells, 1,027 sites over 37 names are byte
emitters wearing a mnemonic’s name: their operands are literal mode and displacement bytes
rather than modelled operands, so no rename reaches them until the operand is modelled. What
retiring the rest would take is on LLVM Semantic Instructions.
No LABEL_ placeholder is left in the reference file:
grep -c LABEL_ symbols/maincpu_symbols_reference.txt # 0
The file’s own header block carries the count, regenerated with it by
scripts/analysis/l2_symbol_reference.py --regen (last on 2026-10-06, at 88bc2005c):
53,746 symbols, of which 53,108 (98.8 %) have semantic names and 638 are positional. No
opaque LABEL_XXXXXX placeholders remain, in that file or in any of the other seven
symbols/*_symbols_reference.txt. Note the file is v10 only — it agrees with the v7 ELF
at 25.96 % — so each version also has its own.
Subsystem entry points (main CPU):
- FDC —
storage/fdc_routines.s:FDC_COMMAND_DISPATCHER, per-command handlers,FDC_PulseResetLine,Check_for_Floppy_Disk_Change;fdc_constants.sholds the 0x110000-base I/O addresses, uPD765-compatible command codes and status-bit definitions. - MIDI / encoders —
midi/midi_encoder_routines.s:CPanel_EncoderDispatch,Encoder_ProcessExpressionPedal/Volume/Breath/Foot/Expression. - Control panel —
ui/cpanel_routines.s: serial state machine (CPanel_SM_*), packet processors (CPanel_RX_*), LED control, buffer management. - SysEx —
midi/sysex_routines.s:ExcSendFunc,ExcPmemFunc,ExcSmemFunc,ExcCompFunc,ExcSeqFunc,ExcMspFunc. - Feature demo —
demo/demo_routines.s,demo/fdemotext_routines.s. - Computer interface —
midi/computer_interface_config.s,midi/computer_interface_pcg.s. - File I/O —
file_io/: title handlers, disk operations, filename/password UI, composer filters, SMF operations, wallpaper loading, single load, medley, misc UI. - GUI constants —
gui_constants.s: display dirty flags (0x0205E4), offscreen buffer addresses (0x043C00, 0x056800, 0x05FE00, 0x069400), 320×240 @ 8bpp.
Sub CPU Boot ROM
The 128 KB sub-CPU boot ROM rebuilds at 100.00% — against a file that is 97% 0xFF and
89% never read, so read that number together with Dump Provenance
above and with Sub-CPU Boot ROM (IC30). Routines
identified include the tone generator init loop (TONE_GEN_CHANNEL_INIT), register-pair
writers, COPY_WORDS/FILL_WORDS, CHECKSUM_CALC, the inter-CPU handler set, and the
debug/diagnostic tail at 0xFFFE80.
DMA transfer routines (0xFF8604–0xFF881E):
| Routine | Address | Size | Description |
|---|---|---|---|
SendData_Chunked |
0xFF8604 | 69 bytes | Send data in 32-byte chunks via DMA |
InterCPU_SendChunk |
0xFF8649 | 99 bytes | Send single data block via DMA |
SendCmd_E3 |
0xFF86AC | 48 bytes | Send E3 (payload ready) command |
SendParams_E2 |
0xFF86DC | 112 bytes | Wait for DMA, then send E2 command |
TwoPhase_Transfer |
0xFF874C | 211 bytes | Two-phase DMA with E1 command, 200-cycle delays |
The 656-byte data region at 0xFF8000–0xFF828F is now source. A single .incbin was
hiding eight cross-referenced objects: an 8-entry command-handler jump table of .long
code pointers, a RAM-test region descriptor, and the tone generator’s velocity/touch front
end. The last six of those objects also exist, byte-identical, in the v1.42 payload, so
they carry the payload’s own names. The tree now contains no .incbin at all — the blob
file stays on disk only because the ASL mirror still bincludes it. Full breakdown:
Sub-CPU Boot ROM (IC30).
Bear in mind what “rebuilds at 100.00%” means for this particular image: 116,736 of its
131,072 bytes were never read off the chip and are present in the file as assumed 0xFF,
and only 4,352 bytes in the whole image are not 0xFF. Reproducing assumed bytes is not an
achievement. See the dump-provenance section above.
Table Data ROM
The table-data ROM holds the first-stage bootloader plus almost all factory data. See Table Data ROM for the region-by-region reference and Memory Map for the current layout.
First-stage bootloader (0x9FB496–0x9FFFFF). All of it is now symbolic assembly. At
reset the table-data ROM is mapped at 0xE00000–0xFFFFFF, so ROM address 0x9Fxxxx executes
at boot-time alias 0xFFxxxx (+0x600000) until Boot_Init reprograms the memory
controller. Source labels are at ROM addresses; the 0xFFxxxx aliases appear in comments,
and the handful of CALL-absolute sites that must stay numeric are marked as such.
| Component | Address range | Module |
|---|---|---|
| FDC dispatch offset tables | 0x9FB496–0x9FB4D1 | kn5000_table_data.s (three tables) |
Boot_BitMaskTable + Boot_InitParams |
0x9FB4D2–0x9FB4E7 | kn5000_table_data.s |
Boot_Init, halt handler, Boot_ClearRAM |
0x9FB4E8–0x9FB7F1 | kn5000_table_data.s, shared/ |
| HDAE5000 boot-flash tail | 0x9FC6F6–0x9FC8C1 | kn5000_table_data.s (was bootcode_hdae_to_lzss.bin) |
| LZSS decoder suite | 0x9FC8C2–0x9FCC29 | kn5000_table_data.s (872 bytes, five routines) |
| FDC command-layer driver | 0x9FD8A5–0x9FEA9C | boot_fdc_driver.s |
| Disk-format probe | 0x9FEB2B–0x9FEC6D | boot_disk_probe.s |
| CP-serial driver (polling half) | 0x9FEC6E–0x9FF228 | boot_cpserial.s |
| CP-serial ISRs | 0x9FF229–0x9FF2F1 | boot_cpserial_isr.s |
| CP-serial state handlers/codecs | 0x9FF2F2–0x9FFB2E | boot_cpserial_states.s |
| Boot C runtime | 0x9FFB2F–0x9FFE7F | boot_clib.s |
| Debug group (disabled) | 0x9FFE80–0x9FFEDF | boot_debug.s |
RESET_HANDLER + IVT |
0x9FFEE0–0x9FFFFF | kn5000_table_data.s |
The LZSS decoder is SLIDE4K (4 KB sliding window, 12-bit offset, 4-bit length) and is invoked during flash firmware updates:
| Routine | Address | Size | Purpose |
|---|---|---|---|
LZSS_ReadByte |
0x9FC8C2 | 115 bytes | Read from compressed stream with sector buffering |
LZSS_OutputByte |
0x9FC935 | 63 bytes | Write decompressed bytes with 32-bit batching |
LZSS_OutputByte_Alt |
0x9FC974 | 63 bytes | Alternative output for flash update mode |
LZSS_ParseHeader |
0x9FC9B3 | 157 bytes | Parse/validate firmware header, set up source |
LZSS_Decompress |
0x9FCA50 | 474 bytes | Main decompression loop with sliding window |
(The 4 KB/8 KB variant dispatch lives in the main-CPU firmware, not here — see the help database note above.)
System update bitmaps (shared with the main CPU). Eight 1-bit monochrome images
(224×22 px, 616 bytes each) at 0x9FA156, byte-identical to the main-CPU copies; both ROMs
.incbin the same files.
| Address | Image |
|---|---|
| 0x9FA156 | Flash Memory Update |
| 0x9FA3BE | Now Erasing |
| 0x9FA626 | FD to Flash Memory |
| 0x9FA88E | Completed |
| 0x9FAAF6 | Please Wait |
| 0x9FAD5E | Change FD 2 of 2 |
| 0x9FAFC6 | Illegal Disk |
| 0x9FB22E | Turn On AGAIN |
Key discovery (still valid): the interrupt vector table holds boot-time addresses (0xFFxxxx) precisely because of the reset-time mapping described above.
Shared source with the Main CPU
Several bootloader routines are byte-identical or semantically identical to main-CPU
utilities — both ROMs were built from common source. The disassembly now uses real shared
modules in shared/:
| File | Description |
|---|---|
shared/vga_constants.s |
VGA register addresses and constants |
shared/vga_init.s |
VGA initialization data + completion code |
shared/vga_io.s |
VGA register I/O routines (byte-identical between ROMs) |
shared/boot_call_init_handlers.s |
Init handler dispatch (conditional assembly) |
shared/boot_routines.s |
Boot initialization routines + LZSS decoder |
shared/macros.s, shared/sfr_tmp94c241.s |
Macros and SFR definitions |
Shared routine mapping:
| Table Data | Main CPU | Size | Routine |
|---|---|---|---|
| 0x9FCDFC-0x9FCE1D | 0xEF5141-0xEF515F | 30-34 bytes | Write_VGA_Register, Read_VGA_Register |
| 0x9FB70A-0x9FB73F | 0xEF086F-0xEF08A3 | 53-54 bytes | Boot_CallInitHandlers |
| 0x9FCD9A-0x9FD7BD | 0xEF50DF-0xEF5B02 | 2,596 bytes | VRAM_FillRect and display routines |
| 0x9FBC3C-0x9FBECF | 0xEF3CE0-0xEF3F73 | 660 bytes | Boot utility routines |
| 0x9FB4F2-0x9FB622 | 0xEF03D0-0xEF0500 | 305 bytes | Boot initialization code |
Where the two ROMs differ in encoding (byte vs word compare, different helper addresses), conditional assembly handles it — each ROM defines the required parameters before including the shared file.
Technical Notes
TMP94C241F vs TMP96C141
Instructions unique to TMP94C241F that required macro workarounds under ASL:
- Memory-to-memory
LD(not supported by TLCS-900) - Certain shift/rotate variants
- Some MUL/DIV variants
- LDI, LDIR, LDD, LDDR block transfer instructions
- DMA control register access (
LDCwith DMAS/DMAD/DMAC/DMAM registers)
The LLVM backend encodes all of these natively; the macro tables below document the archived ASL mirror, which is still built.
ASL Macro Workarounds (tmp94c241.inc)
DMA register macros:
| Macro | Encoding | Description |
|---|---|---|
LDC_DMAS0_XWA |
e8 2e 00 |
Load DMA source 0 from XWA |
LDC_DMAS2_XDE |
ea 2e 08 |
Load DMA source 2 from XDE |
LDC_DMAS2_XHL |
eb 2e 08 |
Load DMA source 2 from XHL |
LDC_DMAD0_XWA |
e8 2e 20 |
Load DMA destination 0 from XWA |
LDC_DMAD0_XBC |
e9 2e 20 |
Load DMA destination 0 from XBC |
LDC_DMAD2_XWA |
e8 2e 28 |
Load DMA destination 2 from XWA |
LDC_DMAC0_WA |
d8 2e 40 |
Load DMA count 0 from WA |
LDC_DMAC0_A |
c9 2e 42 |
Load DMA count 0 from A |
LDC_DMAC2_A |
c9 2e 4a |
Load DMA count 2 from A |
LDC_DMAC2_BC |
d9 2e 48 |
Load DMA count 2 from BC |
LDC_DMAC2_WA |
d8 2e 48 |
Load DMA count 2 from WA |
Additional sub CPU boot ROM macros:
| Macro | Encoding | Description |
|---|---|---|
INC_0_XBC |
e9 60 |
Increment XBC by 1 |
PUSH_WORD value |
0b LL HH |
Push 16-bit immediate |
CP_pXWA_WORD value |
90 3f LL HH |
Compare (XWA) with 16-bit immediate |
CP_pXBC_d_WORD d,val |
99 dd 3f LL HH |
Compare (XBC+d) with 16-bit immediate |
LDA_XWA_IMM24 value |
f2 LL MM HH 30 |
Load 24-bit address into XWA |
CALR target |
1e LL HH |
Call relative (3-byte encoding) |
CALL_ABS24 target |
1d LL MM HH |
Call absolute with 24-bit address |
JRL_T target |
78 LL HH |
Jump relative long (always true) |
LDIR_94 |
83 11 |
Block copy (TMP94C241 encoding) |
LD_A value |
21 nn |
Load immediate to A register |
LD_D value |
24 nn |
Load immediate to D register |
LD_E value |
25 nn |
Load immediate to E register |
LD_L value |
27 nn |
Load immediate to L register |
LD_W value |
20 nn |
Load immediate to W register |
LD_pXIX_IMM16 value |
b4 02 LL HH |
Store 16-bit imm to (XIX) |
LD_pXHL_IMM16 value |
b3 02 LL HH |
Store 16-bit imm to (XHL) |
LD_MEM24_IMM16 addr,val |
f2 LL MM HH 02 VV WW |
Store 16-bit to 24-bit addr |
Stack frame and register macros (DMA routines):
| Macro | Encoding | Description |
|---|---|---|
DEC_6_XSP |
ef 6e |
Decrement XSP by 6 (allocate stack frame) |
INC_6_XSP |
ef 66 |
Increment XSP by 6 (deallocate stack frame) |
LD_IZ_BC |
d9 8e |
Load IZ from BC |
CP_IZ_imm16 val |
de cf LL HH |
Compare IZ with 16-bit immediate |
SUB_IZ_imm16 val |
de ca LL HH |
Subtract 16-bit immediate from IZ |
LD_C_IZL |
c7 f8 8b |
Load C from low byte of IZ |
EXTZ_WA |
d8 12 |
Zero-extend A to WA |
EXTZ_BC |
d9 12 |
Zero-extend C to BC |
Stack-relative addressing macros:
| Macro | Encoding | Description |
|---|---|---|
LD_A_pXSP_d disp |
8f dd 21 |
Load A from (XSP+disp) |
LD_XDE_pXSP_d disp |
af dd 22 |
Load XDE from (XSP+disp) |
LD_XBC_pXSP_d disp |
af dd 21 |
Load XBC from (XSP+disp) |
LD_pXSP_d_A disp |
bf dd 41 |
Store A to (XSP+disp) |
LD_pXSP_d_XDE disp |
bf dd 62 |
Store XDE to (XSP+disp) |
ADD_pXSP_d_XWA disp |
af dd 88 |
Add XWA to (XSP+disp) |
Encoding Differences
ASL sometimes chooses different (but functionally equivalent) encodings than the original ROM:
| Instruction | Original | ASL Default | Notes |
|---|---|---|---|
lda XWA, imm16 |
5-byte (24-bit addr) | 4-byte (16-bit) | Use LDA_XWA_IMM24 macro |
call addr |
3-byte calr |
4-byte call |
Use CALR macro when target is within range |
jp addr |
3-byte jrl T |
4-byte jp |
Use JRL_T macro for relative long jump |
ldir |
83 11 |
85 11 |
Use LDIR_94 macro for TMP94C241 encoding |
ld A, imm8 |
21 nn |
Different | Use LD_A macro |
ld D, imm8 |
24 nn |
Different | Use LD_D macro |
How the source represents the ROM
Code spelled as data
Executable code is written as native TLCS-900 mnemonics wherever it has been identified as
code. It is not true that no code remains as .byte: the sub-CPU boot ROM, table data,
custom data and prom_c are at zero, while v10, v9, v7, the sub-CPU payload (twelve single
instructions), prom_a and prom_b still hold instructions spelled as data (the HD-AE5000’s
1,713 B of uncommented .byte is not shown to be code: 1,654 B of it is the palette
HDAE5000_Palette_Button01 and the bitmap HDAE5000_Bitmap_Button01) — in prom_a, 82
certified .byte instruction sites (226 B, 42 forms) at disassembly commit 3417969c0;
under the current assembler pin (a3a81863f87d) the census script spells one form (decf),
and 34 more sites in thirteen shift-by-A forms reassemble byte-identically as slaa, slla
or srla, which the script does not try, so 47 sites in 28 forms have no spelling found so
far. The per-image figures and the method that measures them are on
Raw Byte Code Elimination.
Data tables held as C
Structured data is source as typed C rather than byte arrays wherever the shape is known: 15
sound-data tables in audio/sound_data_*.c and 27 NAKA widget descriptor blocks (plus two
lookup tables) in ui_widgets/ are __attribute__((packed)) struct initializers with named
fields and _Static_assert size checks, compiled and .incbin‘d so the ROM stays
byte-identical. These are data only — no routine of the reconstruction is expressed as C
source yet, although the original firmware is mostly compiled C (Toshiba’s TLCS-900 compiler;
see Original Toolchain); see
ScreenData C conversion and UI Widget
Types.
The IC307 waveform ROM’s format is decoded on Waveform ROM Format: four 1 MB pages, each a directory, parameter records and 16-bit or 8-bit PCM, of which IC307 holds every other word (the Y half of a word-interleaved pair, 2026-10-30). No sample rate is stored. (Earlier revisions of this paragraph said 16-bit PCM at 32 kHz with a 512-entry sample table; none of that was right.)
Binary include splitting policy
Binary includes are split whenever code references an address inside them, so that
cross-references use symbolic labels instead of hardcoded addresses and structure
boundaries are explicit. A slice must also carry a label, a length and a comment saying what
it holds — an unnamed whole-file .incbin is treated as an unfinished conversion.