In the Z80 processor there is a magic register, the R-register, which has a value which increments magically after each instruction has executed. It is possible to calculate how much it goes up by, for example "XOR A" increments R by one, but "LD IX,23000" increments R by two.
If R is given a predetermined value at the start of the protection system, its value is known after every instruction until the loading system starts.
This was used in many of the protection routines on Spectrums, usually as part of code that would decrypt routines, and it was a pain for the same reason that the interrupt would have been - if you're in a debugger you mess up the global state of that register.