How does the Z80 determine which peripheral sent an interrupt?Why does the Z80 have a half-carry bit?How fast is memcpy on the Z80?How can a C64 interrupt let the KERNAL keep operating?Which Z80 opcodes can I use without a stack?Why does the Z80 include the RLD and RRD instructions?Intel 8080 and Altair 8800. 256 I/0 ports, but only 7 free RST (interrupt subroutine) - how it works?Is it possible to switch the interrupt source of the C64 to VIC without changing the IRQ routine?Why do we need to acknowledge the interrupt from VIC-II?How do I Interface a PS/2 Keyboard without Modern Techniques?Where does the Z80 processor start executing from?

Is domain driven design an anti-SQL pattern?

Could Giant Ground Sloths have been a good pack animal for the ancient Mayans?

aging parents with no investments

Does it makes sense to buy a new cycle to learn riding?

Does the average primeness of natural numbers tend to zero?

What does 'script /dev/null' do?

New order #4: World

Does a dangling wire really electrocute me if I'm standing in water?

I’m planning on buying a laser printer but concerned about the life cycle of toner in the machine

If a centaur druid Wild Shapes into a Giant Elk, do their Charge features stack?

Shall I use personal or official e-mail account when registering to external websites for work purpose?

What are the advantages and disadvantages of running one shots compared to campaigns?

Is ipsum/ipsa/ipse a third person pronoun, or can it serve other functions?

LWC and complex parameters

Was there ever an axiom rendered a theorem?

Symmetry in quantum mechanics

Pristine Bit Checking

How to manage monthly salary

Patience, young "Padovan"

Can a planet have a different gravitational pull depending on its location in orbit around its sun?

How can I add custom success page

Copycat chess is back

What does "enim et" mean?

What do the Banks children have against barley water?



How does the Z80 determine which peripheral sent an interrupt?


Why does the Z80 have a half-carry bit?How fast is memcpy on the Z80?How can a C64 interrupt let the KERNAL keep operating?Which Z80 opcodes can I use without a stack?Why does the Z80 include the RLD and RRD instructions?Intel 8080 and Altair 8800. 256 I/0 ports, but only 7 free RST (interrupt subroutine) - how it works?Is it possible to switch the interrupt source of the C64 to VIC without changing the IRQ routine?Why do we need to acknowledge the interrupt from VIC-II?How do I Interface a PS/2 Keyboard without Modern Techniques?Where does the Z80 processor start executing from?













4















My understanding of how interrupts (and more specifically, interrupt daisy-chaining) works in the Z80 is limited, to say the least, so if I get anything wrong please correct me.



Anyway, let's say I have 2 PIO chips to control 2 different peripherals (lets say, a character LCD display, and some switches, but I'm sure that's not very relevant). I've connected the IEO pin of one PIO to the CPU's INT pin, and it's IEI pin to the other PIO's IEO. I then connected that PIO's IEI pin to a 5V rail. I got this information from this image: (but instead of the three different peripheral chips they use, I just have two PIO chips.)



daisy
[from here]



Anyway, my understanding is that this kind of configuration means that if the second PIO (the one directly connected to the 5V rail) pulls its IEO pin low, the other PIO will not be able to send an interrupt. Correct?



My issue is this: How would I cause a PIO chip's IEO pin to go low? And how can I actually send an interrupt from one of these peripherals? My initial thought would be that I'd just pull the CPU's INT pin low, but that doesn't make sense the more I think about it.



(On a side note, any idea what the INTACK pin is on that diagram?)










