This is an ABI question for the platform on which you are writing code. Nearly all platforms follow the Unix System V ABI to invoke C call and other ABI problems, which includes both a general ABI document (gABI) describing the general ABI characteristics in all CPU architectures and a processor-specific ABI document (psABI), specific to a particular architecture / processor family. When it comes to x86, it matches what you call "cdecl". Thus, from a practical point of view, an x86 assembly intended to be called from C must be written to accept "cdecl". Basically, the only exception to the universality of this calling convention is the Windows API functions, which use their own custom stdcall calling convention due to legacy WinLL dll thunk compatibility issues; however, the default assignment convention for x86 Windows is still "cdecl".
A more important issue when writing asm for a call from C is whether to have character names with an underscore prefix or not. This varies widely between platforms, with the general trend being that ELF-based platforms do not use a prefix, and most other platforms ...
source share