PDP-8 TTY Read Characters With Count in MQ
This program reads characters from the TTY and keeps a count of the characters in the MQ.
Obviously, you will need an EAE in order to display the count value in the MQ :-)
When no characters are arriving, the MQ will not increment.
I use this to diagnose my home-built W076 card.
0000 6032 kcc / clear keyboard flag
wait, 0001 6031 ksf / skip if keyboard flag is one
0002 5001 jmp wait / loop waiting for a character to arrive
0003 7601 cla / wipe accumulator in preparation for increment
0004 2017 isz count / increment count
0005 7000 nop / we don't care about the "skip" facet of the ISZ
0006 1017 tad count / get count
0007 7421 mql / stash count into MQ, clearing AC
0010 6036 krb / read character
0011 5001 jmp wait / wait for next character
count, 0017 0000 / counter value