NOP |
: For other meanings of NOP, see NOP (disambiguation)
NOP or NOOP (short for No OPeration ) is an assembly language instruction, sequence of programming language statements, or protocol (computing) command that does nothing at all.
= NOP Machine Instruction =
Most computer instruction sets include an instruction that does nothing for a specific number of clock cycles; it makes no changes to main memory or computer program status. NOPs are most commonly used for timing purposes, to force memory alignment, to prevent hazard (computer architecture)s, to occupy a branch delay slot, or as a place-holder to be replaced by active instructions later on in program development. The characteristics of the NOP instruction for the Intel x86 central processing unit family are:
In the MOS Technology 6502 and MOS Technology 6510 processors, NOP has the opcode 0xEA. The Motorola 68000 processor s NOP instruction has the opcode 0x4E71.
= NOOP code =
NOOP can also be used as a description for what a function or sequence of programming language statements does. If the function or code has no net effect, then it could be called a noop. An example in the C programming language could be as follows:
i++; i--;
Today, optimizing compilers search for noop statements and code. As the function or piece of code does nothing, the compiler simply removes it. Many optimizing compilers include a directive by which a programmer can explicitly disable this optimization, thereby including code that might appear to be a noop, for cases in which removing it would cause a bug.
= NOOP Protocol Commands =
Many protocol (computing)s, such as Telnet, include a NOOP command that a client can issue to request a response from the server without requesting any other actions. Such a command can be used to ensure the connection is still alive or that the server is responsive. A NOOP command is part of the following protocols ( this is a partial list ):
While most Telnet servers respond to a NOOP command with OK or +OK , some programmers have added quirky responses to noop. Some examples:
noop : OK, but why :) noop : Well, noop to you too!|
|
