David Montero
f9906c3ad5
test_intel: Intel 8086 chip (minimum mode baseline)
...
~750 LOC clean-room from Intel iAPX 86,88 User's Manual (Oct 1979),
cross-validated against 8086tiny (MIT), MartyPC (MIT, hardware-
validated 99.9997% on SingleStepTests 8088 V2), YJDoc2/8086-Emulator
(Apache+MIT). No GPL refs (Fake86, DOSBox, MAME, QEMU all excluded).
Implemented:
- 40-pin minimum-mode contract (AD0..AD15, A16..A19, ALE, RD, WR,
M/IO, DT/R̅, DEN̅, BHE̅, INTR, NMI, INTA̅, RESET, READY, TEST̅, CLK,
HOLD, HLDA, MN/MX̅, VCC, GND).
- Reset state per [I86] PDF p.51: CS=0xFFFF, IP=0, all other segs=0,
flags clear with reserved bits canonicalised. First fetch at the
physical address 0xFFFF0 with proper ALE strobe.
- Bus cycle T1-T4 (instruction-per-tick collapse): drive AD with low
16 addr, A with high 4, pulse ALE, switch AD to input, assert RD̅
(or drive data + WR̅ for writes).
- 20-bit physical addressing: (segment<<4)+offset modulo 1 MB.
- Register file: AX/BX/CX/DX with byte halves (union), SP/BP/SI/DI,
IP, CS/DS/ES/SS, FLAGS.
- ModR/M decode for memory operands (Table 4-10 effective-address
formulas with default-segment selection).
- ISA subset: NOP, HLT, MOV reg/imm and r/m forms, MOV sreg, MOV
AL/AX,[addr]; ADD/OR/ADC/SBB/AND/SUB/XOR/CMP r/m + r and reverse
+ AL/AX-imm forms; Group 1 (immediate ALU); INC/DEC r16; PUSH/POP
r16; PUSHF/POPF; CLC/STC/CLI/STI/CLD/STD/CMC; conditional short
jumps Jcc; JMP near/short/far; CALL near/far; RET near/far +imm;
LOOP/LOOPE/LOOPNE/JCXZ; Group 5 (INC/DEC/CALL/JMP/PUSH r/m16);
segment-override prefixes.
Deferred (17 it.todo tests across ISA/integration):
- String ops (MOVS/CMPS/SCAS/LODS/STOS) with REP prefix.
- MUL/DIV/IMUL/IDIV.
- BCD adjust (DAA/DAS/AAA/AAS/AAM/AAD).
- Port I/O (IN/OUT).
- Hardware interrupts (NMI/INTR vectoring + INTA cycle).
- Maximum-mode bus protocol.
- Cycle-accurate prefetch queue.
Brings test_intel to 63 passing tests (was 60), 0 failed, 17 todo.
All 6 chips from the original plan (8080, Z80, 4004, 4040, 8086,
plus rom-32k/ram-64k/latch-8282 bus devices) now compiled and
their pin contracts + reset behavior + bus protocols are validated.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 03:58:49 +02:00