*** Welcome to piglix ***

NOP


In computer science, a NOP or NOOP (short for No Operation) is an assembly language instruction, programming language statement, or command that does nothing.

Some computer instruction sets include an instruction whose explicit purpose is to not change the state of any of the programmer-accessible registers, status flags, or memory and which may require a specific number of clock cycles to execute. In other instruction sets, a NOP has to be simulated by executing an instruction having operands that cause the same effect (e.g., on the SPARC processor, the instruction sethi 0, %g0 is the recommended solution).

A NOP is most commonly used for timing purposes, to force memory alignment, to prevent hazards, to occupy a branch delay slot, to render void an existing instruction such as a jump, or as a place-holder to be replaced by active instructions later on in program development (or to replace removed instructions when refactoring would be problematic or time-consuming). In some cases, a NOP can have minor side effects; for example, on the Motorola 68000 series of processors, the NOP opcode causes a synchronization of the pipeline.

Here are the characteristics of the NOP instruction for some CPU architectures:

In the case of both the NOP and NOPR instructions, the first 0 in the second byte is the "mask" value, the condition to test such as equal, not equal, high, low, etc. If the mask is 0, no branch occurs.

In the case of the NOPR instruction, the second value in the second byte is the register to branch on. If register 0 is chosen, no branch occurs regardless of the mask value. Thus, if either of the two values in the second byte is 0, the branch will not happen.

In the case of the NOP instruction, the second value in the second byte is the "base" register of a combined base register, displacement register and offset address. If the base register is also 0, the branch is not taken regardless of the value of the displacement register or displacement address.


...
Wikipedia

...