I'm working on an embedded controller, but my code space is limited.

I have an Interrupt Routine that does a multitude of things, like increment software timers and set I/O states. It does these things based on a 4 bit variable.

I have written a 15 state Case procedure to perform all these operations, but since many operations are duplicated, it is using excessive code space.

Would I be better off using a nested If...else and parse the 4 bits? I am also concerned about execution time.

Any other suggestions on how to accomplish this so it runs fast with the least code are welcome.