What is an interrupt service routine (ISR), and what are the key constraints when writing code inside an ISR?