internal interrrupt Flags

Even though we can tell the system “HEY! This handler handles this condition!”, there is a bit more specification we can do inside the handler - this is accomplished using Interrupt Flags. These Flags tell us specifically what caused the interrupt to happen in the first place, thus we can execute the correct code. 


For example, going back to the fire alarm expression - say the fire alarm was triggered by some arbitrary room. The Interrupt Handler would be triggered by the fire alarm, so the handler is the firemen responding. However, the firemen don’t know which room caused the fire alarm, and what the severity of the alarm is (did someone just forget to put water in their mac-and-cheese while cooking? Or is the room burning down?). Obviously we don’t want to start drenching the entire building with water before we even know what tripped the alarm. 

Say the firemen knew which room tripped the alarm - that would be a single Flag

Say the firemen then went to that room, and saw it was just mac-and-cheese being cooked without water - that would be a Flag


Now by knowing the ROOM and SEVERITY of the situation (the Flags), the firemen can approach the alarm with the correct method (execute the correct code). Again, we do not want to drench the entire building with water unless there is an actual fire, hence we would want different responses to different Flags. This can be accomplished inside of an Interrupt Handler using Flags as indicators for which section of code needs to be executed, depending on the conditions that caused the interrupt.