Z80 16-bit IO port addresses

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












The Z80 indirect I/O instructions are a little quirky: the instructions with the standard mnemonic in r, (c) (where r is a stand-in for any of the normal registers) actually puts the register pair bc on the address bus, not just c as implied in the mnemonic, and likewise for out (c), r. This capability is rarely used, but there are some instances (e.g. the keyboards of the ZX81 and Spectrum use the upper byte to select a row to scan) where it was used to good effect.



Is this behaviour intentional, in order to allow the Z80 to expand beyond the 256 port limit of the 8080 -- in which case, is the reason it wasn't documented known? -- or is it a result of a bug in the processor implementation (presumably a microcode error that wasn't detected prior to release)?










share|improve this question

























    up vote
    1
    down vote

    favorite












    The Z80 indirect I/O instructions are a little quirky: the instructions with the standard mnemonic in r, (c) (where r is a stand-in for any of the normal registers) actually puts the register pair bc on the address bus, not just c as implied in the mnemonic, and likewise for out (c), r. This capability is rarely used, but there are some instances (e.g. the keyboards of the ZX81 and Spectrum use the upper byte to select a row to scan) where it was used to good effect.



    Is this behaviour intentional, in order to allow the Z80 to expand beyond the 256 port limit of the 8080 -- in which case, is the reason it wasn't documented known? -- or is it a result of a bug in the processor implementation (presumably a microcode error that wasn't detected prior to release)?










    share|improve this question























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      The Z80 indirect I/O instructions are a little quirky: the instructions with the standard mnemonic in r, (c) (where r is a stand-in for any of the normal registers) actually puts the register pair bc on the address bus, not just c as implied in the mnemonic, and likewise for out (c), r. This capability is rarely used, but there are some instances (e.g. the keyboards of the ZX81 and Spectrum use the upper byte to select a row to scan) where it was used to good effect.



      Is this behaviour intentional, in order to allow the Z80 to expand beyond the 256 port limit of the 8080 -- in which case, is the reason it wasn't documented known? -- or is it a result of a bug in the processor implementation (presumably a microcode error that wasn't detected prior to release)?










      share|improve this question













      The Z80 indirect I/O instructions are a little quirky: the instructions with the standard mnemonic in r, (c) (where r is a stand-in for any of the normal registers) actually puts the register pair bc on the address bus, not just c as implied in the mnemonic, and likewise for out (c), r. This capability is rarely used, but there are some instances (e.g. the keyboards of the ZX81 and Spectrum use the upper byte to select a row to scan) where it was used to good effect.



      Is this behaviour intentional, in order to allow the Z80 to expand beyond the 256 port limit of the 8080 -- in which case, is the reason it wasn't documented known? -- or is it a result of a bug in the processor implementation (presumably a microcode error that wasn't detected prior to release)?







      z80






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 4 hours ago









      Jules

      7,65312139




      7,65312139




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote













          Well, the Z-80 CPU documentation that I have, a Zilog Z-80 product spec, PS017801-0602, clearly shows the behavior you noted in your question.



          In addition, the traditional I/O instructions, such as:



          IN A,(n)


          show the address bus as n to A0 ~ A7 and A to A8 ~ A15



          Clearly this "feature" is documented. I suspect it was just not used much.






          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',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            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%2f7782%2fz80-16-bit-io-port-addresses%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            3
            down vote













            Well, the Z-80 CPU documentation that I have, a Zilog Z-80 product spec, PS017801-0602, clearly shows the behavior you noted in your question.



            In addition, the traditional I/O instructions, such as:



            IN A,(n)


            show the address bus as n to A0 ~ A7 and A to A8 ~ A15



            Clearly this "feature" is documented. I suspect it was just not used much.






            share|improve this answer
























              up vote
              3
              down vote













              Well, the Z-80 CPU documentation that I have, a Zilog Z-80 product spec, PS017801-0602, clearly shows the behavior you noted in your question.



              In addition, the traditional I/O instructions, such as:



              IN A,(n)


              show the address bus as n to A0 ~ A7 and A to A8 ~ A15



              Clearly this "feature" is documented. I suspect it was just not used much.






              share|improve this answer






















                up vote
                3
                down vote










                up vote
                3
                down vote









                Well, the Z-80 CPU documentation that I have, a Zilog Z-80 product spec, PS017801-0602, clearly shows the behavior you noted in your question.



                In addition, the traditional I/O instructions, such as:



                IN A,(n)


                show the address bus as n to A0 ~ A7 and A to A8 ~ A15



                Clearly this "feature" is documented. I suspect it was just not used much.






                share|improve this answer












                Well, the Z-80 CPU documentation that I have, a Zilog Z-80 product spec, PS017801-0602, clearly shows the behavior you noted in your question.



                In addition, the traditional I/O instructions, such as:



                IN A,(n)


                show the address bus as n to A0 ~ A7 and A to A8 ~ A15



                Clearly this "feature" is documented. I suspect it was just not used much.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 1 hour ago









                Peter Camilleri

                57628




                57628



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f7782%2fz80-16-bit-io-port-addresses%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    Long meetings (6-7 hours a day): Being “babysat” by supervisor

                    Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

                    Confectionery