Commodore 64/128 Assembly Language Programming Book Review
A couple of people have asked me. How do I get into Assembly Language programming for the Commodore 64?
I really wasn’t sure what the answer was, but now after having read through this book, I can definitely say this is exactly how you can get into programming in Assembly Language for the Commodore 64. From this book, you will learn everything you need to know to get started programming in assembly language for the C64.
Now, if you know absolutely nothing about it, there will be a steep learning curve, but I believe the payoff is worth it in the end. The cover of the book which was written by Mark Andrews and published by SAMs publishing in 1985, depicts an image of a broken character set, which I believe is a reference in the book since it covers how you can combine high-resolution graphics and the Commodore 64 character set on the same screen.
This is the first assembly language book written for owners of both the Commodore 64 and Commodore 128 computers. The book does include many assembly language routines as well as a couple of basic programs. The author does a good job of breaking down and explaining most of the programs contained within the book, something which can be difficult to accomplish. The book which clocks in at 321 pages, is mostly for the beginner but it does cover a wide variety of topics such as the entire instruction set, addressing modes, graphics modes, joystick input, sprites, music, and sound.
In order to follow along with this book, you will have to choose an assembler to work with. An assembler is a program that will translate assembly language into machine code. The author covers the three most popular assemblers available at the time, “The C64 Macro Assembler“, “Panther C64“, and “Merlin 64″. Out of these, he seems to provide more examples and assembly code with the Merlin 64 assembler, which is why I would recommend you download it, and play along. Either way, you should be able to follow along with any of these three choices. Personally, I have sort of been spoiled using a modern cross compiler, the CBM Program studio, but, I thought it would be fun to write some code the way it had to be done back in the 1980s.
You can download the Merlin 64 assembler from this link: I will cover the Merlin 64 assembler in detail in an upcoming video.
The book starts out in chapter one with an introduction into assembly language. Then moves on to explaining decimal versus binary, and hexadecimal in chapter two.
Chapter 3 dives into registers and flags, which brings us to chapter 4 where we start writing our first assembly language program. Again, examples are presented from the three assemblers mentioned. Chapter 5 shows us how to use the ASM Monitor and tie in a basic program with assembly language.
Chapter 6 – Goes into great detail on the different addressing schemes.
Chapter 7 – Covers branching in detail.
Chapter 8 – Covers bit-shifting operations
Chapter 9 – Covers arithmetic operations and how to do them in assembly language
Chapter 10 – Covers the Commodore 64 memory map
Chapters 11,12- Cover the hi-resolution graphics mode and was a chapter that piqued my interest.
Chapter 13 – Covers customizing a character set and utilizing characters in hi-resolution graphics mode.
Chapter 14 – Was all about sprites
Chapter 15 – Went into music and sound effects.
There are two appendices;
Appendix A – Covers the 6510 instruction set, mainly all the commands and the affected flags, registers, and addressing modes.
Appendix B – Covers several additional assembler programs that were designed for use in the Merlin 64 assembler.
That’s the entire book in a nutshell. I did attempt to find the “type in” source code out there on the internet, but I could not find it, so I managed to type in a couple of the programs from the book. I did come across a couple of typos that could really throw you off or set you back when trying to run the program. Firstly, on page 92, table 6-1 under the Zero page addressing, the second “#” should not be listed two times (the second one should be removed).
On page 194 line 140 on the poke statement, the OR should read “2^BIT” rather than (2BIT), as I was able to confirm from the same line in the comments on page 205 line 196.
On that same page, 205, – line 183 – the “ADC 0” I think, maybe, it should read “ADC #0”, the program would not work for me as listed, so I am not sure if that was a typo or not and I don’t really understand what purpose that line serves oh, and don’t ask me how long that took to figure out. I commented it out to make it work. I saw the same instruction on page 232, line 198, and again on page 250 line 211, and then slightly different on page 256 line 504 in the sprite program listing. Stay tuned at the end of this video for a bonus segment covering a little more on this.
There was another typo on page 206, line 239. The “sta TABPTR+1240”, should read “sta TABPTR+1” and the rest of the line should have been shifted down to the next line.
After that, I did not type in any more code from the book. I sort of wonder, did they throw in those typos, just to keep us on our feet. One thing that I would like to point out when programming in Assembly Language with an old school assembler, the assembler itself does gobble up a chunk of the precious available memory on the Commodore 64. This fact is outlined nicely starting on page 181, showing all of the different memory locations consumed by the three assemblers covered in the book.
Overall, I really enjoyed reading this book, and I was able to learn a few new concepts, such as the high-resolution graphics mode and I was able to further refine my understanding of things such as the various addressing modes.
I think it’s a great book for the beginner since it offers up many examples and explanations of the code presented. Having said that I know this book is out of print and is therefore difficult to find. I did find a download link for the PDF version of the book at this link:
http://www.bombjack.org/commodore/
Youtube Description:
This is my review of the 1985 programming book by SAMS, “Commodore 64/128 Assembly Language Programming“.
CORRECTION:
https://youtu.be/edkwq2tr2_A
Book Download:
http://commodore.bombjack.org/books/commodore/books/Commodore_64_128_Assembly_Language_Programming.zip
My GitHub link with the blackboard.asm (for CBM prg studio)
https://github.com/graydefender/RandomStuff
Book PDF download:
Link stopped working… Searching for new link…
Merlin 64 Software download:
https://csdb.dk/release/?id=131483
OR
ftp://arnold.c64.org/pub/utils/c64apps/compiler/Merlin_Assembler.zip
Manual PDF:
https://www.lyonlabs.org/commodore/onrequest/Merlin.pdf
Youtube Original Post Date: 04/20/2019