The PAL16L8 in the Atari 800XL has been configured with 12 digital inputs we need to write to, and 6 digital outputs we need to read.

We use Arduino digital pins 2 to 13 to write the logic pattern we want to test to the PAL16L8 inputs.

Then we use the Arduino A0 to A5 analog inputs (configured as digital inputs), to read the resulting state.

For each output condition/state that we want to test, the sketch feeds the corresponding logic pattern to the inputs, and then outputs the state of all output pins, so we can check if the logic in the PAL16L8 is working correctly to give the correct output result.

The results are printed to the serial console (19200 bps).