Coding in Assembly

margaret_hamilton
In my work, I often come across a younger generation of engineers who are interested to write software. When asked on tips on how to be a better programmer, I often tell them to study assembly. The result is usually a mixture of shock and incredulity.

Assembly programming is taught as a matter of course, in any electronics engineering program worth it’s salt. It is a very important skill to learn as it is one of the key areas of programming that require a certain level of technical engineering knowledge to understand. Therefore, as engineers, we have no excuse to be afraid of assembly programming.

Most of the time, these people are coding in C/C++ and not one of the sexier languages. I often remind them that C was only invented around 1970 and humans were perfectly capable of writing complex software in assembly, well before that. Today, many people still write assembly code when they’re forced to deal with certain hardware registers or because there isn’t a suitable C/C++ construct to access specialised features of the processor.

It is in this realm that the electronics engineer comes in handy – to work on software that runs close to bare-metal.

Therefore, it saddens me to think that the younger generation of electronics engineers today think that embedded systems programming means using something like the Arduino. While I think that the Arduino is an absolutely useful tool for developing embedded systems, it is not a great tool to teach it to electronics engineers because it abstracts everything away.

In fact, learning to read and write assembly is an absolutely amazing way of improving one’s programming skills in any language. After doing it enough times, one can truly appreciate how all the software constructs are reduced to machine operations. It basically teaches a person to think like a compiler and allows us to truly instruct the machine to do what we want it to do.

It feels like magic.

PS: Look at the amount of code that was written in the past. Think at how much work went into that. Lines of code? Try volumes of code.

Published by

Shawn Tan

Chip Doctor, Chartered Engineer, Entrepreneur, Law Graduate.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s