Illegal instruction test program
Posted: Sun Feb 10, 2013 7:59 pm
Here's a crude program that tests all illegal instructions. It can be used to test your 68000 emulation. The screen is blue while testing, green when finished, and red if an error occurred. An error is when any other exception than the illegal instruction exception was triggered, or if the instruction caused no exception and executed normally.
Source is included. I tested it on a few Motorola and Signetics 68Ks and it works fine.
http://www.sendspace.com/file/tkuc27
In general illegal instructions happen when the EA encoding for an instruction is invalid, so there are some patterns to which combinations of bitfields are invalid. The lone exception is $4E74 (RTD on later processors) which matches no pattern. This is why there is an odd number of illegal instructions ($2D09 total).
To make the list of illegal instructions I used this thing:
http://cgfm2.emuviews.com/img/fdtool.png
with a normal 68000 plugged in and tested all 64K possible instructions. So the opcode list should be 100% accurate.
If there's any demand I can make a similar test for the 68010.
Source is included. I tested it on a few Motorola and Signetics 68Ks and it works fine.
http://www.sendspace.com/file/tkuc27
In general illegal instructions happen when the EA encoding for an instruction is invalid, so there are some patterns to which combinations of bitfields are invalid. The lone exception is $4E74 (RTD on later processors) which matches no pattern. This is why there is an odd number of illegal instructions ($2D09 total).
To make the list of illegal instructions I used this thing:
http://cgfm2.emuviews.com/img/fdtool.png
with a normal 68000 plugged in and tested all 64K possible instructions. So the opcode list should be 100% accurate.
If there's any demand I can make a similar test for the 68010.