Home

Essay Index

Links

Contact

Subscribe in a reader

Some Assembly Required

by Anne Loucks

I have a confession to make. I actually like coding in assembly language. I wrote my first assembler program while still in high school, where my computer science instructor was very focused on perfect structured programming. The skills he taught me have proven to be extremely valuable in my professional life. Unsurprisingly, and somewhat rightly, he portrayed assembly language as archaic and detrimental to making programs that were portable, maintainable, and easily read.

For me, buying Turbo Assembler and figuring out how to use it on my old 386 represented a rebellion of sorts. Some people learn assembly language so they can lord it over their nerdy fellows. Others are forced to choke it down when they get to college. I learned it because it was forbidden. When I started learning how to use assembly language, something strange happened. I found out that I really liked it.

Every bit of fiddly foolishness attracted me. Even the simplest tasks can become a fun little puzzle when you must reduce it to simple machine instructions. Zeroing out a variable can become interesting. When coding for x86, "xor ax, ax" can be superior to "mov ax, 0" because it is a smaller instruction and is therefore loaded more quickly. Every little nit-picky tip and trick became special.

I devoured books on the topic, reading Inner Loops, The Indispensable PC Hardware Book, and Michael Abrash. In reading these books and articles, I deepened my understanding of what goes on beneath the hood of a compiler. In particular, I did not really understand pointers beyond their useful abstraction before learning assembly language. It may sound ignorant, but I did not know that pointers were merely a giant index into memory.

Unsurprisingly, straight college computer science did not satisfy me, as they often abstract the computer far too much. At times, it almost feels like actual computers have little to do with the topic. First, I became the horrifying student who outdid her TAs when asked to optimize an assembly routine. Later, I became an electrical engineer with an embedded systems focus. This let me follow my enjoyment of assembly language.

In work I have needed both high-level and low-level programming skills, but aside from writing code for embedded systems, I have never built any commercial programs in assembly. Still, over the years, I have decided that my high school computer science instructor is not completely correct. Beautifully made programs and assembly are not mutually exclusive, but combining the two requires far more effort; in particular, one needs good comments and careful construction of subroutines to avoid the creation of bad code.

I have seen plenty of ugly programming over the years. I am also guilty of creating some terrible code, and in my experience it is easier to give birth to great hideousness with assembly language than with higher-level coding systems. Still, assembly language holds a special place in my heart. Tinkering at the lowest level possible is fun. Cheers to Assembly language and all its absurd, anal, mad glory!!

First Previous Next New

Wild Woolly Washers