c - How does software recognize an interrupt has occured? -


as know write embedded c programming, task management, memory management, isr, file system , all.
know if task or process running , @ same time interrupt occurred, how sw or process or system comes know that, interrupt has occurred? , pauses current task execution , starts serving isr.

suppose if write below code like;

// dummy code void main() {     for(;;)         printf("\n forever"); }  // dummy code isr understanding void isr() {     printf("\n interrupt occurred");  } 

in above code if external interrupt(isr) occurs, how main() comes know interrupt occurred? start serving isr first?

your query: understood answer. wanted know when interrupt occurs how current task execution gets stopped/paused , isr starts executing?

well rashmi answer query read below,

when microcontroller detects interrupt, stops exucution of program after executing current instruction. pushes pc(program counter) on stack , loads pc vector location of inerrupt hence, program flow directed interrrupt service routine. on completion of isr microcontroller again pops stored program counter stack , loads on pc hence, program execution again resumes next location stopped. replied query?


Comments

Popular posts from this blog

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

java - stack overflow exception on xml transformation -