Differences between hardware interruption, software interruption, and function call

Source: Internet
Author: User

Assembly Language Programming by Richard BLUM: 6.2.3 interrupted

 

There are two types of interruptions:

(1) Hardware interruption;

(2) software interruption.

 

Hardware Device generation hardware interruption.

An event occurs at the hardware layer by sending a signal with hardware interruption (for example, when an I/O port receives an input signal ).

 

Software Interruption During program generation.

They are signals that give control to another program.

 

When a program is interrupted, the called program is suspended and the called program takes over for running. The instruction pointer is transferred to the called program and continues to be executed from the called program. When the called program is completed, it can control the return to the called Program (using the interrupt return command ).

 

Software interruptions are provided by the operating system so that applications can use functions in the operating system and, in some cases, even access to the underlying BIOS system. In Microsoft DOS, 0x21 software interruption is provided for many functions. In Linux, 0x80 is used to provide low-level kernel functions.

 

 

Http://blog.sina.com.cn/s/blog_913c070a0100zse4.html

Interruption:

1) it may be unpredictable when something occurs. When the CPU is processing something, an external event (such as a level change, A pulse along the occurrence or timer overflow) requests the CPU to quickly process, so the CPU temporarily stops the current job and forwards it to the processing of the event. After the service interruption is handled, return to the place where the service was originally suspended to continue the original work.

2) for the deprived kernel, after the interruption scheduling is completed, the task is returned not to the original execution point immediately, but to the task with the highest priority in the ready state to start running.

3) No return value;

4) parameters cannot be passed.

 

Function:

1) when is it predictable;

2) After the function scheduling is completed, the original code snippet will be returned for further execution;

3) return value;

4) parameters can be passed.

 

Similarities:

1) the site is saved before scheduling;

2) call a Subcode.

Related Article

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.