Knowing that Intel and AMD processors fetch instructions in their native word length (64-bit mainly nowadays), I asked my brother about it and he said that to get the processor to run more efficiently, some assembly programmers pad their instructions to 32 bits with nop
s if the next instruction will put the byte length at more than 4 or 8 bytes:
xor ax, ax ; 2 bytes
nop ; 1
nop ; 1
So is there any benefit to doing this?
nop
s would not help in that case, you should pad with prefixes. – harold