Overview and functions of NOP commands and roles of NOP commands

Source: Internet
Author: User
Tags bit set

Overview and functions of NOP commands and roles of NOP commands

/*************************************** ******************************
* Author: Samson
* Date: 08/03/2014
* Test platform:
* Linux ubuntu 3.2.0-58-generic-pae
* GNU bash, version 4.2.39
**************************************** ****************************/

In computer science, NOP or NOOP (No Operation or No Operation completed MED) is an assembly language instruction, a series of programming statements, or a command in the network transmission protocol that does not perform any valid operations.

NOP is used to execute a command with the same operations and effects;
NOP commands are usually used to control timing, force memory alignment, prevent pipeline disasters, occupy branch instruction delay), or serve as placeholders for Program Improvement (or replace removed commands ).

The simplest NOP block in C is called an empty statement. It only contains a semicolon.
;

However, if such a semicolon is compiled as a NOP command, it is necessary to determine how the compiler compiles the statement. It may be optimized, not necessarily, they can match the correct number;

NOP is usually used to crack software, such as checking serial numbers, specific hardware or software requirements, and dongle software. This is achieved by changing functions and/or subprograms to skip the security check and directly returning the expected detection value. Since the commands in most security check subroutines are discarded, they are replaced by NOP. That is, replace the original code for the check with the NOP command.


What is the role of the NOP command?

A nop is a command cycle, mainly used for precise timing or delay.

The role of the nop command:
1) Fill in the nop command (one byte of the nop command) to align the command by word, thus reducing the number of memory access times when the command is executed. (It is generally used for the even alignment of memory addresses. For example, if a command occupies 3 bytes, the cpu can read the command from the fourth byte using the nop command .)
2) The nop command produces a certain delay, but the effect is not obvious for the fast CPU. You can use the rep prefix to delay several more clocks; --> it should be said that three clock pulses are occupied!
3) nop will also be used during I/o transmission, waiting for the buffer to be cleared and bus recovery;
4) Clear the flag bit set by the last Arithmetic Logic command;
5) cracking: Use nop to fill the verification part in the original program to invalidate the verification;
6) one of my friends said it was amazing-preventing programs from jumping in the space shuttle control program!

This article is from the CSDN blog. For more information, see blog.csdn.net/...1.aspx.

What is the NOP command? What can be done?

NOP is an empty statement! Nothing is executed, but it takes up the execution time of a command, that is, precise latency.

This is easier to control than the latency program of.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.