Z80 Assembly 10: Interrupt Modes and Handling External Events
What is an Interrupt? An interrupt is an external signal from a hardware device (like a timer or keyboard controller) that tells the CPU to immediately stop what it’s doing and execute a specific routine to handle the event. This is how the system maintains responsiveness. The Two Key Commands: Instruction Action Purpose EI Enable Interrupts Allows the CPU to listen for and respond to external interrupt requests. DI Disable Interrupts Prevents the CPU from responding to external requests (used for critical code sections). The routine that handles the interrupt must end with RETI (Return from Interrupt) or RETN (Return from Non-Maskable Interrupt) instead of a simple RET. ...