C64 Assembly In Parts

[Michal Sapka] wanted to learn a new skill, so he decided on the Commodore 64 assembly language. We didn’t say he wanted to learn a new skill that might land him a job. But we get it and even applaud it. Especially since he’s written a multi-part post about what he’s doing and how you can do it, too. So far, there are four parts, and we’d bet there are more to come.

The series starts with the obligatory “hello world,” as well as some basic setup steps. By part 2, you are learning about registers and numbers. Part 3 covers some instructions, and by part 4, he finds that there are even more registers to contend with.

One of the great things about doing a project like this today is that you don’t have to have real hardware. Even if you want to eventually run on real hardware, you can edit in comfort, compile on a fast machine, and then debug and test on an emulator. [Michal] uses VICE.

The series is far from complete, and we hear part 5 will talk about branching, so this is a good time to catch up.

We love applying modern tools to old software development.

10 thoughts on “C64 Assembly In Parts

  1. 6502.
    It’s called ‘6502 assembly’.

    I’ll grant C64 was it’s own beast, as they all were, but 6502. (aktually, lower chip count hardware…6510)
    It’s not a bad processor to start on.
    Simple.

    IIRC C64 system had complications.
    Can easily sink a year of time, learning gory details of obsolete sprite system, sound and disk IO.
    If you learn what a ‘breakfast drive’ is, you have failed to prioritize kid.
    Don’t go too deep, there are many man centuries of work in that huge pile of sprite games.
    Frustrating bit twiddly endless hours, all the while wishing for 100 MHz computers…

    Hardly imagining that the kids would constantly rebuild castles in swamps of Javascript, wasting GHz casually, reinventing every old bad idea.

    6502 was my first assembly.
    Am packrat.
    Still have MOS technology 6502 manual.
    I taught myself assembler out of that book.

    Now get off my lawn.

    1. 10 REM Speaking of C64, the successor C128(D) was a fine computer.
      20 REM It had both the 8502 and the Z80, the best of two worlds.
      30 REM And even if it had gotten an V20 instead of Z80, it could have had gotten still ran plain i8080 code.
      40 REM Sorry for my poor English syntax.

  2. while I learnt assembly on a z80, then spent a lot of time writing assembly for ibm/370/390/mvs, I recon the best one for people to learn nowadays is the ATmega328P. Indeed, I’d make that compulsory for all the uni courses, as maybe that would a) teach them how it all works and 2) teach them not to write bloatware later…

    1. atmega328p is a great chip, and it’s so well documented and tested it’s the only mcu the avr transistor tester guys will allow to be used. but nowadays its out of production. during covid they were selling for 20 euro each. at that kind of price it’s not suitable to learn on.
      They can be worn out too. i had one in a keyboard and i made so many flashes editing and testing the keymap that it wouldn’t take any more writes.

      1. Wait? 328p is out of production! Oh no! I’m still not over the loss of the PIC 16F84A! 😟
        Why can’t industry simply produce something so popular for 50 years? Or let clone industry have it?
        Production costs do decrease over time, after all.
        It feels like yesterday when the Atmega328p replaced the Atmega168..

        (A quick web search says there’s an Atmega328pb variant, but it’s in ugly SMD package and not fully pin compatible.)

  3. VAX assembly in college. Learned x86 on own during that time as well as a little 6502 on C64s in the electronics lab. Z-80 and 68xxx at work. And of course now it is x86_64, ARM variations, and RISC-V. Oh what fun…

Leave a Reply to tiopepe123Cancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.