Assembly Language

I love Assembly language.  I first took college classes on Assembly over 20 years ago.  I was a little rusty before I wrote CarsonLib (the data mining library).  With just a little time, I was back in the full swing of things once again.  Writing in Assembly is not just for hackers or electrical engineers.  I believe that Assembly is still a good tool to use today when performance is necessary.  The fascinating truth about CarsonLib is that I didn’t even need to tune the Assembly code.  My experience is that Assembly rarely needs tuning because it is so efficient in comparison with high level languages.  But, that’s not always the case.

I took a Visual Basic class one semester before taking Assembly language in college.  The textbook had a small section about program optimizations.  I am paraphrasing here, but it basically went like this:

  1. Don’t optimize.
  2. When you absolutely need to optimize, see rule #1.

I think this type of attitude is rather prevalent today, and, unfortunately, leads to program bloat and poor performance in systems.  I think this is why even the simplest software packages are so large.  The CarsonLib.DLL weighs in at 9KB and it does quite a bit.  It contains the data mining functions, the searching algorithms, and the code for the difference engine.  Again, it hasn’t been optimized a whole lot because there was no reason to do so.

I don’t believe that entire systems should be written in Assembly language today.  I do not think this is necessary, and I daresay that it may be a waste of time.  Using a high level language, such as C#, gives you access to a whole lot of functionality that would be impossible to write in Assembly or C in a reasonable time frame.  Use Assembly language to give you the edge you need when performance is paramount.

Of course, not everyone believes that.  Assembly language pundit Steve Gibson (www.grc.com) likes to write entire systems this way.  Another proponent of Assembly is Ted Gruber, the creator of the FastGraph graphics library that is written in Assembly (the homepage is www.fastgraph.com, but it hasn’t been updated in years).  If you think this way, more power to you.  I will stick with Assembly language as a good supplement to C#.

Advertisement

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 )

Facebook photo

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

Connecting to %s