CRTC period is 32 hdots We want to advance through the phases so we need 32*N+1 hdots for our check-and-store routine Also must be a multiple of 3, so N=1, 4, 7 33 or 129 hdots = 11 or 43 cycles in al,dx stosb 111111111100000000111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 0000000011111111111111111111111 00000001111111111111111 0000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 00000000111111111111111111111111 2 5 0 3 6 1 4 7 6 1 4 7 2 5 0 3 bbbbbbbb bbbbbbbb If it's at 0 then increasing it to 1 will work If it's at 3 then 4 is still bad but 5 will work So 0 1 or 2 nops should work They don't, which means we're somehow getting into CRTC lockstep anyway 0000000 3d9 bit 0 pre-lockstep 2 1 found a non-zero after lockstep 5 2 found a zero after lockstep 7