Learning an Assembly Language: Setting Up

Owl
3 min readJul 26, 2020

--

In these series I will blog about my experience learning an assembly language — or maybe even several assembly languages, if I like it enough! Today I set up my development environment.

When I was a CS student, we had an assembly language class. Of course, I don’t even remember what kind of processor were we writing for or what kind of programs we built — all I remember about it is it went in all caps 😆

Not so long ago I actually became curious about writing something in assembly. At first, I decided to go with the modern Intel instruction set and write something for my computer. I even installed nasm and prepared for the https://exercism.io/ tutorial. However, a coworker advised to look at Motorola 68000 instead. His reasoning:

  • It’s simpler. You can actually hold the whole machine in your head. Our modern computers — even the likes of Raspberry Pi — are just too complex, even though they build upon the same ideas and the big picture hasn’t changed all that much.
  • It’s cleaner. You can compare the two with reading/writing rules in French and English — French has a certain set of rules, and you can develop an intuition on how a word can be pronounced; English not only has a much larger set of rules, but also even a larger set of exceptions from those rules which makes it highly irregular and ambiguous; the only way to deal with the ambiguity is to memorize the words by heart.

Regarding the second criterion, another lovely (and open source!) alternative to Intel might be RISC-V, which is a modern processor architecture based on RISC design. It can be viewed as royalty-free alternative to another prominent member of RISC family — ARM, which powers 35% of mobile devices today (and the Raspberry Pi 😉). I, however, decided to start with Motorola 68000 because I want to start simple, and out of historical interest.

Development Environment

There’s no need to get an actual working Commodore Amiga or Apple Macintosh to get started with 68000 assembly language. I have a regular Mac — also, I noticed that most tutorials seem to be concentrating on Windows — so I will describe the process of setting up on OS X. Here’s the list of essentials:

  • An emulator to run the programs on. I am using FS-UAE which is a Commodore Amiga emulator (complete with floppy drive sounds 😊) for Windows, Linux and OS X.
  • An assembler and linker to build the programs: VASM the assembler and VLINK the linker.
  • Amiga Assembly extension for VSCode, which provides syntax highlighting and debugging tools. It integrates quite nicely with the FS-UAE emulator (that’s, in fact, how I found it — by going through the FS-UAE forums).
  • I do remember one thing about the assembly class I took at university: I had my nose in a book half the time. So I figured I’d need a similar book in this case, here it is: 68000 Instruction Set.

And that seems to be it! Now I’m all set and reading up on the processor itself.

--

--