mortos360:
Does anybody really use assembler anymore for complex programs?
It seems that its easier and cheaper to use higher language and compensate for the slow code with faster hardware...
Even operating system kernels are, by and large, written in C these days. Ditto for the Arduino bootloader, where squeezing it into a tight space was a priority.
It is certainly interesting learning assembler, I wouldn't discourage it as a means of knowing more about how things work.
However these days it's not so much that you get slower code out of C. They wouldn't be using it to write kernels and device drivers if C wasn't compiled up pretty well. Modern C compilers do extensive optimization, quite possibly better than you or I might.
For example, by simply maintaining a table of what registers are in use and what aren't, a compiler can optimize away loading/storing variables into RAM, by remembering that a variable is already in register 22 (say). It also detects thing like calculations done inside loops that can be moved outside, can change multiplies into shifts, and so on.
I think the only time people use assembler these days is for highly time-critical code. And they may not be trying to save time either. For example, you might write:
for (i = 0; i < 200; i++)
{
int b = 0;
}
The compiler might look at that and say "well that didn't achieve anything, he never used the variable b. I'll just optimize that away". But if some piece of hardware needs an exact time delay, optimizing things away might not be what you want.
As for C++ being bloated, well I think modern compilers are good at that too. For example a while back I compared sorting a vector of integers. One way was using the Quicksort supplied with standard C, and the other way was using the Standard Template Library (STL), using a vector container, and using the STL inbuilt sort.
The STL sort (which heavily used C++) was 3 times faster than the C version.