One can write an x86 code with rep stos which overwrites itself. It seems like intel core i5 stops execution of rep stos as soon as it overwrites the rep prefix and then executes the new code (with eip unmodified). However, amd seems to ignore self modifications and it executes rep stos till the end and after it eip points to (new) code right after rep stos.