Are you using shift registers as pin multipliers?
Yes, I have 5 of them for reading inputs (giving 40 inputs), 4 for outputs (giving 32 outputs).
I thought about the idea of using an interrupt to read/write the shift registers, but only certain ones need to be read/written at certain times, depending on the rest of the system.
The reading/writing of the shift registers works fantastically, it is clean and the timing is deliberately designed to add a tiny delay every cycle - I don't want a "perfect" output while soak testing an imperfect system. The tiny time delay while reading/writing to the shift registers, and the periodic calling of the Random function is all designed to vary the output pulses ever so slightly, in addition to a random addition from the random function, and a larger shift every time the LED brightness reaches a limit. The results are very close to a realistic encoder it is emulating.
The bitSet and bitClear allows me to change a bit in use, while leaving the unused bits alone.
I did think about using a SIO device, but this time decided to keep it simple as I know what I am doing with 7400 logic.
It caught fire because of bad design - or rather because I used 1/2W resistors while being impatient waiting for the 3W resistors to arrive to drive the opto's at 240V, which didn't work anyway as the opto's I were using were useless. Anyway its no fun if it doesn't catch fire or explode, and you've got to have fun with electronics! It teaches you respect for them.