Closed algometric closed 2 months ago
The problem is, you can't reliably create tests for instructions when the instructions to run these very tests are missing or written incorrectly. It's not like the test itself runs in an independent emulator after all, only testing the concerned instruction on your own side when absolutely needed.
You'll want to run the test after actually implementing most, if not all, of the instructions to a satisfactory degree, then it will help you point out discrepancies.
For more targeted cases, you'll be better off putting instructions in your ram and registers manually and checking the resulting values to ensure things worked as intended.
That's true, the test needs a couple of opcodes to actually be able to run. Honestly I'm slightly surprised that you can even render all of that with only the opcodes to IBM implemented 😄 I generally just throw an error (in my interpreter's code) when any opcode is used that I haven't implemented yet. That way you get an error from your interpreter telling you to implement the opcode, an error from the test telling you the implementation wasn't done correctly, or a tap on the back from the checkmark. We could be more specific about that in the manual though, that's a good point.
I added this text to the README file:
This test needs the opcodes listed above for the IBM logo as well as the conditional skip opcodes (
3XNN
,4XNN
and5XY0
) to be working properly to actually show you some sane results.
I only have the required opcodes to run the IBM logo screen implemented (00E0, 1NNN, 6XNN, 7XNN, ANNN, DXYN) with any unknown instruction nooping, and I get a huge number of checkmarks:
I'm assuming there's a magic opcode in here that if I implement it'll suddenly cause the others to break more consistently, but especially given its position right after the IBM logo in this repo that still seems misleading?
If this isn't an issue because any missing checkmark is a failure state, maybe it's worth just having a note in the readme?