As we know we write
task management, memory management, ISR, File system
task or process is running
how SW or process or system comes to know that, the interrupt has occurred?
starts serving ISR
// Dummy Code
// Dummy code for ISR for understanding
printf("\n Interrupt occurred");
external interrupt(ISR) occurs
your query: I understood your answer. But I wanted to know when Interrupt occurs how the current task execution gets stopped/paused and the ISR starts executing?
well Rashmi to answer your query read below,
when microcontroller detects interrupt, it stops exucution of the program after executing current instruction. Then it pushes PC(program counter) on to stack and loads PC with the vector location of that inerrupt hence, program flow is directed to interrrupt service routine. On completion of ISR the microcontroller again pops the stored program counter from stack and loads it on to PC hence, program execution again resumes from next location it was stopped. does that replied to your query?