The project is at a stable checkpoint.
- System test wrapper:
./runtests.shpasses
- CPU corpus:
cd test && node runner.jsPassed: 252/254Failed: 0/252Deferred: 2/254
- Deferred only:
CALLMRTM
Those two remain deferred invalid smoke tests, not active emulator regressions.
- ROM monitor boots and prompts reliably
load,loadasm,save,saveasm,list,source,reset,quit- interactive
g,gl,t - UART output and polling input
- host-side line editing
- cached build flow by default, explicit
--from-source/ rebuild modes available
- host-built binaries in
save/ - monitor-loadable source in
source/ - reusable 68k-side helper layers:
console.incinput.inctask.inc
- interactive demo:
echo_line.bin
- cooperative demos:
coop_demo.bincoop_regs.bin
MOVEMNBCDABCD- register shifts/rotates
- memory rotates
- bitfield + shift/rotate family extracted to
lineE.js - logical memory-destination tests now cover:
AND Dn,<ea>OR Dn,<ea>EOR Dn,<ea>
NEG,NEGX,SUBX,TSTreal tests- memory shift tests no longer placeholders
ADDQ/SUBQon address registers now implemented- byte-sized
A7destination/source stack step now uses2in EA helpers - cooperative rerun path fixed:
- repeated
goncoop_regs.binnow works cleanly
- repeated
quitcommand exits the launcher cleanly
Normal monitor start:
node tools/monitor.jsNormal system suite:
./runtests.shNormal CPU corpus:
cd test && node runner.jsCPU corpus from source:
./runtests.sh runner --from-sourceFull CPU artefact rebuild:
./runtests.sh runner --rebuild-allClean + full rebuild:
./runtests.sh runner --clean --rebuild-allMonitor ROM rebuild from source:
node tools/monitor.js --from-source./work/programs/build.shThat refreshes:
save/coop_demo.binsave/coop_regs.binsave/echo_line.binsave/hello_uart.binsave/pi16_nilakantha.binsave/print_pi16.binsave/print_status.binsave/puthex.binsave/ram_checksum.bin
j68> load 00190000 coop_demo.bin
j68> load 00180000 coop_regs.bin
j68> g 00190000
ABABABABAB
j68> g 00180000
ABCDEF
j68> g 00180000
ABCDEF
This specific rerun path was broken earlier and is now a required regression.
j68> quit
BYE
j68> source
j68> loadasm 00090000 helloworld.asm
j68> g 00090000
j68> list
j68> load 00090000 puthex.bin
j68> g 00090000
1234ABCD
It first looked like a launcher/prompt redraw issue because the visible symptom was:
- prompt text colliding with output
- stale
A - repeated
j68>prompts
The real fault was guest-side cooperative restart state.
Specifically:
coop_regs.binran correctly once- rerunning from the same loaded image was not restart-clean
- the fix was in the cooperative runtime/bootstrap, not the line editor
The current runtime now:
- clears both TCBs on entry
- stores an explicit
TCB_ENTRY - starts a fresh task by
jmptoTCB_ENTRY - does not rely on a fake stack-seeded
rtsstartup frame
That design should be preserved.
Host-side input editing remains in tools/monitor.js / tools/support/line_editor.js.
Keep that role split:
- Node: terminal editing and host UX
- 68k guest code: machine-visible input/output logic
Do not let src/j68.js continue to grow as a single wall.
The current first extraction already exists:
src/instructions/line5.jssrc/instructions/line4.jssrc/instructions/line8.jssrc/instructions/lineE.jssrc/instructions/movem.jssrc/instructions/nbcd.jssrc/instructions/abcd.jssrc/instructions/shift_rotate.js
This needs to continue.
Do not jump straight to one-file-per-opcode.
Use staged extraction:
- keep
j68.jsas the central dispatcher - move implementation by opcode family / line
- only then split heavy families further
Recommended next structure:
src/
j68.js
instructions/
line0.js
line4.js
line5.js
line8.js
line9.js
lineB.js
lineC.js
lineD.js
lineE.js
Then later:
src/instructions/line4/
movem.js
nbcd.js
abcd.js
The goal is:
- stable central decode
- smaller implementation files
- cleaner diffs
- easier test-to-code mapping
The suite is strong, but the core is not complete for all supported CPU families.
Known remaining categories from prior review:
- base-core semantic gaps still hidden in
not impl/ narrow-path handling - remaining EA coverage holes
- 68020+ full-format index/extension handling still incomplete
- partial supervisor/system-family coverage
- PMMU / 030 / 040 scaffolding exists but is not complete architectural support
It is no longer enough to only add semantics.
Continuing to leave new work inside src/j68.js will make future progress slower and riskier.
So the active blocker is two-part:
- remaining semantic gaps
- continued consolidation of those semantics out of the
j68.jswall
Still deferred.
Reason:
- missing authoritative local semantic fixtures
- local smoke tests are intentionally invalid
- do not guess module descriptor or saved module-state behavior
Only revisit when valid descriptor-backed tests can be built from authoritative docs.
The build flow is fixed.
But source rebuilds on some hosts still depend on assembler compatibility with the existing source corpus.
Current truth:
- cached/default runs are correct
- explicit source rebuilds work on hosts with a compatible assembler
- some GNU-style m68k assemblers reject parts of the current test corpus
That is now a source/toolchain portability issue, not a runner flow issue.
Do this next.
- create
src/instructions/line5.js- done
ADDQ/SUBQ,DBcc,Scc,TRAPccline-5 family extracted
- create
src/instructions/line4.js- done
- line-4 family extracted around
MOVEM,NBCD,NEG,NEGX,NOT,CLR, control-transfer/system cases
- create
src/instructions/line8.js- done
- line-8 family extracted around
SBCD,DIVU,DIVS,PACK,UNPK,OR
- create
src/instructions/lineE.js- done
- bitfields + shift/rotate now extracted behind
lineE.js
Do this as a refactor first, not a semantic expansion pass.
Acceptance:
- no semantic change
./runtests.shstill passescd test && node runner.jsstays:Passed: 252/254Deferred: 2/254
Do not guess. Inventory them.
Use searches like:
rg "not impl|TODO|throw console.assert" src/j68.js src/instructionsFor each remaining path:
- identify instruction family
- identify whether a test exists
- add a real CPU test if missing
- implement or explicitly defer with reason
Current concrete inventory from rg "not impl|TODO|throw console.assert" src/j68.js src/instructions:
src/j68.js- generic EA decode holes
- destination EA decode holes
- remaining line-4 default fallthrough
- remaining line-8 opmode fallthrough
- bitfield EA fallthrough
PMOVEmode fallthroughs- line-0 default fallthrough
- line-B default fallthrough
- line-C default fallthrough
CALLM/RTMdeferred assert path
src/instructionsmovem.js- full-format indexed EA not implemented
shift_rotate.js- memory decode still uses a generated
throw console.assert(false)for unsupported source-side path
- memory decode still uses a generated
line5.js- non-covered
ADDQ/SUBQmodes still intentionally assert
- non-covered
This inventory should be used to pick the next real CPU block instead of guessing.
Best next targets:
- remaining
CMPopmode/family gaps and strongerCMP*coverage - remaining effective-address coverage holes
MOVEMdepth / corner cases if any gaps remain- any still-partial line-0 / line-4 / line-8 / line-E paths discovered by the inventory
Do not reopen monitor/device/runtime work during this phase unless a CPU change breaks an existing demo or system test.
After the base-core gaps are cleaned up:
- 68020 integer/supervisor completeness
- broader indexed EA support
- bitfield hardening
CAS,CAS2,CHK2,TRAPcchardening- PMMU / 030 / 040 system behavior
Do not claim complete CPU-family coverage before this work is actually done.
Target:
- effectively complete active local instruction corpus
- no placeholder semantic tests
- all active runner entries passing
- only
CALLM/RTMdeferred by design
Current measured local status is:
252/254passed2/254deferred
That is the current practical baseline.
If aiming for “99.9% coverage”, keep the language precise:
- test corpus coverage is strong
- architectural CPU-family completeness is not yet total
Do not conflate the two.
- src/j68.js
- src/instructions/movem.js
- src/instructions/nbcd.js
- src/instructions/abcd.js
- src/instructions/shift_rotate.js
- work/programs/lib/task.inc
- work/programs/coop_demo.s
- work/programs/coop_regs.s
- TODO.md
- TASKS.md
- TASKLIST.md
If resuming immediately, do this:
- inventory remaining
CMP/ EA gaps after the currentlineEand logical-family work - run:
./runtests.shcd test && node runner.js
- inventory remaining
not implpaths - close the next narrow
CMPor EA family with real memory/register assertions first
If the next session needs a manual sanity check before CPU work, use:
j68> load 00190000 coop_demo.bin
j68> load 00180000 coop_regs.bin
j68> g 00190000
j68> g 00180000
j68> g 00180000
j68> quit
That is the safest continuation path from the current checkpoint.