I have always been frustrated that many details of calling "conventions" and name mangling schemes are not properly documented by compiler producers. This has provoked me to make an investigation of all the C++ compilers I could get my hands on and find out the details of parameter transfer, register usage, name mangling, etc.

I have now documented everything in http://www.agner.org/assem/calling_conventions.pdf.

My report covers different C++ compilers for x86-based systems, including DOS, 16bit, 32bit and 64bit Windows, 32bit and 64bit Linux and FreeBSD.

You can use this for making assembly function libraries that are compatible with several different compilers.

You can also use this information for making debuggers, profiling tools, disassemblers, object file conversion utilities and other tools that you want to be compatible with multiple compilers :alright:

I hope that things will become more standardized in the future, and perhaps my report can be a contribution towards this end :?:

Please let me know if you find any errors in my report, if you have additional information, or if you know of important documentation that I haven't found. You can find my Email address at www.agner.org
Posted on 2004-09-28 07:18:27 by agner
This sounds interesting. Thanks.. I will read it when I have the time.
Posted on 2004-09-28 07:32:53 by roticv
great stuff, thank you!
Posted on 2004-09-28 09:17:25 by lifewire
Thanks for a very helpful document.

By the way, does anyone know if there are any HTML versions of other Agner`s documents (Optimization Guide especially) available?
Posted on 2004-09-28 09:53:06 by arafel
Hi Agner,

Very nice work.
Posted on 2004-09-28 12:30:55 by Vortex
Arafel wrote:
By the way, does anyone know if there are any HTML versions of other Agner`s documents (Optimization Guide especially) available?

No. Only pdf. It's too much work to maintain more than one format when I update it often, and pdf is convenient because all cross references are hyperlinks, it makes bookmark links automatically, pictures can be embedded in the same file, and it prints out nicely.
Posted on 2004-09-29 11:47:27 by agner
You can also use this information for making debuggers, profiling tools, disassemblers, object file conversion utilities and other tools that you want to be compatible with multiple compilers
;) nice. What I can say ?? ... :)

If you really whant html search for pdf2html and use some of them.
Posted on 2004-09-29 14:13:54 by rea
If you really whant html search for pdf2html and use some of them.

I don't have anything against pdf, I am just find html more convenient than pdf format. Have used some converters, but the output always comes out weird looking :(
Posted on 2004-09-29 15:25:28 by arafel