Test Program

Combined test program source

Assembler listing

Expected output:



The strategy is:
  1. Test the Output instruction by printing the name of the next test ("A").
  2. Test the short Add instruction, and print the contents of the accumulator using a minimum of other instructions. The result is designed to give an easily recognisable bit pattern.
  3. Test all the jump instructions. The name of each test is printed followed by "P" for pass or "F" for fail.
  4. Test the short Subtract instruction using Add and Jump If Not Zero to verify the result.
  5. Test most of the other short word instructions. Subtract can now be used to verify the results.
  6. Test the long Add instruction and other long word instructions using a similar strategy.
  7. Test the multiplication instructions for various combinations of operand signs.
If any test fails, the program prints "F" and halts at that point. When all tests pass, "." is printed at the end.