Files
Stefan ArentzandClaude Fable 5 6b143cbc3f Phase 1: 6502 core, passing the Dormann functional test
Ports cpu.c, mem.c, and the 6502 half of ins.c to rust/ewm-core:

- bus.rs: the Bus trait (replacing the mem_t linked list) and a flat
  64K TestBus for the CPU test harness
- cpu.rs: registers, separate raw-valued flag fields packed/unpacked
  only in status()/set_status(), stack ops with u8 sp wraparound,
  reset/irq/nmi (keeping the pc+1 interrupt push quirk the Dormann
  tests depend on), strict-mode stack overflow checks, and step()
  with pc advanced before handler dispatch
- ins.rs: the 3-variant Handler arity enum, addressing-mode and RMW
  helpers ported expression-for-expression from mem.c (including the
  indx zero-page wrap and the indy non-wrap), ~200 handlers in ins.c
  source order, and the 256-entry table transcribed verbatim
- tests/dormann.rs: the cpu_test.c harness (success PC $3399,
  branch-to-self deadlock detection) plus unit tests for status
  round-trip, stack wraparound, and the indexed-indirect quirks

The Rust core executes 88,957,316 cycles for the functional test —
exactly the C emulator's count.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 08:58:31 -04:00
..