This is a conversion of the excellent nestest.nes. While the original nestest does a great job of testing CPU quirks, it can be a little hard to use for early CPU implementations. In order to run it, you need to support loading .NES formatted files.
I did not write the original nestest.nes, but I have found in incredibly helpful for the development of my own 6502 emulator.
In order to simplify early CPU emulator implementations, and also enable it to be used on other 6502 systems, I have extracted just the program from the .nes file, and provided it as a binary.
To use this program, load the .bin file into your emulator’s memory, starting at 0xC000. Then set PC to 0xC000, and let your emulator run.
You can check for testcase failures in memory, or compare your emulator’s state against the expected states in nestest.log to catch issues with each instruction.
The nestest rom supports both valid and invalid instructions. You can see this if you look at nestest.log. The invalid instructions start at line 5004, with a illegal nop instruction.
If you just want to support valid/documented instructions, it is sufficient to ensure your emulator matches up to line 5003.
Here it is: nestest.prg.bin.
For more details see: