To explain how SYS/BIOS implements an interrupt service routine (ISR), it might be good to start with what an ISR looks like without SYS/BIOS. Typically, an interrupt handler is a C function that is tagged with the "interrupt" keyword. This function takes no arguments, and has a void return type. A #pragma is used to associate the function to the corresponding interrupt vector. When the interrupt source has been enabled and the interrupt asserted by the peripheral, the CPU is vectored to the ISR. Because of the interrupt keyword, the return instruction at the end of the function is actually a return from interrupt instruction instead of return from subroutine. Which will additionally restore the Status Register that was pushed onto the stack at the start of the ISR. On the MSP430 there are bits in this Status Register that control transitions to low power modes. Because these bits are restored as part of the return from interrupt, by default, the CPU will automatically return to the power mode in effect at the time the interrupt occurred.