This kernel will test almost all DCPU-16 instructions for emulation accuracy. To facilitate the testing, the module reconstructs all instructions, such as multiplications and divisions, using other instructions, such as shifts and adds, to verify their consistency. List of exceptions: * Because the specs are ambiguous about how the EX should be set in ADX and SBX, this is only tested in an incomplete manner, * Because the specs do not say which value is written with "SET [0x1234], PC" or with "SET PUSH, SP", these kinds of instructions are not tested. * If the ADD instruction is improperly implemented, almost every instruction will fail. This program only verifies that it sets EX properly. It is assumed to calculate 16-bit additions properly. * The program requires quite a few instructions to work, such as JSR, for its own sake. * Conditional operations (IFB, IFE and so on) are tested only with a few samples, not thoroughly. It is however thoroughly tested that all combinations of stacking them works properly. * HWI is not tested for validicity. * While IAQ is tested to produce correct behavior with respect to interrupt queuing, only software interrupts are tested in this regard. * It is not tested whether instruction lengths are interpreted properly. * Certain combinations of PUSH, POP, PEEK, PICK, SP, and [SP] operands are not tested. * Hardware-originated IRQ behavior is not tested, nor any hardware, except in a positive manner: If a clock IRQ or a keyboard IRQ happens, this is reported on the screen. The application expects to find a monitor and hopefully also a keyboard. A clock is utilized for blinking the cursor if available. * The program will list at most two errors for each type of instruction. If you get a few errors early on and none after that, this is the reason. Fix the first errors that you encounter and then you may see more. Fun fact: This program will also run on DCPU-16 version 1.1, albeit producing different output. It also has support for the old specification of graphics / text output (assumes Arne's palette). Try that e.g. on: http://fingswotidun.com/dcpu16/pac.html Fun fact 2: Once all tests are completed, the DCPU-16 will halt and catch fire.