This demo:
- loads 6502.min.js
- includes the nestest ROM
- sets PC to $C000 (where the automatic tests start according to the doc)
- calls op() 5002 times, logs the registers/flags/cycles and compare them to the official nestest logs
- If everything is identical, the CPU is accurate!
Interrupts:
- NMI pushes PC high + PC low + P with B=0, sets PC=$C5AF, sets I=1 and uses 7 cycles
- Reset pushes PC high + PC low + P with B=0, sets PC=$C004, sets I=1, resets c and uses 8 cycles
- IRQ pushes PC high + PC low + P with B=0, sets PC=$C5F4, sets I=1 and uses 7 cycles