code_starts_here: mov bx, ahead mov word ptr cs:[bx], 9090h ahead: jmp near to_the_end ; Some other code to_the_end: .
This self-modifying program will overwrite the jmp to_the_end with two NOPs (which is encoded as 0x9090).