What kind of projects (besides the obvious OS stuff) use assembly language?

后端 未结 16 1899
野的像风
野的像风 2021-02-14 15:48

Seemingly, no one uses assembly nowadays other than to develop device drivers, or the very core of OS kernels etc. Anyone has knowledge of it being currently used for other thin

16条回答
  •  囚心锁ツ
    2021-02-14 16:25

    If you spend a lot of time looking at the assembly output of your C/C++ source, you'll notice very quickly that most good optimizing compilers make better assembly than even good assembly programmers. Decisions on when to inline a function, how to handle loops, post vs. pre increment (which many compilers decide how to handle for you now) etc. Best of luck outsmarting a compiler that has a large community developing it and a much better ability to manage addresses and definitions than you, under normal circumstances at least.

    Even device drivers and OS kernels are typically not written using a lot of assembly. Small performance critical sections of real time programs are where you'll find assembly in today's apps.

    It gets even worse when you start talking about RISC assembly which tends to have awesomely effective for optimization instructions like branch and exchange along with dozens of general purpose registers. Most people are not smarter than an optimizing compiler. Those who are are generally writing optimizing compilers.

提交回复
热议问题