码迷,mamicode.com
首页 > 其他好文 > 详细

cpu中断机制

时间:2019-01-27 16:24:01      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:tin   cpu   returns   currently   inter   中断   byte   ati   tar   

When an interrupt gets active, the microcontroller goes through the following steps ?

  • The microcontroller closes the currently executing instruction and saves the address of the next instruction (PC) on the stack.

  • It also saves the current status of all the interrupts internally (i.e., not on the stack).

  • It jumps to the memory location of the interrupt vector table that holds the address of the interrupts service routine.

  • The microcontroller gets the address of the ISR from the interrupt vector table and jumps to it. It starts to execute the interrupt service subroutine, which is RETI (return from interrupt).

  • Upon executing the RETI instruction, the microcontroller returns to the location where it was interrupted. First, it gets the program counter (PC) address from the stack by popping the top bytes of the stack into the PC. Then, it start to execute from that address.

cpu中断机制

标签:tin   cpu   returns   currently   inter   中断   byte   ati   tar   

原文地址:https://www.cnblogs.com/lnas01/p/10326409.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!