10 ; Set initial state CYCLE: ; Define the label CYCLE test i 1 ; Test input bit 379h:6 (Pin 10) jz SIGNALED ; Jump if tested bit in zero state shift +1 ; Rotate state clockwise goto CYCLE ; Goto the CYCLE label SIGNALED: shift -1 ; Rotate state unclockwise goto CYCLE ; Goto the CYCLE label