The tool exomizer from Magnus Lind also comes with ana 6502 emulator, which according to the credits in the file was also written by Magnus. The tool (compiled into a program "testrun", pls. look for the source in the exomizer donwload) simulates the behavior of a 6502 machine program on the command line.