....I should have explained that the routine is entered with the current input bit in SR8, bit 0.
Joe