share|improve this question




























    4















    My understanding of how interrupts (and more specifically, interrupt daisy-chaining) works in the Z80 is limited, to say the least, so if I get anything wrong please correct me.



    Anyway, let's say I have 2 PIO chips to control 2 different peripherals (lets say, a character LCD display, and some switches, but I'm sure that's not very relevant). I've connected the IEO pin of one PIO to the CPU's INT pin, and it's IEI pin to the other PIO's IEO. I then connected that PIO's IEI pin to a 5V rail. I got this information from this image: (but instead of the three different peripheral chips they use, I just have two PIO chips.)



    daisy
    [from here]



    Anyway, my understanding is that this kind of configuration means that if the second PIO (the one directly connected to the 5V rail) pulls its IEO pin low, the other PIO will not be able to send an interrupt. Correct?



    My issue is this: How would I cause a PIO chip's IEO pin to go low? And how can I actually send an interrupt from one of these peripherals? My initial thought would be that I'd just pull the CPU's INT pin low, but that doesn't make sense the more I think about it.



    (On a side note, any idea what the INTACK pin is on that diagram?)










    share|improve this question


























      4












      4








      4


      1






      My understanding of how interrupts (and more specifically, interrupt daisy-chaining) works in the Z80 is limited, to say the least, so if I get anything wrong please correct me.



      Anyway, let's say I have 2 PIO chips to control 2 different peripherals (lets say, a character LCD display, and some switches, but I'm sure that's not very relevant). I've connected the IEO pin of one PIO to the CPU's INT pin, and it's IEI pin to the other PIO's IEO. I then connected that PIO's IEI pin to a 5V rail. I got this information from this image: (but instead of the three different peripheral chips they use, I just have two PIO chips.)



      daisy
      [from here]



      Anyway, my understanding is that this kind of configuration means that if the second PIO (the one directly connected to the 5V rail) pulls its IEO pin low, the other PIO will not be able to send an interrupt. Correct?



      My issue is this: How would I cause a PIO chip's IEO pin to go low? And how can I actually send an interrupt from one of these peripherals? My initial thought would be that I'd just pull the CPU's INT pin low, but that doesn't make sense the more I think about it.



      (On a side note, any idea what the INTACK pin is on that diagram?)










      share|improve this question
















      My understanding of how interrupts (and more specifically, interrupt daisy-chaining) works in the Z80 is limited, to say the least, so if I get anything wrong please correct me.



      Anyway, let's say I have 2 PIO chips to control 2 different peripherals (lets say, a character LCD display, and some switches, but I'm sure that's not very relevant). I've connected the IEO pin of one PIO to the CPU's INT pin, and it's IEI pin to the other PIO's IEO. I then connected that PIO's IEI pin to a 5V rail. I got this information from this image: (but instead of the three different peripheral chips they use, I just have two PIO chips.)



      daisy
      [from here]



      Anyway, my understanding is that this kind of configuration means that if the second PIO (the one directly connected to the 5V rail) pulls its IEO pin low, the other PIO will not be able to send an interrupt. Correct?



      My issue is this: How would I cause a PIO chip's IEO pin to go low? And how can I actually send an interrupt from one of these peripherals? My initial thought would be that I'd just pull the CPU's INT pin low, but that doesn't make sense the more I think about it.



      (On a side note, any idea what the INTACK pin is on that diagram?)







      z80 interrupt






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 29 at 23:14







      Jacob Garby

















      asked Mar 29 at 23:05









      Jacob GarbyJacob Garby

      2356




      2356




















          2 Answers
          2






          active

          oldest

          votes


















          6














          You might want to consult the chapter for 'Interrupt Response' of the CPU manual (Chapter 8 on p.55 of the 1976 issue) and 'Interrupt Servicing' from the PIO manual (Chapter 6 on p.15 of the 1977 issue).



          In general the Z80 supports 3 different interrupt modes:



          • Mode 0 - like 8080, here the interrupting device must place an instrution on the bus - usually done by a 8259 interrupt controller.


          • Mode 1 - All interrupts will jump to 38h (restart) and execute from there. Much like NMI


          • Mode 2 - Peripherals put an interrupt service number on the bus during interrupt response, the CPU uses for an indirect call thru a table of pointers in a 256 byte page pointed to by the I register.


          The picture inserted hints that you intend to use Z80s Mode 2. To make it work:



          • Write some service routine for your interrupt, ending in an RETI

          • Disable interrupts

          • Setup a vector table in a memory page (256 byte boundry)

          • Pick any vector number you like (lets say 3)

          • Put the address of your service routing to that vector (xx06/xx07)

          • Put the vector number into the PIO channels vector register (control word with 2^0 set)

          • Set the Interrupt control word (x7) for the port to define which bits and under wich configuration will trigger an interrupt. For example 97h FFh sent to Port A will make all inputs issue interrupts as soon as they go high.

          • Set interrupt Mmode 2 of the CPU

          • Enable interrupts

          • Enjoy whatever happens :))

          A Z80 in Mode 2 is perfect suited for an interrupt driven system.




          How would I cause a PIO chip's IEO pin to go low?




          Err ... by waiting for an interrupt to occur, then serving it?



          (Maybe I do not really understand what part of information is missing).






          share|improve this answer























          • Okay, thanks! That cleared a lot of things up for me. I don't know if I'm being stupid, but one thing I don't understand is exactly how I would create an interrupt from the PIO -- I mean, how can I interrupt the CPU when a button is pressed, for example?

            – Jacob Garby
            Mar 30 at 0:25











          • @Jacob, do you mean, how do you configure the PIO to generate an interrupt? If I'm reading this correctly, you use the interrupt control word. If the PIO is in input mode then it looks like all you have to do is set the interrupt enable bit and every byte of data that arrives will generate an interrupt.

            – Harry Johnston
            Mar 30 at 6:49











          • @JacobGarbyIt's the above interrupt control word(s) of 97h FFh. First byte defined the workings. abcd0111 means interrupt control word, where a enables interrupt (1=enable); b defines if all or any port bit have to be set/reset (0=any); c if tested for set or reset (0=set) and d tells that a mask for the bits follows. A mask of FFh lets thus the interrupt fire if any of the port lines goes high. For a button it may be more appropriate to take one pin, pull it via a resistor high and ahave the button pull it low. Words to make only pin 2^0 sensitive would be 93h 01h

            – Raffzahn
            Mar 30 at 7:53


















          2














          The short answer is that Z80 do NOT determine itself which peripheral sends an interrupt. In Zilog's framework, all compatible peripherals determine among themselves who's emitting the interrupt to the CPU this time. Or more specifically, who is sending IM2 vector on the bus during the time Z80 acknowledges the interrupt.



          This kind of controlling prioritization of interrupts allows one building Z80 system not to use additional dedicated interrupt controller, as i8080 system designer had to do. However, the drawbacks are:



          • extra pins every Z80-world compatible peripheral has to have.

          • extra intelligence every such a peripheral has to have: particularly, they have to understand specific Z80 command (that is, RETI), whose the only purpose is to say to the peripherals the interrupt routine ends; otherwise RETI is fully equivalent to RET.

          • probably the very long interrupt chains could have timing problems.





          share|improve this answer























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "648"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            noCode: true, onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f9475%2fhow-does-the-z80-determine-which-peripheral-sent-an-interrupt%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            6














            You might want to consult the chapter for 'Interrupt Response' of the CPU manual (Chapter 8 on p.55 of the 1976 issue) and 'Interrupt Servicing' from the PIO manual (Chapter 6 on p.15 of the 1977 issue).



            In general the Z80 supports 3 different interrupt modes:



            • Mode 0 - like 8080, here the interrupting device must place an instrution on the bus - usually done by a 8259 interrupt controller.


            • Mode 1 - All interrupts will jump to 38h (restart) and execute from there. Much like NMI


            • Mode 2 - Peripherals put an interrupt service number on the bus during interrupt response, the CPU uses for an indirect call thru a table of pointers in a 256 byte page pointed to by the I register.


            The picture inserted hints that you intend to use Z80s Mode 2. To make it work:



            • Write some service routine for your interrupt, ending in an RETI

            • Disable interrupts

            • Setup a vector table in a memory page (256 byte boundry)

            • Pick any vector number you like (lets say 3)

            • Put the address of your service routing to that vector (xx06/xx07)

            • Put the vector number into the PIO channels vector register (control word with 2^0 set)

            • Set the Interrupt control word (x7) for the port to define which bits and under wich configuration will trigger an interrupt. For example 97h FFh sent to Port A will make all inputs issue interrupts as soon as they go high.

            • Set interrupt Mmode 2 of the CPU

            • Enable interrupts

            • Enjoy whatever happens :))

            A Z80 in Mode 2 is perfect suited for an interrupt driven system.




            How would I cause a PIO chip's IEO pin to go low?




            Err ... by waiting for an interrupt to occur, then serving it?



            (Maybe I do not really understand what part of information is missing).






            share|improve this answer























            • Okay, thanks! That cleared a lot of things up for me. I don't know if I'm being stupid, but one thing I don't understand is exactly how I would create an interrupt from the PIO -- I mean, how can I interrupt the CPU when a button is pressed, for example?

              – Jacob Garby
              Mar 30 at 0:25











            • @Jacob, do you mean, how do you configure the PIO to generate an interrupt? If I'm reading this correctly, you use the interrupt control word. If the PIO is in input mode then it looks like all you have to do is set the interrupt enable bit and every byte of data that arrives will generate an interrupt.

              – Harry Johnston
              Mar 30 at 6:49











            • @JacobGarbyIt's the above interrupt control word(s) of 97h FFh. First byte defined the workings. abcd0111 means interrupt control word, where a enables interrupt (1=enable); b defines if all or any port bit have to be set/reset (0=any); c if tested for set or reset (0=set) and d tells that a mask for the bits follows. A mask of FFh lets thus the interrupt fire if any of the port lines goes high. For a button it may be more appropriate to take one pin, pull it via a resistor high and ahave the button pull it low. Words to make only pin 2^0 sensitive would be 93h 01h

              – Raffzahn
              Mar 30 at 7:53















            6














            You might want to consult the chapter for 'Interrupt Response' of the CPU manual (Chapter 8 on p.55 of the 1976 issue) and 'Interrupt Servicing' from the PIO manual (Chapter 6 on p.15 of the 1977 issue).



            In general the Z80 supports 3 different interrupt modes:



            • Mode 0 - like 8080, here the interrupting device must place an instrution on the bus - usually done by a 8259 interrupt controller.


            • Mode 1 - All interrupts will jump to 38h (restart) and execute from there. Much like NMI


            • Mode 2 - Peripherals put an interrupt service number on the bus during interrupt response, the CPU uses for an indirect call thru a table of pointers in a 256 byte page pointed to by the I register.


            The picture inserted hints that you intend to use Z80s Mode 2. To make it work:



            • Write some service routine for your interrupt, ending in an RETI

            • Disable interrupts

            • Setup a vector table in a memory page (256 byte boundry)

            • Pick any vector number you like (lets say 3)

            • Put the address of your service routing to that vector (xx06/xx07)

            • Put the vector number into the PIO channels vector register (control word with 2^0 set)

            • Set the Interrupt control word (x7) for the port to define which bits and under wich configuration will trigger an interrupt. For example 97h FFh sent to Port A will make all inputs issue interrupts as soon as they go high.

            • Set interrupt Mmode 2 of the CPU

            • Enable interrupts

            • Enjoy whatever happens :))

            A Z80 in Mode 2 is perfect suited for an interrupt driven system.




            How would I cause a PIO chip's IEO pin to go low?




            Err ... by waiting for an interrupt to occur, then serving it?



            (Maybe I do not really understand what part of information is missing).






            share|improve this answer























            • Okay, thanks! That cleared a lot of things up for me. I don't know if I'm being stupid, but one thing I don't understand is exactly how I would create an interrupt from the PIO -- I mean, how can I interrupt the CPU when a button is pressed, for example?

              – Jacob Garby
              Mar 30 at 0:25











            • @Jacob, do you mean, how do you configure the PIO to generate an interrupt? If I'm reading this correctly, you use the interrupt control word. If the PIO is in input mode then it looks like all you have to do is set the interrupt enable bit and every byte of data that arrives will generate an interrupt.

              – Harry Johnston
              Mar 30 at 6:49











            • @JacobGarbyIt's the above interrupt control word(s) of 97h FFh. First byte defined the workings. abcd0111 means interrupt control word, where a enables interrupt (1=enable); b defines if all or any port bit have to be set/reset (0=any); c if tested for set or reset (0=set) and d tells that a mask for the bits follows. A mask of FFh lets thus the interrupt fire if any of the port lines goes high. For a button it may be more appropriate to take one pin, pull it via a resistor high and ahave the button pull it low. Words to make only pin 2^0 sensitive would be 93h 01h

              – Raffzahn
              Mar 30 at 7:53













            6












            6








            6







            You might want to consult the chapter for 'Interrupt Response' of the CPU manual (Chapter 8 on p.55 of the 1976 issue) and 'Interrupt Servicing' from the PIO manual (Chapter 6 on p.15 of the 1977 issue).



            In general the Z80 supports 3 different interrupt modes:



            • Mode 0 - like 8080, here the interrupting device must place an instrution on the bus - usually done by a 8259 interrupt controller.


            • Mode 1 - All interrupts will jump to 38h (restart) and execute from there. Much like NMI


            • Mode 2 - Peripherals put an interrupt service number on the bus during interrupt response, the CPU uses for an indirect call thru a table of pointers in a 256 byte page pointed to by the I register.


            The picture inserted hints that you intend to use Z80s Mode 2. To make it work:



            • Write some service routine for your interrupt, ending in an RETI

            • Disable interrupts

            • Setup a vector table in a memory page (256 byte boundry)

            • Pick any vector number you like (lets say 3)

            • Put the address of your service routing to that vector (xx06/xx07)

            • Put the vector number into the PIO channels vector register (control word with 2^0 set)

            • Set the Interrupt control word (x7) for the port to define which bits and under wich configuration will trigger an interrupt. For example 97h FFh sent to Port A will make all inputs issue interrupts as soon as they go high.

            • Set interrupt Mmode 2 of the CPU

            • Enable interrupts

            • Enjoy whatever happens :))

            A Z80 in Mode 2 is perfect suited for an interrupt driven system.




            How would I cause a PIO chip's IEO pin to go low?




            Err ... by waiting for an interrupt to occur, then serving it?



            (Maybe I do not really understand what part of information is missing).






            share|improve this answer













            You might want to consult the chapter for 'Interrupt Response' of the CPU manual (Chapter 8 on p.55 of the 1976 issue) and 'Interrupt Servicing' from the PIO manual (Chapter 6 on p.15 of the 1977 issue).



            In general the Z80 supports 3 different interrupt modes:



            • Mode 0 - like 8080, here the interrupting device must place an instrution on the bus - usually done by a 8259 interrupt controller.


            • Mode 1 - All interrupts will jump to 38h (restart) and execute from there. Much like NMI


            • Mode 2 - Peripherals put an interrupt service number on the bus during interrupt response, the CPU uses for an indirect call thru a table of pointers in a 256 byte page pointed to by the I register.


            The picture inserted hints that you intend to use Z80s Mode 2. To make it work:



            • Write some service routine for your interrupt, ending in an RETI

            • Disable interrupts

            • Setup a vector table in a memory page (256 byte boundry)

            • Pick any vector number you like (lets say 3)

            • Put the address of your service routing to that vector (xx06/xx07)

            • Put the vector number into the PIO channels vector register (control word with 2^0 set)

            • Set the Interrupt control word (x7) for the port to define which bits and under wich configuration will trigger an interrupt. For example 97h FFh sent to Port A will make all inputs issue interrupts as soon as they go high.

            • Set interrupt Mmode 2 of the CPU

            • Enable interrupts

            • Enjoy whatever happens :))

            A Z80 in Mode 2 is perfect suited for an interrupt driven system.




            How would I cause a PIO chip's IEO pin to go low?




            Err ... by waiting for an interrupt to occur, then serving it?



            (Maybe I do not really understand what part of information is missing).







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 30 at 0:00









            RaffzahnRaffzahn

            55.7k6136225




            55.7k6136225












            • Okay, thanks! That cleared a lot of things up for me. I don't know if I'm being stupid, but one thing I don't understand is exactly how I would create an interrupt from the PIO -- I mean, how can I interrupt the CPU when a button is pressed, for example?

              – Jacob Garby
              Mar 30 at 0:25











            • @Jacob, do you mean, how do you configure the PIO to generate an interrupt? If I'm reading this correctly, you use the interrupt control word. If the PIO is in input mode then it looks like all you have to do is set the interrupt enable bit and every byte of data that arrives will generate an interrupt.

              – Harry Johnston
              Mar 30 at 6:49











            • @JacobGarbyIt's the above interrupt control word(s) of 97h FFh. First byte defined the workings. abcd0111 means interrupt control word, where a enables interrupt (1=enable); b defines if all or any port bit have to be set/reset (0=any); c if tested for set or reset (0=set) and d tells that a mask for the bits follows. A mask of FFh lets thus the interrupt fire if any of the port lines goes high. For a button it may be more appropriate to take one pin, pull it via a resistor high and ahave the button pull it low. Words to make only pin 2^0 sensitive would be 93h 01h

              – Raffzahn
              Mar 30 at 7:53

















            • Okay, thanks! That cleared a lot of things up for me. I don't know if I'm being stupid, but one thing I don't understand is exactly how I would create an interrupt from the PIO -- I mean, how can I interrupt the CPU when a button is pressed, for example?

              – Jacob Garby
              Mar 30 at 0:25











            • @Jacob, do you mean, how do you configure the PIO to generate an interrupt? If I'm reading this correctly, you use the interrupt control word. If the PIO is in input mode then it looks like all you have to do is set the interrupt enable bit and every byte of data that arrives will generate an interrupt.

              – Harry Johnston
              Mar 30 at 6:49











            • @JacobGarbyIt's the above interrupt control word(s) of 97h FFh. First byte defined the workings. abcd0111 means interrupt control word, where a enables interrupt (1=enable); b defines if all or any port bit have to be set/reset (0=any); c if tested for set or reset (0=set) and d tells that a mask for the bits follows. A mask of FFh lets thus the interrupt fire if any of the port lines goes high. For a button it may be more appropriate to take one pin, pull it via a resistor high and ahave the button pull it low. Words to make only pin 2^0 sensitive would be 93h 01h

              – Raffzahn
              Mar 30 at 7:53
















            Okay, thanks! That cleared a lot of things up for me. I don't know if I'm being stupid, but one thing I don't understand is exactly how I would create an interrupt from the PIO -- I mean, how can I interrupt the CPU when a button is pressed, for example?

            – Jacob Garby
            Mar 30 at 0:25





            Okay, thanks! That cleared a lot of things up for me. I don't know if I'm being stupid, but one thing I don't understand is exactly how I would create an interrupt from the PIO -- I mean, how can I interrupt the CPU when a button is pressed, for example?

            – Jacob Garby
            Mar 30 at 0:25













            @Jacob, do you mean, how do you configure the PIO to generate an interrupt? If I'm reading this correctly, you use the interrupt control word. If the PIO is in input mode then it looks like all you have to do is set the interrupt enable bit and every byte of data that arrives will generate an interrupt.

            – Harry Johnston
            Mar 30 at 6:49





            @Jacob, do you mean, how do you configure the PIO to generate an interrupt? If I'm reading this correctly, you use the interrupt control word. If the PIO is in input mode then it looks like all you have to do is set the interrupt enable bit and every byte of data that arrives will generate an interrupt.

            – Harry Johnston
            Mar 30 at 6:49













            @JacobGarbyIt's the above interrupt control word(s) of 97h FFh. First byte defined the workings. abcd0111 means interrupt control word, where a enables interrupt (1=enable); b defines if all or any port bit have to be set/reset (0=any); c if tested for set or reset (0=set) and d tells that a mask for the bits follows. A mask of FFh lets thus the interrupt fire if any of the port lines goes high. For a button it may be more appropriate to take one pin, pull it via a resistor high and ahave the button pull it low. Words to make only pin 2^0 sensitive would be 93h 01h

            – Raffzahn
            Mar 30 at 7:53





            @JacobGarbyIt's the above interrupt control word(s) of 97h FFh. First byte defined the workings. abcd0111 means interrupt control word, where a enables interrupt (1=enable); b defines if all or any port bit have to be set/reset (0=any); c if tested for set or reset (0=set) and d tells that a mask for the bits follows. A mask of FFh lets thus the interrupt fire if any of the port lines goes high. For a button it may be more appropriate to take one pin, pull it via a resistor high and ahave the button pull it low. Words to make only pin 2^0 sensitive would be 93h 01h

            – Raffzahn
            Mar 30 at 7:53











            2














            The short answer is that Z80 do NOT determine itself which peripheral sends an interrupt. In Zilog's framework, all compatible peripherals determine among themselves who's emitting the interrupt to the CPU this time. Or more specifically, who is sending IM2 vector on the bus during the time Z80 acknowledges the interrupt.



            This kind of controlling prioritization of interrupts allows one building Z80 system not to use additional dedicated interrupt controller, as i8080 system designer had to do. However, the drawbacks are:



            • extra pins every Z80-world compatible peripheral has to have.

            • extra intelligence every such a peripheral has to have: particularly, they have to understand specific Z80 command (that is, RETI), whose the only purpose is to say to the peripherals the interrupt routine ends; otherwise RETI is fully equivalent to RET.

            • probably the very long interrupt chains could have timing problems.





            share|improve this answer



























              2














              The short answer is that Z80 do NOT determine itself which peripheral sends an interrupt. In Zilog's framework, all compatible peripherals determine among themselves who's emitting the interrupt to the CPU this time. Or more specifically, who is sending IM2 vector on the bus during the time Z80 acknowledges the interrupt.



              This kind of controlling prioritization of interrupts allows one building Z80 system not to use additional dedicated interrupt controller, as i8080 system designer had to do. However, the drawbacks are:



              • extra pins every Z80-world compatible peripheral has to have.

              • extra intelligence every such a peripheral has to have: particularly, they have to understand specific Z80 command (that is, RETI), whose the only purpose is to say to the peripherals the interrupt routine ends; otherwise RETI is fully equivalent to RET.

              • probably the very long interrupt chains could have timing problems.





              share|improve this answer

























                2












                2








                2







                The short answer is that Z80 do NOT determine itself which peripheral sends an interrupt. In Zilog's framework, all compatible peripherals determine among themselves who's emitting the interrupt to the CPU this time. Or more specifically, who is sending IM2 vector on the bus during the time Z80 acknowledges the interrupt.



                This kind of controlling prioritization of interrupts allows one building Z80 system not to use additional dedicated interrupt controller, as i8080 system designer had to do. However, the drawbacks are:



                • extra pins every Z80-world compatible peripheral has to have.

                • extra intelligence every such a peripheral has to have: particularly, they have to understand specific Z80 command (that is, RETI), whose the only purpose is to say to the peripherals the interrupt routine ends; otherwise RETI is fully equivalent to RET.

                • probably the very long interrupt chains could have timing problems.





                share|improve this answer













                The short answer is that Z80 do NOT determine itself which peripheral sends an interrupt. In Zilog's framework, all compatible peripherals determine among themselves who's emitting the interrupt to the CPU this time. Or more specifically, who is sending IM2 vector on the bus during the time Z80 acknowledges the interrupt.



                This kind of controlling prioritization of interrupts allows one building Z80 system not to use additional dedicated interrupt controller, as i8080 system designer had to do. However, the drawbacks are:



                • extra pins every Z80-world compatible peripheral has to have.

                • extra intelligence every such a peripheral has to have: particularly, they have to understand specific Z80 command (that is, RETI), whose the only purpose is to say to the peripherals the interrupt routine ends; otherwise RETI is fully equivalent to RET.

                • probably the very long interrupt chains could have timing problems.






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 30 at 21:37









                lvdlvd

                2,950721




                2,950721



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Retrocomputing Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f9475%2fhow-does-the-z80-determine-which-peripheral-sent-an-interrupt%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Triangular numbers and gcdProving sum of a set is $0 pmod n$ if $n$ is odd, or $fracn2 pmod n$ if $n$ is even?Is greatest common divisor of two numbers really their smallest linear combination?GCD, LCM RelationshipProve a set of nonnegative integers with greatest common divisor 1 and closed under addition has all but finite many nonnegative integers.all pairs of a and b in an equation containing gcdTriangular Numbers Modulo $k$ - Hit All Values?Understanding the Existence and Uniqueness of the GCDGCD and LCM with logical symbolsThe greatest common divisor of two positive integers less than 100 is equal to 3. Their least common multiple is twelve times one of the integers.Suppose that for all integers $x$, $x|a$ and $x|b$ if and only if $x|c$. Then $c = gcd(a,b)$Which is the gcd of 2 numbers which are multiplied and the result is 600000?

                    Ingelân Ynhâld Etymology | Geografy | Skiednis | Polityk en bestjoer | Ekonomy | Demografy | Kultuer | Klimaat | Sjoch ek | Keppelings om utens | Boarnen, noaten en referinsjes Navigaasjemenuwww.gov.ukOffisjele webside fan it regear fan it Feriene KeninkrykOffisjele webside fan it Britske FerkearsburoNederlânsktalige ynformaasje fan it Britske FerkearsburoOffisjele webside fan English Heritage, de organisaasje dy't him ynset foar it behâld fan it Ingelske kultuergoedYnwennertallen fan alle Britske stêden út 'e folkstelling fan 2011Notes en References, op dizze sideEngland

                    Հադիս Բովանդակություն Անվանում և նշանակություն | Դասակարգում | Աղբյուրներ | Նավարկման ցանկ