Using Assembly Language in C/C++

前端 未结 14 1381
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-23 02:39

I remember reading somewhere that to really optimize & speed up certain section of the code, programmers write that section in Assembly language. My questions are -

14条回答
  •  清歌不尽
    2020-12-23 02:48

    use this:

    __asm__ __volatile__(/*assembly code goes here*/);

    the __asm__ can also just be asm.

    The __volatile__ stops the compiler from making further optimizations.

提交回复
热议问题