velxio/test/test_intel
David Montero 7ac17ff2b6 test_intel: fix 8086 MOV r/m,imm encoding (0xC6/0xC7)
Root cause of the deferred CALL/RET test: my chip was missing the
0xC6 / 0xC7 (Group 11 — MOV r/m, imm) opcodes. Bytes like the
test's "MOV byte [0x8002], 0x55" (0xC6 0x06 0x02 0x80 0x55) fell
through to the default NOP, then the chip decoded the residual
0x06 0x02 0x80 0x55 as PUSH ES + ADD r/m + ... taking SP into
unpredictable territory.

Implementation:
- 0xC6 (8-bit) and 0xC7 (16-bit) variants added.
- The encoding is opcode + modrm + disp + imm. Critically the disp
  bytes (consumed by calc_ea) come BEFORE the immediate, so we
  compute EA first, then fetch imm. Earlier draft had imm fetched
  before disp — that had imm winning the disp slot and disp becoming
  the next instruction's bytes. Caught only after wiring CALL+RET.

Tests: 8086 10→11 passing. Total test_intel: 93→94 passing,
0 failed, 11 todo. CALL/RET integration test now active and green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 20:44:17 +02:00
..
autosearch test_intel: phase E — 8086 ISA expansion 2026-04-30 20:44:17 +02:00
scripts
src test_intel: phase E — 8086 ISA expansion 2026-04-30 20:44:17 +02:00
test_4004 test_intel: complete Intel 4004 ISA 2026-04-30 03:38:11 +02:00
test_4040 test_intel: complete Intel 4040 new instructions 2026-04-30 03:44:01 +02:00
test_8080 test_intel: phase A — 8080 INTA bus protocol 2026-04-30 04:33:55 +02:00
test_8086 test_intel: fix 8086 MOV r/m,imm encoding (0xC6/0xC7) 2026-04-30 20:44:17 +02:00
test_buses test_intel: phase C — support chips (partial: rom-1m, 8255, 8251) 2026-04-30 04:53:31 +02:00
test_z80 test_intel: phase B — Z80 ISA polish (CB / DAA / RLD / ADC HL / CPI) 2026-04-30 04:44:27 +02:00
.gitignore
00_README.md test_intel: status doc — 93/105 passing across phases A/B/E + partial C 2026-04-30 20:44:17 +02:00
package-lock.json
package.json
vitest.config.js