How un-portable is assembly language, /really/?

后端 未结 4 1378
梦如初夏
梦如初夏 2021-01-05 06:46

I understand that writing anything in assembly, or adding assembly to any program harms its portability. But, how bad? I mean, basically all PC\'s are x86 or x64 these days,

4条回答
  •  不知归路
    2021-01-05 07:12

    Besides the processor itself, there are, of course, always other considerations: what are the calling conventions on your target platform? How are struct values passed to other (say: API) functions? Which registers may be clobbered by the callee? Which are guaranteed to be preserved for the caller? How to do a system call? What's the memory layout prepared for you by the OS upon process start?

提交回复
热议问题