NOP

From Wikipedia, the free encyclopedia

(Redirected from Noop)
Jump to: navigation, search

In computer science 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 (besides wasting cpu clock cycles).

Contents

Some computer instruction sets include an instruction whose explicit purpose is not to 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).

NOPs are most commonly used for timing purposes, to force memory alignment, to prevent hazards, to occupy a branch delay slot, or as a "place-holder" to be replaced by active instructions later on in program development (or to replace removed instructions when re-factoring would be problematic or time-consuming).

The characteristics of the NOP instruction for the Intel x86 CPU family are:

NOP is sometimes used as a description for the action performed by a function a sequence of programming language statements. If the function or code has no effect, then it is sometimes called a NOP or NOOP (it might also be called redundant code). A common compiler optimization is the detection and removal of this kind of code.

The following is an example of a single C statement that behaves like a NOP (the issue is whether the statement affects program output, not whether or not a compiler generates any code for this statement):

    i+1;

(This statement performs an addition and discards the result.)

The simplest possible statement in C that behaves like a NOP is the so called null statement; which is just a semi-colon in a context requiring a statement. (A compiler is not required to generate a NOP instruction in this case.)

  ;

The null statement is useless by itself, but can have a syntactic use in a wider context, e.g., within the context of a loop:

  while (ReadChar() != '\n') ;

The above code continues calling the function ReadChar until it returns a \n (newline) character.

Many computer protocols, such as telnet, include a NOP 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 NOP 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!

NOPs are often involved when cracking software that checks for serial numbers, specific hardware or software requirements, presence or absence of hardware dongles, etc. This is accomplished by altering functions and subroutines to by-pass security checks and instead simply return the expected value being checked for.

close
Advanced Search
close
Included Web Search Engines

Choose the search engines to include in your metasearch




Safe Search

Smart Search
close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.