What are the chances that you will write BIOS or bootstrap code? Is it likely that you will program inexpensive MCUs without RAM?
Probably not.
Why, then, do we need to teach assembly language programming to everyone?
As it turns out, knowing how programs execute at the lowest level can be very helpful in debugging HLPL programs. Some symptoms can be very mysterious to a developer with poor or no understanding of assembly language programming. Let us take a look at the program in listing 1.
In this program, it is possible to make just enough coding mistakes so that when function g() returns, it returns to somewhere in the middle of function f() instead of the main() function!
We can also take a look at another example in listing 2.
In this case, it is possible to make certain mistakes so that variable i has a value of 0 before calling g(), and it is altered after g() returns.
While these symptoms are baffling to people who only know how to program in HLPL. However, to a person who understands how a C program looks like in assembly language, these symptoms are actually important clues to find the actual mistakes.
In summary, understanding assembly language programming can save you a lot of debugging time in your other C/C++ programming classes/projects!