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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2cb1f0b6d642e1dc,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!l2g2000prg.googlegroups.com!not-for-mail From: Shark8 Newsgroups: comp.lang.ada Subject: Pascal Calling Convention Date: Wed, 23 Mar 2011 14:37:55 -0700 (PDT) Organization: http://groups.google.com Message-ID: <9b04626e-567d-408c-aab3-39b964b3ffd6@l2g2000prg.googlegroups.com> NNTP-Posting-Host: 174.28.187.243 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1300916276 22379 127.0.0.1 (23 Mar 2011 21:37:56 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 23 Mar 2011 21:37:56 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l2g2000prg.googlegroups.com; posting-host=174.28.187.243; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15 ( .NET CLR 3.5.30729; .NET4.0E),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:19378 Date: 2011-03-23T14:37:55-07:00 List-Id: I was looking around for a way to use the Pascal calling convention in GNAT; particularly because I thought it might be nice to do the GUI- stuff in good old Delphi 5 and the application itself in Ada. All easily doable via DLL or, possibly, through the $L compiler directive which specifies a .obj file to link to. -- I found a utility to convert between .o and .obj; so that's not a problem. Though if someone knows a way to -- have GNAT emit .obj files instead of .o I'd like to hear it. The problem comes with the conventions... I'd like to be able to interface w/o using stdcall or cdecl calling convention and directly use the Pascal calling convention within my Ada texts. According to this page ( http://gcc.gnu.org/onlinedocs/gnat_ugn_unw/Stdcall-Calling-Convention.html ) the STDCALL convention *is* the Pascal calling convention; both are callee clean-up of the stack however, according to wikipedia (and http://www.swissdelphicenter.ch/torry/showcode.php?id=1233 ) there is a difference: left-to-right vs. right-to-left parameter passing. This could also be a good nugget of information if I decide to use BP7 to write an OS loader & runtime for that OS; I had an OS written in BP7 to the point where it could display a command-line, read [keyboard] commands, and change the display-mode... when trying to port that code to Ada apparently it failed to load properly due to the non-existent runtime's requirement. {True, it would be limited to 32-bits; but there isn't going to be a shortage of 32-bit CPUs for a while.}