title: Context switching in function vs interrupt call?
body: <p>I understand the basic difference between function call &amp; interrupt (ISR) jump from below SE question.</p>
  
  <p><a href="https://stackoverflow.com/questions/17768026/difference-between-isr-and-function-call">difference between function call &amp; ISR</a></p>
  
  <p>But I am still not clear about, what are the registers will be pushed /pop to/from stack in both the cases? How context switching will happen in both the case? As we don't know when interrupt will occur, what we need to save (variables, PC, flags (PSW), registers, context) before entering into ISR? </p>
  
  <p>How can we resume back original context without any data lose with multiple thread environment. </p>