In what kind of situations, assembly language will be the only solution?
|
When you want to write low-level stuff like:
|
|||||
|
|
When you absolutely need to do the following (in Debug, that wonderful program):
NOTE - Run at your own risk as this is non-recoverable. See this page for more uses: Tools and References for the MBR and OS Boot Records (search for "Debug") |
|||||||||||||
|
|
Microcontrollers. |
|||||||
|
|
When doing embedded programming for a small microcontroller, even if a C compiler is available for the CPU, you may need to resort to assembly language either to reduce the size of the code or to achieve maximum speed, or (usually) both. Some microcontrollers have have only a few KB of program memory, and less than 1 KB of RAM. However compilers for microcontroller architectures are pretty good these days, and I seldom have to resort to assembler anymore. |
||||
|
|
|
I compile C code to assembler to study how the compiler works. Try to play around with the output. Understand what happens under the hood when we choose some construct. Like if-else-if, switch case and array lookup. How does the compiler treat them? Which will be faster? Assembler helps a lot in understanding how higher constructs work. |
|||
|
|
