A decade or so ago, assembly language and C were used together to create most modern video games. A developer would program in C, profile to find the slowest parts of the program, and then hand-craft them with assembly language until they ran as quickly as possible.
This is, for the most part, different today. As C++ compilers got better, and more programmers realized the benefit of using object-oriented programming, gradually programmers switched over. But more importantly, assembly went from being something that you hand-crafted to something that, well, you didn’t.
Today, it’s important for a game developer to be familiar with low-level details of a computer system, since games need to be some of the fastest programs in existence. You will likely need to drop down into the stack or disassembly to figure out why a crash happened, and you will want to be familiar enough with assembly that you can read it. The days of hand-crafting on a AAA project are gone, but you will probably still be dealing with it on a much more regular basis than most other programmers.
I originally learned C++ from one of those ‘Teach Yourself in 21 Days’ books, but I didn’t really get it until I read Bruce Eckel’s Thinking in C++, a two volume series that is extremely thorough and good, but even better, is FREE! The books are about a decade old now (I went through them in 2002-2003 initially), and of course they don’t cover the C++11 standard that is going to begin growing throughout the industry, but the fact that they are still available and regularly quoted as one of the best books on the subject is hard to ignore.
In an attempt to update my understanding of C++ and how it relates to what it tells the hardware to do, I am going to go through his book again, and in the process, I’m going to be breaking down the subjects in terms of assembly language that it produces. I’m going to be using Microsoft’s Visual Studio 2010 on a 64-bit Windows 7 operating system, running on my i3-based desktop. I’m going to be comparing the 32-bit versions versus the 64-bit versions as well. Depending on how well I do, perhaps I will also go through his second volume, where he discusses the Standard Library, among other things.
Just so you know where I’m coming from: I have known C++ syntax for over a decade, though I haven’t actively programmed for the past 5-6 years. I’m fairly new to C++11. I am familiar with computer architecture and assembly thanks to Computer Systems: A Programmer’s Perspective by Randal Bryant and David O’Hallaron. Their book’s website is here as well. This book teaches a lot of low-level stuff, and while it’s fairly thick, it’s also full of exercises, solid information, and a growing group of users that have websites and forums full of tips on how to get through their more challenging exercises. Their website also has several projects you can do, including their most popular ‘bomb’ exercise, where you need to hack a program they have put together to figure out passwords that are buried in the assembly… and if you get it wrong, the program blows up! It’s not dangerous, but it’s super fun!
If you haven’t gone through that book and you want to learn assembly from scratch, I’d really recommend buying it. It’s as good a tutorial of assembly as Eckel’s Thinking in C++ is for that language. I hope you’re willing to read what I’m writing, because I’m certainly excited to be combining the best intro books I know into my own education!