Search code examples
interruptintel-8080

How do interrupts work on the Intel 8080?


How do interrupts work on the Intel 8080? I have searched Google and in Intel's official documentation (197X), and I've found only a little description about this. I need a detailed explanation about it, to emulate this CPU.


Solution

  • I finally found it!

    I created a variable called bus where the interrupt opcode goes. Then, I called a function to handle the interrupt:

    void i8080::interrupt()
    {
        // only for RST
        cycles -= cycles_table[bus];
        instruction[bus]();
        INT = false;
    }
    

    INT is true when an interrupt needs to be handled. EI and DI are instructions that enable/disable INTE.

    When INT and INTE are true, the interrupt is executed.