Archive: What is 'nop'?


What is 'nop'?
In help files for 2.15, the changelog mentioned that documentation was added for NOP

When you look it up, it says nop "does nothing". So why is it even there?


It's a delay; I'm not sure what instructions in NSIS might require a delay but 'nop' in assembly is designed to waste a clock cycle (or more depending on the processor). More accurately 'nop' is short for 'no op' or 'no operation'.


see

http://forums.winamp.com/showthread.php?postid=1865751

search is your friend ;0)


its just to make things more confusing ^^

example:

Goto +3
Nop

is exactly the same as:

Goto +2


?LOL?
Does anyone know a practical use for this?

Edit: Hmm maybe this haves an effect to the progressbar when used in section. The progressbar goes with the lines right?


not at the moment :)

think, kichik knew one.

it's used inside NSIS too, for some commands...


Actually, Nop came before me, I didn't add it. But I can tell what it can used for. As trueparuex said, it can be used to control the progress bar. It's also useful for debugging. If you edit the code in memory and you want some instruction not to execute, you can replace it with Nop. It can also be used to waste time, though Sleep is probably better at that.

It's not exactly used inside NSIS. You can say it's used for Goto, but I'd say it's actually the other way around. A Nop is the same as Goto 0.


In English:

It's a command that does nothing.

I've used it as a placeholder for 'Reboot' and such when developing installers that need to reboot the system.

-dandaman32