6502 vs 6510
Today I want to invite you on a trip inside the Commodore 64 and its chips where we are going to see in-depth details of assembly languages, internal connections and the operation of the integrated circuits that are part of the Commodore, which have made me lose my sleep since I was a child, and I believe that this add a lot to our technical knowledge.
Why the Commodore? Well, a little for love (a lot I mean ha) and also because I think it is one of the last computers in which we can understand in depth what is really happening inside when we run a program, play a game or play some music with the SID.
We can still see the chips, measure the signals on their pins, look where there is a resistor or capacitor and understand where the magic goes from program to action.
How I met the Commodore 64.
One day walking down the street with my old man while I was 9 years old, I remember asking him for the umpteenth time for a Colecovision, the same one I saw every night in the late-night tv ads for the Kenya Sharp Movie Hour, playing the Smurfs game in blazing colors.
He stood in the middle of the street, looked at me and said: What if you had a computer, and program your own games?
This is how my Drean Commodore 64C arrived on July 10, 1987, and with that arrived many hours of games with Commando, Ghost and Goblins, and ending with Zack Mackraken back when I was 16 years old.
There were also many hours of programming in Basic and the Data Becker books (those white and orange ones, also known as Abacus in the US) with which the same thing always happened to me:
I began to read those barely understandable letters avidly and in detail and turned page 1, 2 (always introductions), 5, 6 (they were already beginning to explain the binary and hexadecimal numerical systems) and invariably on page 16, I no longer understood anything.
That a machine code monitor was needed, or a specific cartridge, or a diskette (which did not compare to my humble dataset) and as a poor excuse they printed some help program that consisted of 20 illegible pages with many DATA instructions that after typing it invariably ended in the disastrous “DATA ERROR”.
After this frustration I went to Atarilin (my local game shop) to get a new game from Carlos and Alejandro, from whom there was always a word of encouragement, and I returned to my 10 minutes of charging the dataset and playing for a couple of hours, the resilience you have while being 11 years old.
That same resilience made me buy a new Data Becker / Abacus book a month later and start the cycle again, so “Peeks and Pokes for the Commodore 64”, “Graphics for the Commodore 64”, “64 tips and tricks” happened but He never reaches the dreamed “64 Intern” considered only for experts at that tender age.
The return of the Commodorian
Last year (2022), while reviewing the book Make Electronics, I came across the YouTube videos of Ben Eater, a true madman who made a computer only with breadboards and using the 6502 as a processor, his very well explained videos, and the possibility of buying Kits with everything necessary to assemble them and follow them step by step led me to throw myself into answering the questions that tortured me since I was a child:
How did the Commodore work? How did you load an instruction from the machine code to the processor? How was it executed?
I bought the kits and while I was waiting for them I bought a Commodore 64 on the open market, I turned it on with its original power brick (don’t do it at home, kids) and it gave me a beautiful error with all zeros on the screen and an OUT OF MEMORY ERROR. I thought about it and decided to keep it and take advantage of it as the opportunity to fix it and learn in depth how this computer works inside.
6502 vs 6510 is born
And thus this series is born, where I compare how the 6502 processor works (used in Apple, Atari, etc.) and the 6510 of our beloved Commodore 64, which in appearance are the same but have subtle and fundamental differences.
I use Ben Eater’s videos as a guide (Build a 6502 computer | Ben Eater ) adding studies of the 6510 and the Commodore 64.
With this series of blog articles and videos that I have put together, we are going to explore from the pin out to the internal registers of the 6510, passing through its I/O ports, how to load an instruction in machine code by hand and even connecting an eeprom to it with several instructions to run a program of our authorship.
I hope you will join me on this journey to answer this question that I have since I was little, How the internals of the Commodore 64 works?