Why do we need to compile for different platforms (e.g. Windows/Linux)?

前端 未结 4 1909
感动是毒
感动是毒 2021-01-02 11:51

I\'ve learned the basics about CPUs/ASM/C and don\'t understand why we need to compile C code differently for different OS targets. What the compiler does is create Assemble

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-02 12:31

    In addition to everything else even with identical instructions even the calling conventions can differ, that is the placement of parameters on the stack or in registers, the order parameters are found, what registers must be preserved across a function call, how return values are passed from callee to caller.

提交回复
热议问题