Software Stack Facilitate Interrupt Handling. Soft interrupt handlers run in interrupt context and therefore can be used to do many of the tasks that belong to an interrupt handler. After every instruction cycle the processor will check for interrupts to be processed if there is no interrupt is present in the system it will go for the next instruction cycle which is given by the instruction register.
The Interrupt Service Routines ISR also called as interrupt handlers are also code which the operating system uses to attend to software or hardware interrupts. The interrupt handling in the Cortex -M Processor is vectored which means the processors hardware automatically determines which interrupt or exception to service. Interrupt handlers are initiated by hardware interrupts software interrupt instructions or software exceptions and are used for implementing device drivers or transitions between protected modes of operation such as system calls.
If you dont when you return to the code that was interrupted the registers will have changed and that code may not work.
Joseph Yiu in The Definitive Guide to Arm Cortex-M0 and Cortex-M0 Processors Second Edition 2015. After receiving an IRQ of exception event the processor will need to decide whether to accept the. The first thing you need to do in the interrupt handler the code you branch to at address 0x18 is preserve the shared not banked registers on the stack so that you dont mess them up. The traditional form of interrupt handler is the hardware interrupt handler.