◄ Wiki / Build
calling convention
The agreed rulebook for how one function passes arguments to another and gets a result back.
When code calls a function, both sides must agree on where arguments go (which registers or stack slots), who cleans up, and where the return value lands. That agreement is the calling convention, and it is usually dictated by the CPU architecture and operating system. Get it wrong and calls corrupt data or crash, which is why it must be exact across compiled boundaries.
See also
- code-segment selectorAn x86 register value that identifies which block of executable memory the CPU is currently running code from.
- context switchThe kernel saving one thread's full state and loading another's, so a single CPU can juggle many tasks.
- bytecodeA compact, low-level instruction stream that a virtual machine or interpreter runs, sitting between source code and the raw CPU.
Referenced by
bytecode · C subset · code-segment selector · context switch · cross-compile