What is the purpose of a calling convention in compiled code generation?
Correct! Well done.
Incorrect.
The correct answer is C) It specifies the agreed-upon rules for how arguments are passed, return values are returned, and registers are saved/restored across function calls, enabling code compiled separately to interoperate correctly
Correct Answer
It specifies the agreed-upon rules for how arguments are passed, return values are returned, and registers are saved/restored across function calls, enabling code compiled separately to interoperate correctly
Calling conventions (e.g., System V AMD64 ABI, cdecl, stdcall) define which registers hold arguments, who cleans up the stack, and which registers a callee must preserve. Without an agreed convention, code from different compilers or languages could not call each other reliably.