All Topics  
NOP

 

   Email Print
   Bookmark   Link






 

NOP



 
 
In computer science
Computer science

Computer science is the study of the theoretical foundations of information and computation, and of practical techniques for their implementation and application in computer systems....
 NOP or NOOP (short for No OPeration or No Operation Performed) is an assembly language
Assembly language

An assembly language is a low-level language for programming computers. It implements a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture....
 instruction, sequence of programming language statements, or computer protocol
Protocol (computing)

In computer science, a protocol is a convention or standard that controls or enables the connection, communication, and data transfer between computing endpoints....
 command that effectively does nothing at all.

computer instruction set
Instruction set

An instruction set is a list of all the instruction , and all their variations, that a processor can execute.Instructions include:* Arithmetic such as add and subtract...
s include an instruction whose explicit purpose is not to change the state of any of the programmer accessible register
Register

Register may refer to:In linguistics:* Tone #Register tones and contour tones, a linguistics term for tones distinguished by relative pitch...
s, status flags
Status

Status is a state, condition or situation. In common usage it may refer to:*Social status*Economic status*HIV status*Status *Status quo*Status symbol...
 or memory, and which may require a specific number of clock cycles to execute.






Discussion
Ask a question about 'NOP'
Start a new discussion about 'NOP'
Answer questions from other users
Full Discussion Forum



Encyclopedia


In computer science
Computer science

Computer science is the study of the theoretical foundations of information and computation, and of practical techniques for their implementation and application in computer systems....
 NOP or NOOP (short for No OPeration or No Operation Performed) is an assembly language
Assembly language

An assembly language is a low-level language for programming computers. It implements a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture....
 instruction, sequence of programming language statements, or computer protocol
Protocol (computing)

In computer science, a protocol is a convention or standard that controls or enables the connection, communication, and data transfer between computing endpoints....
 command that effectively does nothing at all.

NOP machine instruction

Some computer instruction set
Instruction set

An instruction set is a list of all the instruction , and all their variations, that a processor can execute.Instructions include:* Arithmetic such as add and subtract...
s include an instruction whose explicit purpose is not to change the state of any of the programmer accessible register
Register

Register may refer to:In linguistics:* Tone #Register tones and contour tones, a linguistics term for tones distinguished by relative pitch...
s, status flags
Status

Status is a state, condition or situation. In common usage it may refer to:*Social status*Economic status*HIV status*Status *Status quo*Status symbol...
 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
SPARC

SPARC is a Reduced Instruction Set Computer microprocessor instruction set Computer architecture originally designed in 1985 by Sun Microsystems....
 processor the instruction sethi 0,%g0 is the recommended solution).

NOPs are most commonly used for timing purposes, to force memory alignment
Data structure alignment

Data structure alignment is the way data is arranged and accessed in computer memory. It consists of two separate but related issues: data alignment and data structure padding....
, to prevent hazard
Hazard (computer architecture)

In computer architecture, a hazard is a potential problem that can happen in a Instruction pipelined central processing unit. It refers to the possibility of erroneous computation when a CPU tries to simultaneously execute multiple instructions which exhibit data dependence....
s, to occupy a branch delay slot
Branch delay slot

In computer architecture, a delay slot is an instruction slot that gets executed without the effects of a preceding instruction. The most common form is a single arbitrary instruction located immediately after a Branch instruction on a RISC or Digital signal processor architecture; this instruction will execute even if the preceding branch...
, 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 code). In some cases, NOP can have minor side effects; for example, on the Motorola 68000
Motorola 68000

The Motorola 68000 is a 16/32-bit Complex instruction set computer microprocessor core designed and marketed by Freescale Semiconductor ....
 series of processors, the NOP opcode will cause a synchronization of the pipeline.

The characteristics of the NOP instruction for the Intel x86 CPU
Central processing unit

A central processing unit is an electronic circuit that can execute computer programs. This broad definition can easily be applied to many early computers that existed long before the term "CPU" ever came into widespread usage....
 family are:

  • Mnemonic: NOP
  • Byte
    Byte

    A byte is a basic unit of measurement of Computer storage in computer science. In many computer architectures it is a Byte addressing memory address space....
    s: 1
  • Opcode
    Opcode

    In computer technology, an opcode is the portion of a machine language instruction that specifies the operation to be performed. Their specification and format are laid out in the instruction set architecture of the processor in question ....
    : 0x
    Hexadecimal

    In mathematics and computer science, hexadecimal is a numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 09 to represent values zero to nine, and A, B, C, D, E, F to represent values ten to fifteen....
    90


NOP code

NOP is sometimes used as a description for the action performed by a function or 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
Redundant code

Redundant code is a computer programming term for code that computes a result that has been previously computed and is currently available, thus the repeated computation of the result is redundant....
). A common compiler optimization
Compiler optimization

Compiler optimization is the process of tuning the output of a compiler to minimize or maximize some attribute of an executable computer program....
 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
Compiler

A compiler is a computer program that transforms source code written in a programming language into another computer language . The most common reason for wanting to transform source code is to create an executable program....
 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; typically no instructions whatsoever would be generated.) ; 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.

NOP protocol commands

Many computer protocol
Protocol (computing)

