Setting a register seems like a good solution for the majority of use cases for interrupts. It would be nice to also include the ability to increment or decrement the register (for counting Semaphores), or include a stream (buffer or queue) where you could drop in a value, say a keystroke or DAC reading to be read later, the register could be updated to indicate how many values are currently held in the stream. Really I’d like to be allowed to supply a lambda function or closure to make it more dynamic but I could see how that could get out of hand quickly.
I guess the interrupt could be handled by storing a value in a register, and then there could be an interrupt mask table that contains pointers to the lambda functions that will deal with that value at a later scheduled event in the main loop.