C'mon folks, of course assembler is "mostly useless." No question.
Of all the gazillions of lines of code that have been written (by humans), how many are assembler? It's a tiny fraction of the total.
that may be, but realise this : anytime the computer starts , it is a chunk of assembly that finds and initializes all peripherals , goes to seek the bootsector , loads the assembly program that is stored there and then loads to Os.
Without assembly your machine would not boot...
C is handy dandy except if you have a freshly reset cpu where the memory controller is not initialized so you have no stack , no ram no nothing and you need to bring it up .... good luck doing it in 'c' ... ( there are bioses that are mainly written in 'c' but the real startup code, the first few hundred bytes of code the set the machine in the right mode are handwritten assembly.
so don't dis it...
Besides speed and size there are other situation. situations so critical you simply don't trust a compiler ! just moving a block of code may cause the compiler to create completely different code . simply because it now walks a different optimizer pathway.
sometimes compilers are bloody annoying like when they 'optimize' a block of code away because it is never called... or that's what it thinks... what if there are instance where the cptr and dptr are manipulated outside the scope to call that function directly.
in that case you write some stuff as inline assembler and tell the compiler : hands off.
other cases are where a new core is available but the compiler has no support for a specific feature yet.... like a core that all of a asudden has extra interrupt vectors. at least then you can throw in an 'org xxx' to offset code generation and write some hooks in assembly to patch in the unsupported stuff until the compiler builders can catch up.
an extreme case is to provide patching code... a chunk of silicon has a hardware bug. at boot a chunk of assembly is called that circumvents the normal startup , patches the core and then the compiler can go off.. i know several cpu's ( Arm7 based) that have such problems. the assembly code sets the registers right so a normal program can run