xor encoder with loop or marker