Repository navigation
Conversation
…or paths per code - asm_line / _asm_line_core In/Out/Clobbers traced (error return, last_err, asm_ptr advance, _asm_saved_sp); reg_* get an entry - MEGA_SUPPORT statements marked as the planned m65 build; digit suffix and zones D/E not assembled yet (TODO prerequisite bug) - BSS: reg_a..reg_p + _asm_sink = 8 bytes (was 182) - -D column per Makefile; gate cited by routine, not line number - ACC profile not numbered (per-CPU numbering); asm_opcode_lookup rejects bare IMP (validate_mode gone); full list of asm_error / asm_expr_error / asm_cpu_error sites; asm_syntax_error import unused - the source assembler emits through _emit_byte (asm_src.md) - asm_line.s header comments: letters-only key, expressions, error entries; zone D/E and G/H labels; history dropped Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r lines - Internal helpers: _emit_byte, emit_error, _bad_val_err, _vocal_fwd_err as function specs (G4) - directive recognition: exact-word match on _dir_names, RTS dispatch, how to add a directive; process_line label loop and expansion - § Error and warning lines owns ;?N: msg, ;!N: truncated, segment lines, ; N err, with the message list (no expr prefix in source) - .res/.align forward refs: reported on pass 0 only, layout differs on pass 1 (was "hard error on both passes") - asm_errors also counts pass-0 fwd ref; asm_size counts dropped bytes - _min_pc/_max_pc not exported; asm_pass belongs to asm_err; asm_line (not _asm_line_core); BSS table complete (_def_org, _cpu_save, _pc_wrap, _oor) - Depends on matches the imports (gap_buffer, screen newline); dead dec_pow_lo/hi import noted; history dropped - asm_src.s comments: gap_buffer imports, inc_pc_size, fold_block, emit_reserve/align fwd-ref rule, define_label both passes Co-Authored-By: Claude Opus 5.5 <[email protected]>
- asm_syntax_error: addr_mode only; asm_error: asm_line's error sites (opcode_lookup no longer jumps here); asm_expr_error: addr_mode (pass 1 and hard errors on pass 0) plus asm_line's immediate-range and $FFFF-wrap refusals - In/Out traced (_asm_saved_sp, A=X=0 to asm_line's caller); REPL dispatch is cmd_dot; asm_pass readers/writers complete - shared tail is 13 bytes; source line format points at asm_src.md - asm_err.s header: present-tense rationale instead of Phase history Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d planned - asm_opcode_lookup In: mode 0-15 on C64 builds, KERNAL banked out - Memory lists the generated KDATA tables; Depends on names symbols - mn_modes_x, the oplen_tbl m65 block, modes 16-19 and zone Q are planned (TODO § M65); oplen_tbl's only consumer is debugger.s (repl.s imports it unused) Co-Authored-By: Claude Opus 5.5 <[email protected]>
- inputs and h_tmp scratch live in zp.s; fp/base_op/profile are KDATA, hash_t/fp_c2 RODATA and exported to their classifier - T[0] is never read ($FF on mn7, $00 on mn6), not a guard - Out: A = X = slot; Y = mn_c2; KERNAL banked out - m65 variant marked planned; Depends on lists the table symbols; migration history dropped - comments: mn_vars.s says it defines nothing; mn7/mn6 normalization is asm_line's letters-only fold, not AND #$1F Co-Authored-By: Claude Opus 5.5 <[email protected]>
…om the code - MEGA_SUPPORT prefix peel, Q map, _dasm_pfx, 5-byte snapshot and the m65 view row marked as the planned build (TODO § M65 B6) - dasm_insn Out: $01 as the caller had it; clobbers _dasm_in - dasm_buf gets an Interface entry - Depends on names the table symbols and zp (asm_cpu, _dasm_*) Co-Authored-By: Claude Opus 5.5 <[email protected]>
- added str_dbg, str_go, str_tag_low, s_a_shadow, str_tag_prg, s_too_long, str_io; groups follow the .import lines (gap_buffer, addr_mode, log groups; mem group gone) - aliases: str_cpu_err, str_debug, str_tag_src, str_tag_cse; " free" - str_qynq is "? y/n"; prompts are ;!...? y/n (LOG_WARN) - unused exports/imports named (str_no_name; str_end_dbg only via its suffix); version.inc defines VERSION_STRING; history dropped - strings.s comments: prompt style, gap_buffer section names Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t A/X - log_open/log_close clobber A, X, Y, _io_scr and newline's set - seg_line/prg_line/free_line: tag in rp_ptr2, prg_line sets its own tag, highlight from rp_save2 / _info_mode; clobber list exact, rp_addr untouched; callers per function - puts macro lives in macros.inc (owned here); ten line-starters (nine in the sweep + TestInfoLine); Depends on: screen newline - log.s / macros.inc comments: Phase history dropped, puts_imm in log.s, log_open clobbers Co-Authored-By: Claude Opus 5.5 <[email protected]>
…urrent assembler_syntax.md and test_asm_src.py said a .res/.align forward reference is rejected on both passes; asm_src.s reports and counts it on pass 0, and the assembly fails. test_addr_mode.py no longer lists REL among mode_parse's results; test_asm_line.py names asm_opcode_lookup instead of the retired asm_validate_mode; the zp.s asm_len comment names asm_line. Comments only in src/: release PRGs unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Clobber lists traced from gap_buffer.s: Y for the byte movers, growth pulls in X, ed_scr, read_ptr and symtab ZP via update_workend. - ed_read_line returns 0-39 + NUL; longer lines are truncated and length 39 is ambiguous; the partial-result matrix now lives here. - __BUF_FLOOR__ is computed per build (no fixed address). - 36 tests; TestGbInitLeaf listed. - History removed (split date, "latent bug fixed"); stale source comments in gap_buffer.s fixed (comments only, PRGs identical). Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Interface: In/Out/Clobbers for every export; ed_init internal; ed_load_source returns Z=1 on every path (test A); save errors are OPEN failures only; ed_save_bytes/lines also written by `i`. - Tab key SHIFT+SPACE ($A0) (also three test_editor.py comments). - Overflow `>` is normal video; smart colon strips one tab and skips lines with `;`; no remembered goal column; key refusals listed. - Status bar: lower free address is the constant 0800; refresh paths. - New § Assembly errors: `;?N: msg` in the REPL, N = status-bar line, context strip keeps the last rows visible, no go-to-line. - Gap buffer, reader contract, BUF_FLOOR and workspace map now point to gap_buffer.md / memory_design.md; state and tests moved there. - Depends-on matches the used imports (seven dead imports named); CODE-resident locals recorded as a caveat; history removed; stale editor.s comments fixed (comments only, PRGs identical). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e code - theme_init documented (cold init and cse_recover, so recovery drops `C` colours); restore_colors also sets $0286. - Default theme is GREENLAND (d5d, Makefile); its fg is lt green. - kernal_screen_reset's only caller is hygiene_after_userland, run on every userland exit; reset_screen callers listed. - Clobbers include scr_src/_io_scr; Depends-on matches the imports (io_puts named as a dead import); `C` command syntax points to repl.md; scroll_up's unconditional CLI noted. - History removed (rc1/rc2 detour); stale screen.s comments fixed (comments only, PRGs identical). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…h the code - scr_to_pet: $40-$5F -> $C0-$DF, $60-$7F identity; the graphics round trip is not closed (stated, $E0-$FF claim removed). - io_init documented ($CC = 1; cold init and cse_recover); the stale io_cursor_off/memset caveats replaced. - In/Out/Clobbers traced for every entry (_io_scr, X = 0 from io_getc/io_kbhit, io_blip keeps Y). - dec_buf[5] is conversion scratch, NUL stored at the end. - io_color: written by restore_colors, read by nobody; scr_lo/hi, dec_pow and dec_buf importers corrected; Depends-on adds zp. - History removed; stale cse_io.s comments fixed (comments only, PRGs identical). Co-Authored-By: Claude Opus 5.5 <[email protected]>
- ZP: disk_ptr, _io_tmp and cur_device come from zp.s; only ptr ($FD/$FE) is hardcoded, written by every entry taking a filename. - Device is cur_device (zp.s, set by `$`); list_directory takes A. - PRG save is OPEN/CHKOUT/CHROUT; KERNAL SAVE is never called. - The caller reads the drive status (disk_done -> floppy_status); write errors after OPEN are not detected. - In/Out/Clobbers per entry (X = 0, ptr, open_buf, callback); list_directory output format; Depends-on matches the used imports (four dead imports named); CODE-resident locals noted. - History removed; stale disk.s comments (parameter stack, SAVE, scroll clobbering $FD) and one editor.s comment fixed (comments only, PRGs identical). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…the present - main.s: dead import log_line; kernel_init_sp no longer exported (no importer; tests do not look it up). - repl.s: expr_set_curaddr removed (no caller); dead imports cse_zp_end, io_utoa, dec_buf, io_kbhit, dbg_bp_count, __CODE_RUN__, kernal_bank_out/in, dec_pow_lo/hi, str_no_name, str_end_dbg, str_free_suf, str_tag_prg. - strings.s: str_no_name and str_end_dbg had no importer left and are gone; str_debug is its own "debug" string (it was a suffix of "end debug"); strings.md's label lists follow. - zp.s: "Phase 21 / Move" history dropped from section comments. PRGs shrink by 28 bytes each; full suite green. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`t N` / `o N` (N > 1) range-checked only the first step; the handler's step chain armed every later step BRK unchecked, so a chained step could patch $00 into I/O, ROM-shadow or CSE memory. - repl.s::step_targets_check is the gate (every non-zero step_next slot through bp_range_check_step), used by cmd_step and by main.s's @chain. - A refused chained step ends the chain at the instruction it would have run: step_state bit 7 marks it, post_run_cleanup prints ;!range with the panel, the session is kept. - debugger.md § `t` states the gate for every step; TODO item filed with its Fixed note; test TestChainedStepRange (fails without the fix). - Size budget lowered to the new sizes (21 209 / 20 866 / 21 789 B, 2 B under the previous budget after the dead-code cleanup). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s dead imports - asm_bit and _ex_wide_tmp were never read or written; both bytes are now unallocated holes (like $2C), so every later address stays put — recompaction stays with TODO § M65 A3b. - asm_line.s no longer imports asm_bit or asm_syntax_error. - zp.md, memory_design.md's ZP table and expr.md state the new layout (117 bytes exported, 3 unallocated in $02-$79). Same ZP addresses, same PRG sizes; full suite green. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r import Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The harness modelled only an empty serial bus, so no disk path of cse could succeed under test. C64Emu now takes drives: attach_drive(8-11) puts an in-memory 1541 (Drive1541) on the bus; traps on the KERNAL's own serial routines (TALK/LISTEN/SECOND/TKSA/CIOUT/ACPTR/UNTLK/UNLSN, found through the jump table) carry each byte to and from it, so OPEN, CLOSE, CHKIN, CHKOUT, CHRIN, CHROUT, LOAD and SAVE run the KERNAL's own code. The drive has channels 0-14 with CBM open strings ([@][d:]name[,type][,mode], wildcards), channel 15 commands (scratch, rename, new, initialize, validate, reset) and the DOS status strings, the "$" file as the 1541 formats it, write protect, disk-full, and a .d64 reader. EmuBase gains the hook it is built on: add_trap(). Contract: testing.md § C64Emu, Virtual IEC drives (and the add_trap line of § M65Emu, Interface). Tests: tests/unit/test_c64emu_disk.py (the model alone, and the drive under the real KERNAL). Co-Authored-By: Claude Opus 5.5 <[email protected]>
The bus traps answered every device number, so a call to a device with no drive returned "not present" at once — even where a stock C64 hangs: CHKIN on such a device enters the KERNAL's talk turnaround, which waits for a talker to pull CLK. The harness hid that. Now a trap serves only an attached drive; for any other device it leaves PC and the KERNAL's own routine runs against the empty-bus model at $DD00, so the harness behaves as the hardware does. Contract: testing.md § Virtual IEC drives, The bus. Test: test_chkin_on_a_device_with_no_drive_hangs_as_on_a_c64. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Cause: OPEN 14,dev,15,"" sends nothing on the bus, so it never notices a missing drive; the CHKIN that follows enters the KERNAL's talk turnaround (TKSA), which waits for a talker to pull CLK — forever on a C64 without that drive. Every `l`, `s` and `$` ends with the status read, so each hung with the drive off or absent. Fix: probe the device first with LISTEN + UNLSN and test ST bit 7; on "device not present" return with fl_buf empty, nothing opened. Test: test_disk.py::test_status_with_no_drive_returns_an_empty_status (C64Emu's empty serial bus, which reproduces the hang). Co-Authored-By: Claude Opus 5.5 <[email protected]>
The LISTEN/UNLSN probe that keeps the status read from hanging on a missing drive (453dd03) costs 19 bytes in every C64 build: 6502 20 887, 6510 21 230, 65c02 21 810. Co-Authored-By: Claude Opus 5.5 <[email protected]>
C64Emu left DFLTO ($9A) at 0 and LNMX ($D5) at 0. A program's own CHROUT went to device 0 (the keyboard) and misrouted to a BRK in the KERNAL; with DFLTO fixed by hand, LNMX = 0 still broke the logical line after the first character. Probers had to poke $9A = 3. Now the harness sets what the KERNAL's reset leaves: LDTND $98 = 0, DFLTN $99 = 0 (keyboard), DFLTO $9A = 3 (screen), LA/SA/FA $B8-$BA = 0, and LNMX $D5 = 39 with the row-0 line pointers. Contract: testing.md § C64Emu, Construction. Tests: test_kernal_io_defaults_as_after_cold_start, test_user_code_chrout_prints_on_the_screen. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ss gone test_repl_disk.py built its own bare-MPU binary (dev/repl_test_stub.s, dev/repl_test.cfg, a map-file regex) whose stubbed disk calls only recorded what a command would have done; disk.s's transfers were untested (Pattern C, VICE walks only). Now both run on C64Emu + the production PRG with a virtual 1541: - test_disk.py: disk_load_prg (header / given address / not found), disk_save_prg (header + payload, @: replace, the ",p,w" open string), disk_load_seq / disk_save_seq (bytes, counters, missing and empty files), floppy_read_status / floppy_status, list_directory (header reversed, entries, blocks free, device 9, the dev/test.d64 image, no drive). - test_repl_disk.py: every former stub test, now asserted on the drive (file name, type, bytes), memory, the editor buffer and the screen; plus the printed lines, PRG-load-not-found, `$ N` listing. The stub and its linker config are deleted (nothing else used them). Docs: disk.md test coverage + owned-file row, testing.md (leaf-test note; the obsolete sym_refs witness paragraph removed), build_system.md rows removed, repl.md row. Outside this track's files: tests/integration/test_repl.py docstring and one comment named the old stub harness; reworded. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Cause: list_directory tested `jsr io_kbhit / bne @user_key`, but io_kbhit returns the key count in A and ends with `ldx #0`, so Z was always set: a waiting key was never taken, STOP never ended `$`. Fix: `tay` after io_kbhit, so Z reflects A (+1 byte). Contract: disk.md § list_directory (STOP ends the listing with the break message; another key is dropped). Tests: test_stop_breaks_the_listing, test_another_key_is_dropped_and_the_listing_goes_on. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The `tay` that lets list_directory see a waiting key costs one byte per C64 build: 6502 20 888, 6510 21 231, 65c02 21 811. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Cause: ed_load_source's error exits (disk error, empty file, file too large) loaded A and then `ldx #0`, so Z came from X: always set. cmd_load branches `beq seq_ok_done` on it, so a missing or empty file printed "; 0l 0b" as a success, and a file too large for the buffer never showed `;?too big`. (ed_save_source had the same defect, fixed earlier.) Fix: `ldx #0` before the A load on all three exits (no size change). Contract: editor.md § Interface, ed_load_source: X=0 and Z set from A. Tests: test_load_with_no_drive_returns_1_and_leaves_empty_buffer (Z), test_repl_disk.py::test_load_seq_that_fails_reports_fail[missing,empty]. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Cause: disk_save_seq / disk_save_prg judged success by OPEN's carry alone. A drive accepts the OPEN of a file it then refuses — write protect (26), disk full (72) — and ST does not show it, so `s` printed a success line and ed_save_source cleared ed_dirty: the source counted as saved though nothing was written. Fix: every transfer ends by reading the drive's status into fl_buf (_close2_status / _status_ret); a save returns 1 unless the code is 0x. Since the drive clears its message once read, the REPL's disk_done now prints fl_buf instead of reading the channel again (floppy_status no longer used by repl.s); loads leave their status in fl_buf the same way. Contract: disk.md § Interface (disk_save_prg / disk_save_seq: drive refusal is an error, fl_buf = the status, for all four transfers) and § Design, Error channel. Tests: test_disk.py TestDriveStatusAfterTransfer; test_repl_disk.py test_save_refused_by_the_drive_fails_with_its_status; test_editor.py test_save_refused_by_the_drive_returns_1_and_keeps_buffer_dirty. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reading the drive's status at the end of every disk.s transfer, and failing a save the drive refused, costs 15 bytes per C64 build: 6502 20 903, 6510 21 246, 65c02 21 826. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…5-45gs02 26 978 -> 27 087 B The next commit: a directive's line-end check, set_cpu past its name, emit_bas past its string, and the open-string errors. Co-Authored-By: Claude Opus 5.5 <[email protected]>
emit_data_bytes, emit_string, d_org, d_const, set_cpu, emit_reserve, emit_align and emit_bas stopped at the first unexpected character and returned quietly: `.db 1 2` emitted 01, and `.org $c000 junk`, `.const k 5 6`, `.cpu 6502 junk`, `.res 2 3` and `.str "ab" x` all assembled with no error; an unterminated `.db "ab` or `.str "ab` too. On pass 1, when a directive reported nothing itself, process_line now checks the line's end at expr_ptr — whitespace, then NUL, CR, LF, `;` or `//` — else `bad val`. For that, set_cpu moves expr_ptr past the name and emit_bas past its string and closing quote. A string without its closing quote (`.db`, `.str`, `.scr`, `.bas`) is `exp "`. Deliberate C64 change (+112 B each; m65 +109; budgets in the previous commit); c64_prg_sha256.json re-recorded. The speed gates hold. Tests (test_asm_src.py TestDirectiveEnd), failing before: ten trailing -text lines are one error each, three open strings one each, and the directives with `;` / `//` comments none. Docs: assembler_syntax.md § Directives, asm_src.md § Directive recognition; TODO's bug moved to Fixed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…5-45gs02 27 087 -> 27 089 B The next commit: _vocal_fwd_err reports on pass 0 only (+2 B). Co-Authored-By: Claude Opus 5.5 <[email protected]>
_vocal_fwd_err forced its report on both passes, so a count, fill or boundary naming a symbol defined nowhere printed `fwd ref` on pass 0 and again on pass 1 and counted 2. A forward reference surfaces on pass 0 in every case (a later symbol is defined by pass 1), so the routine now does nothing on pass 1: one `fwd ref`, counted once. Deliberate C64 change (+2 B each; m65 +2; budgets in the previous commit); c64_prg_sha256.json re-recorded. Test (test_asm_src.py), failing before: `.res nosuch`, `.align nosuch`, `.res 2, nosuch` are one error each. Docs: assembler_syntax.md § .res, asm_src.md; TODO's bug moved to Fixed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Two code findings of the 2026-11-21 sweep: - expr.s @chk_label tested `cmp #'.' / beq @to_label` after a value below $41 was already rejected and one below $5B taken: it could never match (a `.name` local reaches the evaluator scoped). Removed. - breakpoints.s exported dbg_bp_find_flat (m65) with no importer; the routine stays, dbg_bp_set_flat runs it. Deliberate C64 change: -4 B on each C64 build, m65 -4; the budgets ratchet down in this commit; c64_prg_sha256.json re-recorded. Behaviour unchanged: test_expr, test_expr_m65, test_breakpoints and test_asm_src pass as before. Docs: breakpoints.md; TODO's two items moved to Fixed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`run_bank` moves into the step-state block, so `cse_recover` after a far start seeds the plain run premise again instead of the far map. `STEP_STATE_SIZE` is taken from the labels (11 on c64, 13 on m65): the old constant 11 swept `step_len` and missed `_rtu_need_sentinel`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The C64's 200 dex/bne wait is ~1 ms at 1 MHz but ~25 µs at 40 MHz, too short for the SID envelope to rise. On m65 it runs 80 rounds, ~0.8-1.2 ms at 2-3 cycles a turn. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The lowest SP over a break and the REPL commands typed at it (r, @, m, d, ., ?, t, b), from reg_sp: 31 B on c64, 32 B on m65, the deepest an expression. The contract and repl.s's equate comment give the figures; the 64 stays. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
tests/unit/test_breakpoints_m65.py runs the flat table on M65Emu: the 6-byte slots, set through the program's map and set_flat, a bank with offset 0 counted, del's slot x 6 per slot, clear keeping the step slots, patch/unpatch of the physical byte across a remap, step_bp_arm, dbg_step_find and dbg_step_clear. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
HELP opens a bordered window, 40 columns wide and the screen's full height (centred in 80 columns), over whatever is on the screen in any of the three modes: the REPL commands with their parameters, the keys, the directives with their arguments and the expressions. CRSR up/down scroll a line (a blip at the ends), HOME goes to the top, HELP / ESC / RUN/STOP close it and the screen comes back byte for byte (saved by DMA into the directory buffer 2.D000; REPL_SCREEN is the editor's). The text is src/help.txt, generated into src/help_text.s by dev/help_text.py under `make tables`; test_help_text.py holds it to repl.md's commands and assembler_syntax.md's directives. help.s is KCODE and the text KDATA (the data window); screen.s gains screen_stash / screen_unstash. The border's glyphs are checked in xmega65's character ROM ($FF7E000): the ROM's font at 3.D000 is another one. The c64 builds are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The owned-files audit checks tracked files only, so it passed before a64e051 added src/help.txt and src/help_text.s; both are exempt as the other generated tables are (help.txt is shown line by line: no comment syntax). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…5-45gs02 29 232 -> 29 233 B Co-Authored-By: Claude Opus 5.5 <[email protected]>
A character typed before a tab pushes the tab to the next stop, the line by up to 8 columns at once; the cap compared the width before the insert, so 32 spaces before the seeded tab made a 40-column line (m65: 72 -> 80) with the `>` marker, and RIGHT, which checked only ed_cur_col < LAST_COL, crossed that tab onto col 40: the next row. Fix: `_ins_capped` inserts, measures the cursor's line and takes the insert back (buffer and ed_dirty as before) when it is wider than LAST_COL: printable, INS, TAB and RETURN's tab (a 39-column line split at col 1 put its rest behind a tab, 46 wide; the new line now opens without the tab). RIGHT checks the column after the step; the DEL join puts the cursor at most on LAST_COL. Escape: the contract was right and never implemented. editor.md said from ff01621 (2026-04-12) that input "is refused when it would push a line past 39 visual columns"; the code compared the width before the insert, on the premise in 0433634's comment that a printable adds exactly one column (before a tab: 0 to 8). The April cap tests were Python mirrors of that pre-check on tab-free lines, retired unported by 6066d8e/e3c6f4e (no c64 cap test since 04-19). RETURN's cap regressed in 8e56848, which dropped the truncation ff01621 had restored. The decisive step: 062863e (2026-11-18), a doc pass "behaviour match editor.s", rewrote the contract to the code's pre-check, against README goal 3 ("never the reverse"); from then on doc and code agreed. editor.md states the invariant again; the record and four principle candidates (for triage) are in TODO. Tests: TestTheCap (c64), test_m65_source_editor.py (80x25, 40x25). C64 PRG hashes re-recorded. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- README § CDD Maintenance, item 3: a fidelity pass rewrites only descriptive clauses; a behavioural clause the code contradicts is filed as a bug, the doc unchanged (goal 3). 062863e had rewritten "refused when it would push a line past 39" to the code's pre-check. - README § The CDD Method, Step 6: the known-limitation rule — an accepted limitation goes into the owning doc or TODO, never only a commit message (0433634's "may under-refuse"). - testing.md Principle 11: invariants over state are stated as the invariant and tested across every mutator, from states where one action changes the measure by more than its own size. - testing.md Principle 21: retiring a test re-homes its clauses (the cap's mirror tests went unported in 6066d8e / e3c6f4e). TODO: the four move to § Records › CDD amendments — landed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…, entry points The April "39-column hard cap" section (4135313) stated the cap as a hard invariant and enumerated every place text enters with its rule; 062863e had reduced it to the code's mechanism. Restored to the current design: the terminology (content cols 0..38, the cursor rest at 39; LAST_COL on m65), the invariant, why width is not additive (a tab stop), a table of every place a line's width or the cursor's column changes with the rule that keeps the invariant, long lines, the workflow, and the rationale for joins and loads keeping long lines (flat refusal and forced newline tried and rejected). TestTheCap gains the table's remaining mutators (testing.md Principle 11): UP onto a long line, DEL before a tab, the smart colon — guards, green before and after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
tests/integration/editor_cap.py is editor.md § Long lines' matrix: every row of the entry-point table — printable, INS and TAB before a tab, mid-line and at the end; RETURN at col 0 and mid-line (tab kept, tab dropped); the smart colon; DEL before a tab and the joins; RIGHT, UP, DOWN, HOME; a long line refusing growth — each with a case that fits and one that would pass the cap, from a load, checked whole: the buffer, the cursor's line and column, the KERNAL cursor, `>` on exactly the long rows, a refusal's blip with the buffer and ed_dirty as before. test_editor.py runs it on the c64 (27 cases), test_m65_source_editor.py in 80 and 40 columns. Against the pre-fix editor.s six cases fail — the bug's; with a4013eb all pass. It replaces TestTheCap and two m65 cap tests (testing.md Principle 21: each of their clauses is a row of the matrix); the reported scenario, HOME and spaces before the seeded tab, stays as its own m65 test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…h a far pointer) Co-Authored-By: Claude Opus 5.5 <[email protected]>
….C000 The CSE map's two halves have one offset, so 3.2000-3.9EFF is one contiguous block in the CPU's view: CODE, RODATA, KDATA, KCODE and BSS are now one linker area (CSEWIN) instead of a code window and a data window, and the loader installs CODE..KCODE as one DMA block. KCODE stays what it is — the cold code, which could live somewhere harder to reach; m65 has room for it in the open, so its callers jsr it directly. The help popup's text (1.7 K) moves out of the window into the reserve 3.C000 (the HELP segment, a third install job), read through rp_ptr as a far pointer. M65Emu's install_prg follows the loader; test_m65_boot.py checks the HELP region in xmega65. Docs: build_system.md, memory_design.md, loader.md, glossary, mem.md, symtab.md, help.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…5-45gs02 29 250 -> 30 704 B (the clipboard, line swaps, the inverted selection) Co-Authored-By: Claude Opus 5.5 <[email protected]>
58b4a1c joined the m65 code and data windows into one linker area (CSEWIN, $2000-$9EFF) and put the help text in the reserve (RESERVE, $C000); the region guard still named CODEWIN and DATAWIN, so its three tests failed. They now bound CSEWIN (CODE, RODATA, KDATA, KCODE, BSS) and RESERVE (HELP), and shrink each by a byte to prove the overflow fails the link. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…; the selection inverted C= (MEGA) + B marks a line, + X cuts, + C copies and + V pastes whole lines; + K / + J swap the cursor's line with the one above / below. The keys are plain GETIN codes, the same on the c64 and the m65: no low-level keyboard code. The selected lines show inverted. The clipboard lives at the bottom of the gap buffer's region, [clip_base, buf_base): the growth carries it with the pre-gap text, and nothing that edits or walks the text sees it. It costs its length and no other memory; on the c64 the workspace's bound is clip_base (workend, the emit gate, b, free:). An insert that finds no room drops it and grows into its bytes (the document wins); a paste that would not fit is refused. Cut is copy + delete (gb_clip_copy, gb_delete), paste inserts above the cursor's line (gb_clip_put), and a swap exchanges the two lines in place by three reversals (gb_rev). After a move of lines the view moves as little as it can, as the cursor keys move it. Escape Analysis (a hardware test of the build before the size pass): a swap after a copy and paste reversed a line, because the swap's cursor moves counted in ed_tmp, which gb_cursor_left used as scratch while a clipboard sat in the gap. That design is gone. The view jumped to the top after a paste or a swap down on the bottom row, which was the rule as documented; editor.md now states the least move. Both escaped because every clipboard case began from a load on a short text: editor_clip.py gains the view on forty lines and swaps with a clipboard present, and editor_seq.py drives seeded random key sequences against a line model on the c64 and the m65 (testing.md Principle 22, new). Also: the asm_src test stub and the step tests set clip_base, the workspace's bound, instead of buf_base. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
`make bundle` builds both platforms' releases and gathers what a release ships in build/bundle/: the PRGs as cse-<platform>[-<cpu>[-exo]].prg (a platform's default CPU without its part: cse-c64.prg, cse-c64-exo.prg, cse-c64-6502.prg, cse-c64-6502-exo.prg, cse-m65.prg) and one disk image per platform, cse-c64.d64 (was cse.d64) and cse-m65.d81. The names on a disk carry no platform part: each holds its platform's default build as `cse` (the D81's was `cse-m65`); the c64's are the exomizer builds, without `-exo` in the name. .github/workflows/ci.yml runs on ubuntu-24.04: cc65 and VICE's c1541 from apt, exomizer 3.1.2 from source (checked, cached), Python 3.14 through pipenv; then pytest (Tier U + I, no VICE emulator, no xmega65), `make bundle` as the run's artifact, and on a v* tag a draft release with the bundle attached. The runners have no CBM ROMs: CSE_ROMLESS=1 turns C64Emu's missing KERNAL into a skip that names it; unset, as locally, it still fails loudly. Tests: test_makefile_guards.py (the D64's and D81's writes, the bundle's names), test_release_bundle.py (the bundle as built: the files, each PRG its build, each disk's name and files, read back with c1541). Co-Authored-By: Claude Opus 5.5 <[email protected]>
The splash reads `cse v0.2 by cr`, the disks are named `cse 0.2`. The C64 release PRGs' hashes are re-recorded for the version string (same length: the sizes do not change). Co-Authored-By: Claude Opus 5.5 <[email protected]>
… times) On the CI's Linux runner a no-op `make -n` after `make debug` rebuilt every object (test_build_freshness failed): ca65 writes the .d a few microseconds after the .o, and GNU make 4.3 compares sub-second times, so each .d was newer than its object, always. The generated tables had the same trouble behind build/.tables.stamp, touched after they were written. macOS's make 3.81 compares whole seconds and never saw either. The object's recipe now touches the .o last; the tables' touches the stamp, then the tables. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
R7's first release, v0.2: a native MEGA65-mode build of CSE, the CPU layer it rests on, banks on the MEGA65, copy and paste in the editor on both platforms, and a CI that builds the release bundle. Every milestone went through the CDD Method (doc delta → analysis → TDD plan → code tests-first → differential doc update). The record is doc/cdd_log.md § R7 — CDD Report; the open work is in doc/TODO.md.
What's in it
Slice 1, the CPU layer. Every opcode fact now comes from one source,
dev/instruction_set.py, which generates per-CPU-set tables:Golden files gate size, speed and behaviour.
Slice 2, the platform layer. A native MEGA65-mode program (
m65-45gs02) that ships as a PRG and a D81. It uses the KERNAL only through its jump table.[ ]far addressing, 16-bit branches, five byte columns).Slice 3, banks (m65). The REPL works in 28-bit flat addresses (
4.2000):randMshow it;j 4.2000runs a bank as JSRFAR would;The m65 HELP popup. The HELP key opens a bordered, scrollable cheat sheet of the REPL commands, keys, directives and expressions. Its text is generated from
src/help.txtand lives in the reserve at 3.C000. CSE's code and data now share one window,$2000–$9EFF.Editor, both platforms:
Fixes from the CDD Quality Sweep (2026-11-21), each with its test:
.edits the user's zero page (c64);mand.check a whole run before writing;dstops at$FFFF;j,g,b,landsrefuse bad arguments cleanly;io_blipkeeps ~1 ms on the MEGA65;dbg_initresets the whole step state;disk.sleaves$FD/$FEalone;The release bundle and CI.
make bundlecollects every release PRG ascse-<platform>[-<cpu>[-exo]].prg:cse-c64.prg,cse-c64-exo.prg,cse-c64-6502.prg,cse-c64-6502-exo.prg,cse-m65.prg;cse-c64.d64andcse-m65.d81. Each holds its platform's default build ascse; the C64's are the exomizer builds..github/workflows/ci.ymldoes four things:CSE_ROMLESS=1skips the tests that need the KERNAL, saying so);v*tag.Harness. M65Emu is a 45GS02 emulator held to xmega65 recordings of the CPU, memory, DMA, interrupt latches, the run premise and the editor API. Tier X tests drive xmega65 itself on ROMs 920413 and 920421. The editor gains contract matrices for the line cap and the clipboard, plus seeded random key sequences checked against a line model (testing.md Principle 22).
Method. The pending CDD amendments landed, plus those of two Escape Analyses: the editor cap, and the clipboard found in a hardware test.
Sizes (release PRGs, unpacked)
mainEach byte change to a C64 build was deliberate and recorded in
c64_prg_sha256.jsonandBUDGET. The C64 grew by the clipboard and line moves (+1 315 after a size pass), the Quality Sweep fixes, and the line cap's fix.Testing
pytest -q: 7086 passed, 18 skipped (macOS, at a6b2de2; the release commits after it are tested by CI).pytest tests/emulator(needs xmega65 and a MEGA65 SD image): 266 passed (at a6b2de2), on both ROMs.ci, Ubuntu 24.04, no CBM ROMs): 5144 passed, 1335 skipped (each skip names the missing KERNAL or M65Emu snapshot);make bundle's seven files uploaded as thecse-bundleartifact.python3 dev/audit_doc.py: every gating audit is clean.Still open
These are tracked in doc/TODO.md and are outside this PR:
🤖 Generated with Claude Code