My program spends most of it's time in a loop waiting for an interrupt (button presses). Once received, I need to decode 24 buttons and execute the right commands.

My present interrupt handler has a SELECT CASE function in it, with a GOSUB in every case to execute the functions. Is this legit? What are the specifics and restrictions in an interrupt handler?