what is the function of NOPL in x86 machine? It feels like it doesn\'t do anything, but why is it always in the assembly code?
Actually, NOP will be used in the assembly code when the code need to be patched.
Because the size of the new instructions may be different to that of the old ones, padding is needed.
The padding instruction should act as the same as NOP, although it may occupy several bytes.
The reason that we insert a more complex instruction, like 66 90, instead of several NOPs, is one instruction generally executes more quickly than several NOPs.