Learn Assembly Language

This page contains notes about my experience learning assembly language and a tutorial for setting up a development environment to work through the examples in the book.

The prospect of trying to learn assembly language gives me anxiety. I dread that learning it is going to be dry and difficult and that it just won't click. Yet I want to learn it to mitigate the risk of getting stuck or having to limit the scope of my development projects as has happened to me before. So I'm going to take baby steps, slow and steady, until it no longer gives me anxiety.

The book that I'm starting out with is Peter Norton's Assembly Language Book for the IBM PC, Revised and Expanded. It targets DOS and the 8088 16-bit instruction set, neither of which are what I ultimately want to learn, but the purpose of this first step is just to reduce my anxiety about learning assembly language by slowly increasing my familiarity with it.

  1. If you haven't done so already, run through the Tutorial Prerequisites Tutorial.

  2. If you haven't done so already, install a window manager such as Wingo.

  3. Install the following packages from DPorts.

    • dosbox
    • unzip

  4. Make an asm directory and download and unzip the debug application into it. Run the following commands.

    mkdir $HOME/asm
    cd $HOME/asm
    curl -L https://tr.im/239ea > DEBUG125.zip
    rehash
    unzip DEBUG125.zip

  5. Generate a configuration file. Run the following command.

    dosbox -printconf

  6. Configure dosbox to mount the asm directory at startup. Add the following lines at the bottom of $HOME/.dosbox/dosbox-0.74.conf and then save the change to disk.

    mount c ~/asm
    c:

  7. If you use the Dvorak keyboard layout instead of the QWERTY keyboard layout, skim through $HOME/.dosbox/dosbox-0.74.conf to find the following line.

    keyboardlayout=auto

    Then edit the previous line to match the following line and save the change to disk.

    keyboardlayout=dv103
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License