BIGpedia.com - NOP - Encyclopedia and Dictionary Online
encyclopedia search

NOP

This article is about the NOP assembly language mnemonic. NOP also stands for National Opinion Polls , a public opinion polling company in the UK.

NOP or NOOP (short for No OPeration) is an assembly language instruction, sequence of programming language statements, or computer protocol 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 memory or program status. NOPs are most commonly used for timing purposes, to force memory alignment, to prevent hazards, 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 CPU family are:

In the MOS Technology 6502 and 6510 processors, NOP has the opcode 0xEA.

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 computer protocols, 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):

Note that unlike the other protocols listed, the IMAP4 NOOP command has a specific purpose which is to allow the client to request that the server send unsolicited information reflecting the actions of other clients.

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!


The contents of this article are licensed from Wikipedia.org under the GNU Free Documentation License.
How to see transparent copy

01-04-2007 01:21:04