Minor evaluation interruptions, traps, and exceptions)

Source: Internet
Author: User

 

Minor evaluation interruptions, traps, and exceptions

 

Hedgehog @ http://blog.csdn.net/littlehedgehog

 

 

 

 

A good article I read a few days ago introduces interrupt, traps, and exception from another perspective ).

 

 

External interruption is what we call interrupt ). For the execution system, this interruption occurs completely"Asynchronous", There is no way to predict when such interruptions will occur. Therefore, the CPU (or software) for such external interruptions is completely"Passive. However, the software can close the response to the interruption in the form of Guanzhong disconnection, and cut off the way it "reflects the situation.

 

Software-generated interruptions are different. They are specialized commands, such as Intel x86 "int N ",InProgramIntentionally generated, so it is active, "Synchronous. As long as the CPU executes an int command, it knows that the service interruption program must be started before the next command is executed. This kind of active interruption is called a "trap ".

 

In addition, there is also a mechanism similar to the interrupt called "exception" (exception), which is generallyAsynchronousMost of the reasons are due to "carelessness. For example, when you issue a division command DIV in a program, an exception occurs when the divisor is zero. This is mostly due to carelessness rather than intention, so it is also passive. Of course, we can divide it by zero on purpose.

 

The most common difference between interruptions and exceptions is"Unpredictability", So it is forced, and there are traps"Intentionally. In fact, this kind of thing can be understood, just prepare an Intel manual when doing system programming.

 

 

 

 

 

 

 

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.