Signal Pattern Detector - TIS-100


Here is my solution for Signal Pattern Detector in TIS-100 (342/4/16):

The task is to detect series of 3 consecutives zeros. I used the BAK register to store a counter. The procedure is a bit more cryptic in order to support the non-initialized BAK counter (0) which save us 2 instructions. Otherwise you would have to initialize the BAK register to 3 for your first run.

Another interesting way of solving this problem is found here. Obviously it would not generalize well if we were to look for a pattern with more than 3 zeros.