To run this place both files in the same directory and open a terminal window and use the command
halrun -I -f ptest.hal
You can push the output buttons and change the state of each output. When you toggle an input it shows up on the screen.
A parallel port tester for an existing parallel port and a second parallel port switched to "in" can be found on: http://www.vdwalle.com/Norte/Second%20Parport.htm
Info on the parallel port generally: https://en.wikipedia.org/wiki/Parallel_port
Parallel port pin diagram (medium-small png, 320x229):
Smaller and larger size diagrams here: https://en.wikipedia.org/wiki/File:25_Pin_D-sub_pinout.svg