No-op (No Operation) is a low level instruction provided in a Computer programming language that instructs the Computer to do nothing - typically for one tick of it's internal clock. Most often this instruction is found in Machine code rather than in high level languages.
This special instruction is occasionally useful for the following situations:
- When a section of a program is no longer needed or must be temporarily removed, it is possible to replace the instructions in that section with No-ops without disturbing the remainder of the program.
- If a very short delay is required in order that the computer wait for some external device to perform a task, there may be too little time to set up a proper clock to measure the required delay and executing a number of no-op instructions will suffice to create the delay.
Some computers do not have a special No-op instruction - programmers having to use some other instruction such as 'ADD' in a manner that has no effect on the state of the machine (eg by adding zero to a particular register location).