velxio/test/test_intel
David Montero ab90bd7618 test_intel: complete Intel 4004 ISA
All 46 4004 instructions implemented per MCS-4 manual ([M4] Table V):
- ALU: NOP, INC Rn, ADD/SUB Rn, LD/XCH Rn, IAC/DAC, RAL/RAR, CMA, CMC,
  STC, CLB, CLC, TCC, TCS, DAA, KBP
- Memory/IO: SRC Pn (no-op stub), I/O group (WRM/WMP/WRR/WPM/WR0..3,
  RDM/RDR/ADM/RD0..3, SBM) all decoded; RAM-side effects stubbed
  pending real 4001/4002 chips
- Control flow: JUN (12-bit jump), JMS (push+jump), BBL (pop+ACC),
  JCN with full C1/C2/C3/C4 condition logic, ISZ in-page branch,
  FIM (load reg pair), FIN/JIN (indirect via P0)
- DCL: load CMRAM bank select

Plus a Bus4004 helper class in 4004.test.js that mirrors a 4001 ROM
chip — pre-drives D0..D3 with the appropriate nibble during M1/M2,
tracks observed PC via the chip's A1/A2/A3 address-bus drives. This
mechanism lets the test feed arbitrary opcode streams without
needing a separate 4001 ROM chip on the canvas.

5 new ISA tests promoted from it.todo to passing:
- NOP advances PC by 1
- JUN jumps to 12-bit target
- JMS+BBL stack push/pop
- JCN with C4 jumps when TEST is logic-0
- JCN does not jump when condition false

3 it.todo remain: LDM, FIM, Busicom-style integration. These need
accumulator-state observability (a fake 4002 RAM via SRC+WRM) to
test, which is deferred.

Total test_intel: 52 passing (was 43), 0 failed, 25 todo.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 03:38:11 +02:00
..
autosearch autosearch: Intel 4004/4040 spec + reference impls 2026-04-29 22:37:16 +02:00
scripts autosearch — Research notes for Intel + Z80 custom-chip emulation 2026-04-29 22:24:02 +02:00
src autosearch — Research notes for Intel + Z80 custom-chip emulation 2026-04-29 22:24:02 +02:00
test_4004 test_intel: complete Intel 4004 ISA 2026-04-30 03:38:11 +02:00
test_4040 test_intel: Intel 4004 + 4040 chip implementations 2026-04-29 22:45:34 +02:00
test_8080 autosearch — Research notes for Intel + Z80 custom-chip emulation 2026-04-29 22:24:02 +02:00
test_8086 autosearch — Research notes for Intel + Z80 custom-chip emulation 2026-04-29 22:24:02 +02:00
test_buses test_intel: Intel 8282 octal latch 2026-04-29 22:51:19 +02:00
test_z80 autosearch — Research notes for Intel + Z80 custom-chip emulation 2026-04-29 22:24:02 +02:00
.gitignore autosearch — Research notes for Intel + Z80 custom-chip emulation 2026-04-29 22:24:02 +02:00
00_README.md test_intel: Intel 4004 + 4040 chip implementations 2026-04-29 22:45:34 +02:00
package-lock.json autosearch — Research notes for Intel + Z80 custom-chip emulation 2026-04-29 22:24:02 +02:00
package.json autosearch — Research notes for Intel + Z80 custom-chip emulation 2026-04-29 22:24:02 +02:00
vitest.config.js autosearch — Research notes for Intel + Z80 custom-chip emulation 2026-04-29 22:24:02 +02:00