1. Assuming a single thread (non-OS) program with no interrupt. I understand that User Stack is used when function is called - the stack is used to store return address, input parameters, return values, local variables, etc.
2. In a single thread (non-OS) program with interrupts, how is the Interrupt Stack used? When interrupt happens, hardware pushes some CPU registers onto Interrupt Stack, and software (compiler) should push the remaining registers onto Interrupt Stack. Is this correct?
3. What happen to callback function of the interrupt? Are the callback function's return address, input parameters, return values, local variables pushed onto User Stack or Interrupt Stack?
In reply to FrankL:
In reply to swoo.quek:
swoo.quekBut why would anyone want to use both User Stack and Interrupt Stack?
Generally useless in a non-OS program. When using an OS, it's valuable to separate the stacks used by the system (OS) and userland tasks.