In computer science, a protocol is a convention or standard that controls or enables the connection, communication, and data transfer between computing endpoints....
s, such as telnet
TELNET

Telnet is a network protocol used on the Internet or Local Area Network connections. It was developed in 1969 beginning with RFC 15 and standardized as Internet Engineering Task Force STD 8, one of the first Internet standards....
, 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
Keepalive

A keepalive is a message sent by one device to another to check that the Data link between the two is operating....
 or that the server is responsive. A NOOP command is part of the following protocols (this is a partial list):
  • telnet
    TELNET

    Telnet is a network protocol used on the Internet or Local Area Network connections. It was developed in 1969 beginning with RFC 15 and standardized as Internet Engineering Task Force STD 8, one of the first Internet standards....
  • FTP
    File Transfer Protocol

    File Transfer Protocol is a network protocol used to transfer data from one computer to another through a network such as the Internet.FTP is a file transfer protocol for exchanging and manipulating files over a Transmission Control Protocol computer network....
  • SMTP
    Simple Mail Transfer Protocol

    Simple Mail Transfer Protocol is an Internet standard for E-mail transmission across Internet Protocol networks. SMTP was first defined in RFC 821 , and last updated by RFC 5321 , which describes the protocol in widespread use today, also known as extended SMTP ....
  • X11
    X Window core protocol

    The X Window System core protocol is the base protocol of the X Window System, which is a Computer network windowing system for bitmap displays used to build graphical user interfaces on Unix, Unix-like, and other operating systems....
  • POP3
    Post Office Protocol

    In computing, the Post Office Protocol version 3 is an application layer Internet standard protocol used by local e-mail clients to retrieve e-mail from a remote mail server over a Internet protocol suite connection....
  • NNTP
    Network News Transfer Protocol

    The Network News Transfer Protocol or NNTP is an Internet application Protocol used primarily for reading and posting Usenet articles , as well as transferring news among news servers....
  • finger
    Finger protocol

    In computer networking, the Name/Finger protocol and the Finger user information protocol are simple network protocols for the exchange of human-oriented status and user information....
  • IMAP4
    Internet Message Access Protocol

    The Internet Message Access Protocol or IMAP is one of the two most prevalent Internet standard protocols for e-mail retrieval, the other being Post Office Protocol....
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
TELNET

Telnet is a network protocol used on the Internet or Local Area Network connections. It was developed in 1969 beginning with RFC 15 and standardized as Internet Engineering Task Force STD 8, one of the first Internet standards....
 or FTP servers respond to a NOOP command with "OK" or "+OK", some programmers have added quirky responses to the client. For example, the ftpd daemon of MINIX
Minix

MINIX is a Unix-like computer operating system based on a microkernel Software architecture. Andrew S. Tanenbaum wrote the operating system to be used for educational purposes; MINIX also inspired the creation of the Linux kernel....
 responds to NOOP with a message: 200
List of FTP server return codes

Below is a list of all return codes that may be issued by an File Transfer Protocol Server .See also List of FTP commands...
 NOOP to you too!

Cracking

NOPs are often involved when cracking
Software cracking

Software cracking is the modification of software to remove protection methods: copy protection, trial/demo version, serial number, hardware key, date checks, No-CD crack or software annoyances like nag screens and adware....
 software that checks for serial numbers, specific hardware or software requirements, presence or absence of hardware dongle
Dongle

A dongle is a small piece of Computer hardware that connects to a computer. Electrically dongles mostly appear as two-interface security tokens with transient data flow that does not interfere with other dongle functions and a pull communication that reads security data from the dongle....
s, etc. This is accomplished by altering functions and subroutines
Subroutine

In computer science, a subroutine or subprogram is a portion of computer code within a larger computer program, which performs a specific task and is relatively independent of the remaining code....
 to by-pass security checks and instead simply return the expected value being checked for. Since most of the instructions in the security check routine will be unused, these would be replaced with NOPs.

See also

  • Computer architecture
    Computer architecture

    Computer architecture in computer engineering is the conceptual design and fundamental operational structure of a computer system. It is a blueprint and functional description of requirements and design implementations for the various parts of a computer, focusing largely on the way by which the central processing unit performs internally an...
  • HLT
    HLT

    In computer science and more specifically the x86 architecture, HLT is an assembly language instruction which halts the CPU until the next external interrupt is fired....
  • Instruction set
    Instruction set

    An instruction set is a list of all the instruction , and all their variations, that a processor can execute.Instructions include:* Arithmetic such as add and subtract...
  • x86
    X86 architecture

    The generic term x86 refers to the most commercially successful instruction set architecture in the history of personal computing. It derived from the model numbers, ending in "86", of the first few processor generations Backward compatibility with the original Intel 8086....
  • Identity function
    Identity function

    In mathematics, an identity function, also called identity map or identity transformation, is a function that always returns the same value that was used as its argument....
    , the functional programming
    Functional programming

    In computer science, functional programming is a programming paradigm that treats computation as the evaluation of function s and avoids program state and immutable object data....
     equivalent to NOOP
  • xyzzy
    Xyzzy

    Xyzzy is a magic word from the Colossal Cave Adventure computer game.In computing, the word is sometimes used as a metasyntactic variable or as a video game cheat code, the canonical "magic word"....
    , a command sometimes used instead of NOOP