Processors and other machines.

Hi guys,

the title is probably open to interpretation, I couldn't think of a more apt title that was more descriptive and constrained to 4 words, but I digress...

The question; I'm reading the second edition of Charles Petzolds 'Code', It's a must read comp sci book in my humble opinion. The book takes us on a journey throughout the history of Computers, it delves into topics such as logic gates, basic electricity concepts, binary, hexadecimal, integrated circuits, half and full adders, encoders and decodes, frequency divers and other pertinent circuits. Charles describes in detail how to build these circuits from logic gates.

The goal of the book is to build a microprocessor, more specifically the intel 8080! By the later chapters, Charles begins to build a trickled down but nevertheless an impressive version of the Intel 8080. I'm almost finished the book and I can firmly say I have a better understanding of the inner workings of a processor, and other low level concepts such as latches, RAM, ASCII, Unicode, twos compliment and more.

I decided to do some independent research into the intel 8080, from what I found; it was pivotal in the home computing revolution, but not only that, the intel 8080 was used in other devices such as cash registers, arcade machines, calculators, etc.

I asked chatGPT as to why and how it's used in these machines, chatGPT just reaffirmed what I already knew, but did mention some interesting functions. It mentioned that the intel 8080 can be used for providing the printing functionalities of a cash register, used in medical devices to monitor patients vitals and other signals, used in arcade machines to control graphics and sound.

I can see how the processor can move data between registers and memory, memory to registers, registers to registers, ALU to registers, registers to ALU, etc. I can also see how the processor can perform arithmetic and logical operations on data, increment and decrement addresses, write data to memory, enable clock and enable signals, etc.

But I fail to see how a processor that carries out such primitive operations(although the circuitry is certainly anything but) can control printing operations of a cash register, how it can help and control the sound and graphics on retro arcade machines.

I would love if someone could give me a few examples of how the aforementioned tasks are performed above by the intel 8080, such as again, controlling printing functions, controlling sound and graphics on an arcade machine, even any links would be much appreciated. Don't worry too much about abstraction, the lower level the examples the better.

Thanks!
Last edited on
Take a search and read on the sure-pos cash registers from IBM. They had an operating system, crude screens, and were dumbed down computers that, if memory serves, were driven by the 8080 or at least its family. I think the line is still going and has something like dual core x86s now.

all a printer back then had to do was, instead of being a screen, do the same thing with ink and paper :)
Last edited on
adam2016 wrote:
But I fail to see how a processor that carries out such primitive operations(although the circuitry is certainly anything but) can control printing operations of a cash register, how it can help and control the sound and graphics on retro arcade machines.


But any computer with a basic instruction set could be engineered to do almost anything! Consider the RISC chips which IIRC only had about 40 instructions. They didn't have floating point, so that was all coded using those small number of instructions. Admittedly it would have been a real pain, but they got it done, and it worked well.

Also consider the primitive computers they had in the late 1960's, yet they sent a rocket to the moon.

I remember using XT and AT computers in the late 1980's which we used to run our CAD system and A1 plotter, albeit slowly ...
I can see how the processor can move data between registers and memory, memory to registers, registers to registers, ALU to registers, registers to ALU, etc. I can also see how the processor can perform arithmetic and logical operations on data, increment and decrement addresses, write data to memory, enable clock and enable signals, etc.

But I fail to see how a processor that carries out such primitive operations(although the circuitry is certainly anything but) can control printing operations of a cash register, how it can help and control the sound and graphics on retro arcade machines.

Maybe you should have a look at the Turing Machine:
https://en.wikipedia.org/wiki/Turing_machine

It is a very simple model of a computer, to abstract away all the gory details of a "real" computer. Still, as simple as it is, a Turing Machine can calculate everything that is calculable! Consequently, if a computer (processor) is at least able to "emulate" a Turing Machine – known as "Turing completeness" – it follows that this computer (processor) also is able to calculate everything that is calculable 😎

Spoiler: All modern processors (including the 8080) and programming languages are Turing complete.

Now, you may wonder how a simple Turing Machine (or a processor that can "emulate" a Turing Machine) is able to do "complex" tasks like controlling a cash register or generating sound and graphics. But this is really just a matter of the right program! Every program that you write, even in "high level" languages like C or C++, will be compiled to assembler instructions (machine code) before it can run on a processor. So, regardless of how "complex" your program is, it will end up as a sequence of thousands of simple machine instructions. That really is no different with a program that controls a cash register or that generates sound and graphics...

https://raw.githubusercontent.com/colbybanbury/assemblyPicture/master/Screenshot%20from%202017-10-14%2014-03-06.png

(You can set up your C/C++ compiler to output assembler code, if you are interested to see it)


Also note that the image that you see on your computer's screen is really nothing but color values (i.e. numbers) that are stored in a special memory region, the so-called "framebuffer". After all, outputting an image to the screen comes down to writing the correct color values to the appropriate memory addresses (within the framebuffer). This means that a processor does not require "special" capabilities to generate graphics; just basic arithmetic and load/store operations. Modern computers usually have a dedicated graphics card with its own dedicated graphics processor (GPU) and its own dedicated graphics memory. But, in principle, the CPU can do this just as well 😏

https://en.wikipedia.org/wiki/Framebuffer
Last edited on
Modern x86 machines are evolved from the 8080. In fact the machine language isn't all that different, if you ignore the additional instructions and greater operand sizes. Take a look at the disassembly of just about any program and you'll mostly a few instructions:
* Arithmetic instructions (add, sub, mul, div, inc, dec, lea, etc.)
* Data movement instructions (mov in all its variations, push, pop)
* Control flow instructions (jmp, j* [conditional jumps], call, ret)
* Flag-setting instructions (cmp, and, xor, etc.)
The only time something else is needed is when the program needs to interact with the outside world, and this is primarily where modern programs differ from those embedded programs. Where today a program will talk to the OS via a system call, an 8080 embedded program would have talked to the hardware directly by writing to special memory sections or by using special instructions (today something like this still happens, but it's done by the OS).

The point is, complex behavior can arise from very simple elementary operations, if the whole system is large enough.
But I fail to see how a processor that carries out such primitive operations(although the circuitry is certainly anything but) can control printing operations of a cash register, how it can help and control the sound and graphics on retro arcade machines.

Some of the earliest printers were dot-matrix printers. The print head would move across the page and circuits would fire causing pins to hit the ribbon and make a dot on the paper.

Many early printers had a parallel interface, meaning all 8 bits of data would be present on interface at the same time. You would write a byte of data to an I/O port. The I/O port would be connected to the parallel interface. The logic in the printer would take the 8 bits of data the interface and transform it into the correct firing pattern. After a character was printed, a stepping motor would move the print head one position to the right.
Some of the earliest printers were dot-matrix printers. The print head would move across the page and circuits would fire causing pins to hit the ribbon and make a dot on the paper.

Many early printers had a parallel interface

We had an electronic typewriter. (Late 80ies.) It had been modified to add a connector. A cable from Commodore C64 with a suitable program and bytes did convert to ink. Presumably we did inject same bits from computer as they keys on the typewriter did generate.
But I fail to see how a processor that carries out such primitive operations(although the circuitry is certainly anything but) can control printing operations of a cash register, how it can help and control the sound and graphics on retro arcade machines.
As I recall, the 8080 was pretty much the 8086, but used 8-bit memory, rather than 16-bit memory. The instruction sets are pretty much the same.

So if you can imagine DOS and all it can do running on an 8086, it should be obvious that an 8080 can do the same.
Topic archived. No new replies allowed.