Pacific Tides
My name is Thomas Sturm and I'm a programmer, photographer and writer.

Now go outside and look at the sky.

The Beauty of Assembly

A recent post over at the excellent DadHacker blog as well as my post from yesterday reminded me of my early programming days.

The Sinclair ZX81 came with an exemplary programming manual that made it very easy to start programming immediately in Basic. Those first small programs - in 1K of RAM, no less - were eye-opening for me.

I had only programmed a Casio calculator with 32 steps before, so the fact that I was writing a program on a TV screen in real words was all by itself mind-blowing. But the implications of many of these small sample programs made my heart beat faster... I knew, just knew, that this was the future. Each of the small listings pointed to something much bigger, endless possibilities...

The future was programming, and I wanted to be there!

After a few months of doodling around with Basic - and after a much-anticipated 16K RAM expansion module was bought with my Christmas money - I started to see the limitations of the Basic interpreter. Clearly it was not the fastest way to do things on a computer. I had typed listings into the machine that came with long sections of hexcodes, and those programs were much faster than Basic alone.

So I ordered a Z80 reference book from a much bewildered old lady in our local bookstore and tackled Assembly programming. I still remember the days I spent in late spring of 1982 on my parents balcony, deep in the 500-page reference book.

One thing that I had completely forgotten until now (probably an attempt of self preservation by my brain) - I had no Assembler back then! I very clearly remember now how I sat there with the reference book on my knees, writing long lines of hex codes onto sheets of paper, creating my first Assembly programs by hand. That any of these programs ever worked at all must have been a minor miracle!

But the bug took hold in my mind... Assembly programming was - and is - somehow different. Every other programming language, from Sinclair Basic to C to Java to Perl to JavaScript always felt removed from the hardware - no doubt part of the intended function of these languages. But with Assembly you really get down to the dirty details of the computer. There are registers to write, bits to set, interrupts to catch. It all has to be done just so, or the machine will probably crash spectacularily on the first run of the code.

So while Assembly can be very frustrating, it also comes with a very special feeling of power. Nothing will ever run faster on any given computer than a well-crafted piece of Assembly code, the CPU dancing along to the very specific, exacting and - hopefully - flawless instructions of a human brain.

© 1998 - 2024 Thomas Sturm