When I was a young lad of 12’ish or so (when dinosaurs ruled the earth, “Back to the Future” was the hottest movie of the year and Ronald Reagan was the POTUS), I owned a popular 8 bit personal computer called the Commodore-64.
It wasn’t easy to acquire, believe you me. I had to beg, cajole, plead, cry, and beg some more to my mother to get one. I assure you, she is not an easy person to persuade.
I was so desperate to get one, I had to use my personal “nuclear option” … I told my mother it would help me study and get better grades in school. Let me assure you that to most Asian mothers, it’s like music to their ears.
If a computer could help me get to an Ivy League school or Johns Hopkins, there would be no natural force on Earth preventing my mother from getting me what I wanted.
Or at least, that’s the way I convinced her to get me a personal computer. In reality, I wanted a personal computer to do what every other kid my age wanted a personal computer for.
PLAYING VIDEO GAMES (sorry mom!).
I got hooked on video games, a few years earlier, visiting video arcades that festooned practically every shopping mall and 7-Eleven store in America. Donkey Kong, Pac-Man, Defender, Galaga, and on and on and on.
Arcade games hooked me onto technology at an early age and has never let go since.
I wanted to to play videogames on a home computer, which I did. But a funny thing happened as I played games on my Commodore 64. I wanted to learn how to PROGRAM my own videogames.
The Commodore-64 was designed to actually ENCOURAGE programming. When you first turned it on, you waited a few seconds, until a prompt displayed the word “READY.”
You could actually start writing a computer program in the BASIC programming language, just by starting to type code on the keyboard … you didn’t have to first load a BASIC programming editor from a disk or tape drive.
It came “baked in” with a BASIC language interpreter as soon as you turned it on. It’s like the designers of the Commodore would love nothing better than to turn each and every one of it’s customers into fully fledged programmers.
It actually encouraged me to write really simple number and word guessing games in BASIC. To this day, I have used that same knowledge in programming in BASIC in supporting some really old legacy systems my company has kept around for the last twenty plus years, in a language called Pick Basic, which is a certain variant of the BASIC language!
Back then, during the Commodore 64’s main heyday, to write truly professional games, you had to write your games in assembly language, which is essentially communicating with a computer in its “native tongue”.
From the earliest days of computers to the present day, every computer device really only understands TWO things.
1s and 0s.
String enough 1s and 0s together (referred to as ‘bits’) and you have enough information to instruct a computer to do something useful.
And in the earliest days of computers, the computer programmers had to write computer programs in that binary 1 and 0 code, in order to communicate with those early computers.
Now while computers know how to interpret that binary code very easily, we puny humans do not.
So programmer came up with a slightly abstracted and easier to understand language called “assembler language” which allowed computer programmers to write computer code in SLIGHTLY EASIER (but compared to today’s programming languages, still very arcane) computer code syntax.
So instead of writing code in binary to display ‘Hello world’ like this:
01001000 01100101 01101100 01101100 01101111 00100000 01110111 01101111 01110010 01101100 01100100 00100001
You could write the same code in slightly easier to understand assembly language.
. @ Hello World
.global _start
_start:
MOV R7, #4 @ Syscall to output to screen
MOV R0, #1 @ Monitor output stream
MOV R2, #12 @ String Length
LDR R1, =message @ Load register with address of string
SWI 0
end:
MOV R7, #1 @ Exit syscall
SWI 0
.data @ Signify that what follows is data
message:
.ascii “Hello World\n”
As a young pre-teen novice, I had the desire to learn assembly language, but I just couldn’t seem to grok it. Maybe I didn’t have the patience and computer concepts I needed to properly acquire that kind of knowledge.
It bummed me out at the time, but it wasn’t the worst thing in the world. I shrugged it off and was happy enough programming in BASIC and play computer games (when my mom wasn’t looking).
Flash forward 30’ish years.
I’m now a business software developer making a living writing software for a software as a service company in the automative industry.
Having been a professional software programmer for nearly two decades, I’ve been exposed to quite a few technology stacks and programming languages.
Yet in all my years working with computers and programming languages, there’s one thing I’ve never worked in.
That same low level assembly language that I wanted to learn how to do when I was twelve’ish.
That is, until I got a strong enough urge to learn.
And I ordered a Raspberry Pi computer to help me do it.
Of course I could learn how to do assembly language on my daily driver laptop computer, but where’s the fun in that when you can program on a $30 Raspberry Pi computer?
I grabbed a few kindle ebooks on programming in assembly language on the Raspberry Pi and studiously began reading.
Trying to learn how to program in assembly language as a 12 year old was pretty much impossible for me.
There’s definitely a little truth about age and wisdom (or at least more head knowledge) … having near 20 years of professional software development experience under the belt really helps when you want to learn new concepts, technical stacks and new programming languages.
So the next question you might be wondering is WHY?
Why learn how to program in assembly language today, when there’s an overabundance of high level programming languages and frameworks with which to design software?
And people have a point to ask.
One of the primary reasons why software developers don’t write software in low level assembly language anymore really boils down to one thing.
WE’RE ALL LAZY (or maybe at least MOST of us).
We don’t like to do things the hard way, when there’s an easier way around the corner.
You have to write lots and lots of code in assembly language to get the simplest tasks done, like printing a simple “hello world” message on the screen, as seen above in the previous assembly language source code listing.
In javascript, a modern day programming language, you write ONE line of code.
alert(“hello world!”);
Underneath the hood behind this single line of javascript code, there is a LOT of code that you, the software developer, didn’t have to write, but is working behind the scenes to get your hello world message to the computer screen.
But Javascript is taking care of all that grunt work for you, without you having to lift a finger.
Every modern programming language and the new ones that continually are born and set out in the wild, do one thing really well … they are designed in a way so you, the software programmer, don’t have to continually “reinvent the wheel”.
These newer programming languages help the software developer from the drudgery of writing boilerplate code over and over again, before they can even begin writing the actual code pertaining to their application requirements.
So if there’s tons of advantages to writing software in modern programming languages, why on earth would a software developer like myself want to learn how to program in the archaic arts of assembly language?
Well, with that said about all the advantages of using modern programming languages and frameworks, one unfortunate consequence about using high level languages is you’re not quite sure about everything happening “under the hood”, so to speak.
Learning assembly language really gets you close to the level of the computer hardware. You have to understand what a computer really is.
The CPU (Central Processing Unit), the RAM (random access memory), the external hardware peripherals you can connect to a computer (ie. the hard drive, the monitor, etc…).
Assembly language really forces you to think about how each of these components communicate with each other.
I’ve only just begun my journey into assembly language programming, but I’m already having a ball learning how a computer really operates. It’s the difference between knowing when you press on the gas pedal and your car begins to accelerate to knowing exactly how a combustion engine delivers the power needed to make that same car move.