stem/CS/Calling Conventions.md
andy 33ac3007bc vault backup: 2023-05-27 22:17:56
Affected files:
.obsidian/graph.json
.obsidian/workspace-mobile.json
.obsidian/workspace.json
STEM/AI/Neural Networks/Activation Functions.md
STEM/AI/Neural Networks/CNN/FCN/FlowNet.md
STEM/AI/Neural Networks/CNN/FCN/ResNet.md
STEM/AI/Neural Networks/CNN/FCN/Skip Connections.md
STEM/AI/Neural Networks/CNN/GAN/DC-GAN.md
STEM/AI/Neural Networks/CNN/GAN/GAN.md
STEM/AI/Neural Networks/CNN/Interpretation.md
STEM/AI/Neural Networks/Deep Learning.md
STEM/AI/Neural Networks/MLP/Back-Propagation.md
STEM/AI/Neural Networks/MLP/MLP.md
STEM/AI/Neural Networks/Transformers/Attention.md
STEM/CS/ABI.md
STEM/CS/Calling Conventions.md
STEM/CS/Code Types.md
STEM/CS/Language Binding.md
STEM/img/am-regulariser.png
STEM/img/skip-connections.png
2023-05-27 22:17:56 +01:00

1.2 KiB

  • The order in which atomic (scalar) parameters, or individual parts of a complex parameter, are allocated
  • How parameters are passed
    • Pushed on the stack, placed in registers, or a mix of both
  • Which registers the called function must preserve for the caller
    • Also known as: callee-saved registers or non-volatile registers
  • How the task of preparing the stack for, and restoring after, a function call is divided between the caller and the callee

Subtle differences between compilers, can be difficult to interface codes from different compilers

Calling conventions, type representations, and name mangling are all part of what is known as an application binary interface (ABI)

cdecl

C declaration

  • Originally from Microsoft's C compilers
  • Subroutine arguments passed on the stack
  • Function arguments pushed right-to-left
    • Last pushed first
  • Caller cleans stack after function call returns

stdcall

  • Variation on Pascal calling convention
  • Callee cleans stack
  • Params pushed onto stack right-to-left
    • Same as cdecl
  • Standard for Microsoft Win32 API