C/C++ function definitions without assembly

前端 未结 6 1856
野趣味
野趣味 2020-11-28 01:38

I always thought that functions like printf() are, in the last step, defined using inline assembly. That deep in the bowels of stdio.h is buried some asm code t

6条回答
  •  猫巷女王i
    2020-11-28 02:21

    In general, library function are precompiled and distribute ad object. Inline assembler is used only in particular situation for performance reasons, but it's the exception, not the rule. Actually, printf doesn't seems to me a good candidate to be inline-assembled. Insetad, functions like memcpy, or memcmp. Very low-level functions may be compiled by a native assembler (masm? gnu asm?), and distribute as object in a library.

提交回复
热议问题