From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,28db79a4b238c104 X-Google-Attributes: gid103376,public From: falis@ma.aonix.com (Ed Falis) Subject: Re: What's wrong with this simple Ada w/ assembly code? Date: 1999/03/05 Message-ID: <1103_920657118@DZOG-CHEN>#1/1 X-Deja-AN: 451631189 Sender: news@sd.aonix.com (USENET News Admin @flash) X-Nntp-Posting-Host: 192.157.137.14 References: <36ddb9aa.0@silver.truman.edu> <7bm0kb$8uj$1@nnrp1.dejanews.com> <7bmb69$1bh$1@its.hooked.net> <7bn1fd$7pq$1@nnrp1.dejanews.com> <7bp0sb$cdg$1@its.hooked.net> Organization: Aonix, San Diego, CA, USA Newsgroups: comp.lang.ada Date: 1999-03-05T00:00:00+00:00 List-Id: On Fri, 5 Mar 1999 08:41:46 -0800, "Mike Silva" wrote: > Is there, then, exactly one ABI per architecture, as would seem to be > necessary? How and where are these standardised? > > Again my thanks to the helpful folks on this group -- maybe someday *I'll* > be able to answer questions here! > > Mike > > > Nope. Let's take windows as an example. MS defines a number of calling conventions that affect how parameters are passed. The most important / common ones are cdecl (for most calls) and stdcall (for winapi calls). They differ in their parameter passing conventions. Then we get into niceties around how link names are mangled. DLL's are mangled differently than other names for the same convention. C++ member names are further mangled. And if you use a non-MS compiler, you often get yet another name mangling scheme. For our window products, we just took a "most commonly used" approach of providing language names cdecl, stdcall, dll_cdecl and dll_stdcall, with the option of overriding either the name to be mangled or the actual linker symbol generated. We also provided the synonyms C and DLL corresponding to the two cdecl variants. So, at least in this case there isn't a single convention. But windows is worse in this regard than most. - Ed