Getting to Know the Z80
The Z80 System
Standard Architecture
The Stack
Instructions and the PC
Internal Structure

So, you've got all the basics down. You think in binary, you speak in hexadecimal and you make love with binary math when the blinds are drawn. What's next? The following part of the tutorial is a detailed explanation of the Z80 CPU. Since it's going to be the longest one thus far, make sure you read it thoroughly if you're not familiar with anything. There will be a quiz at the end and since it's doubtful you'll finish in one sitting, I added a table of contents up there to jump ahead to where you left off when you come back. Keep in mind that you will not be doing any actual programming yet, just learning about how the Z80 works, which we'll apply later. If you have questions, just come back here to learn. The main idea is to explain how the Z80 works.

Now, there's absolutely no reason to get into the complete history of computers here. That's ridiculous. Though interesting, it's way beyond the scope of our goal; there's simply nothing about the Hollerith Machine (don't bother looking) or the like that's going to help you program for the Master System. Besides, most of us have heard a little about computing history, especially the usage of classic punchcards still used in some areas of business today surprisingly. Even though it's not entirely necessary, it will give you a sense of where things began and how we got to where we are.

Imagine using stacks upon stacks of these to get a computer to do problems and then dropping them on the floor after you organized them. I could only imagine. Regardless, these things are one of the steps towards the eventual computer revolution that we know today. Looking at the card, you can see how binary came into play. Each spot on that card above has only one of two possibilities, there can either be a hole punched in a location or there isn't, that's it. The good old 0s and 1s, yet again, off or on. Cards would be read by a huge mess of wires and buttons stretching several meters in a large room. Check this out:

Ha, wow, hard to believe that what you see there eventually became what you're reading this tutorial on. So that's where we get to the next little bit. All the wires you see up there are the electrical switches that provide pathways for binary code, which was being marked by cards or paper sheets. First you had vacuum tubes and then transistors to perform this function. One of the suck problems of it was that you needed the computer to often perform different functions and thus had to physically move around tubes and wires. The revolution came when it was discovered that by using tiny, silicon chips all those transistors and all that wiring could be condensed to an incredibly small amount of space and be mass-produced, whereas the mess of wires up there was largely put together by hand and cost a fortune. So, therefore, all of this garbage,

could be replaced by this little thing (notice its size in comparison to the pennies under it):

All of those transistors, resistors and so forth were condensed to that little space. Plus, it was a heck of a lot cheaper. So that got computers on the move with the help of the microprocessor. The microprocessor is the part of a computer, or in our case the Master System, that makes everything work, the brain, if you will. CPU can be used to mean the same thing, but you can also call them microprocessors. CPU is the more common term, so we'll stick with it. The first of these CPUs were used for calculators, until the early 1970s, when Intel came out with the 4004, and then a short time after this released the first 8-Bit microprocessor, the 8080. This led to microcomputers, which, easily enough, were called so because they were able to be made smaller thanks to these chips. After this, one of the creators of the 4004 left to start a company named Zilog.

No need to go into their history, suffice to say they were directly competing with Intel for microprocessor domination. Zilog designed their own 8-Bit chip around this time, roughly 1976, and it's the Z80. The Z80 had several features that made it a huge improvement over the 8080, but we don't need to understand them. Soon after its introduction on the market, the Z80 took control and became the CPU to use; dominant up through the mid-80s. The Z80 was used in tons of different devices including the legendary Commodore 64 and, of course, the Sega Master System.

So that's a little about the history of it, and though not complete, it's enough to get an idea of where things came from. Again, if you want to learn the history, go look around, because what I gave you above is all you really need to know before we get started. What we need to do at this point is understand what the Z80 is and how it functions. As mentioned earlier, you see above a table of contents so you can skip ahead if you're already familiar with certain issues of come back to where you left off. If this is your first time learning this stuff take your time please and move on to the next page, not the last.

Next Page
Copyright © 2021 Sega8bit. All Rights Reserved.
Contact Us