Click here to Skip to main content
Click here to Skip to main content

Why Learn Assembly Language?

, 28 Jun 2010
Rate this:
Please Sign up or sign in to vote.
An article explaining the benefits of learning assembly language

Introduction

REVISION 2

"Assembly language? Isn't that the hard to read instructions on how to assemble your brand new computer desk?"...

No..

What is Assembly Language?

x86 Assembly is a programming language for the x86 class of processors (specifically the 32bit x86 processors IA-32 - http://en.wikipedia.org/wiki/IA-32). The instruction set defined by the IA-32 architecture is targeted towards the family of microprocessors installed in the vast majority of personal computers on the planet. Assembly language is machine specific and considered a "low level" language. This means that the code and syntax is much closer to the computer's processor, memory, and I/O system. A high level language is designed with keywords, libraries, and a syntax that introduces a high level of abstraction between the language and the hardware.

Background

I thought assembly was a dead language, why waste the time?

Though it's true, you probably won't find yourself writing your next customer's app in assembly, there is still much to gain from learning assembly. Today, assembly language is used primarily for direct hardware manipulation, access to specialized processor instructions, or to address critical performance issues. Typical uses are device drivers, low-level embedded systems, and real-time systems (EDIT:Thanks Trollslayer). The fact of the matter is, the more complex high level languages become, and the more ADT (abstract data types) that are written, the more overhead is incurred to support these options. In the instances of .NET, perhaps bloated MSIL. Imagine if you knew MSIL. This is where assembly language shines. (EDIT)Assembly language is as close to the processor as you can get as a programmer so a well designed algorithm is blazing -- assembly is great for speed optimization. It's all about performance and efficiency. Assembly language gives you complete control over the system's resources. Much like an assembly line, you write code to push single values into registers, deal with memory addresses directly to retrieve values or pointers. To write in assembly is to understand exactly how the processor and memory work together to "make things happen". Be warned, assembly language is cryptic, and the applications source code size is much much larger than that of a high-level language. But make no mistake about it, if you are willing to put in the time and the effort to master assembly, you will get better, and you will become a stand out in the field.

So why should you care?

Points of Interest

Wirth's Law

I remember dialling into a BBS on my 486 with my brand new 2400bps modem. Fast-forward 14 years and now we are only limited by our imagination. With all of these amazing technological breakthroughs, there is a glaring anomaly; a paradox. This is referred to as Wirth's law. Wirth's law states that software is getting slower more rapidly than hardware becomes faster. There's no one reason why this is the case, but I'd like to think that the further we as developers drift away from the lower level details of software development, we write less than stellar (inefficient code). Hold the phone! I'm not calling anyone stupid. It's just that these new languages and supercharged processors have abstracted us so far from the machine, that we no longer have to be concerned with things like garbage collection, variable initialization, memory address pointers, etc. All of these features and more are now standard in today's languages/runtimes/IDEs. The result is a new breed of developers that rely on superior hardware power for performance rather than striving to write concise, cohesive, efficient code.

My Eyes are Open!

I realize now that learning assembly language will teach me about the inner workings of the computer. I'll learn how the CPU/CPU registers work with memory addresses to achieve the end result one instruction at a time. This doesn't mean that I'm going to begin coding everything in assembly, however, I will learn which data types to use and when. I'll learn how to write smaller, faster, more efficient routines. I will understand software development at a level that most of my peers don't. I'm even opening up to the possibility of looking into writing my own compiler.

So if you are serious about getting a leg up on the competition in your field, I'd recommend trying to learn assembly language.

Resources on Learning Assembly

Introduction to x86 Assembly Language

History

I plan to update this blog with links to tutorials/articles/books/sample source code.

Well, as always,
Thanks for reading.
Buddy B.

http://www.twitter.com/budbjames
http://www.bytepushers.com

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

bjames02
Software Developer bytepushers.com
United States United States
I'm a 28 year old software engineer from Tennessee. I've been programming since I was 13 years old. I'm fortunate enough to be able to do what I love for a living.
 
VB.NET, ASP.NET, C#, assembly, HTML, JavaScript, AJAX
 
I'm MCP, MCAD, MCSD.NET certified.
 
follow me on twitter
 
http://www.twitter.com/budbjames

Comments and Discussions

 
GeneralRe: Overal cost Pinmembersupercat929-Jun-10 5:17 
GeneralRe: Overal cost Pinmemberdanielj29-Jun-10 22:02 
GeneralRe: Overal cost Pinmemberbjames0230-Jun-10 5:32 
GeneralRe: Overal cost Pinmembersupercat930-Jun-10 5:36 
GeneralRe: Overal cost Pinmemberke4vtw20-Jul-10 5:00 
Generalassambly PinmemberAdrabi Abderrahim25-Jun-10 15:28 
GeneralRe: assambly Pinmemberbjames0225-Jun-10 18:08 
GeneralTrue worth of knowleged gained from learning Pinmemberw3bdev25-Jun-10 5:48 
GeneralWaiting for examples and tutorials PinmvpJose Menendez Póo25-Jun-10 5:39 
GeneralRe: Waiting for examples and tutorials Pinmemberbjames0225-Jun-10 5:43 
GeneralRe: Waiting for examples and tutorials PinmembervizEQ28-Jun-10 14:09 
GeneralRe: Waiting for examples and tutorials Pinmemberbjames0228-Jun-10 22:39 
GeneralRe: Waiting for examples and tutorials PinmemberRugbyLeague29-Jun-10 0:18 
GeneralAssembly language for debugging PinmemberAshley Davis25-Jun-10 4:43 
GeneralRe: Assembly language for debugging Pinmemberbjames0225-Jun-10 5:31 
GeneralRe: Assembly language for debugging Pinmembersupercat925-Jun-10 7:26 
GeneralRe: Assembly language for debugging Pinmemberdaroczy29-Jun-10 8:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web04 | 2.8.140814.1 | Last Updated 29 Jun 2010
Article Copyright 2010 by bjames02
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid