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 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!z27g2000prz.googlegroups.com!not-for-mail From: Shark8 Newsgroups: comp.lang.ada Subject: Re: Pascal Calling Convention Date: Wed, 23 Mar 2011 19:04:45 -0700 (PDT) Organization: http://groups.google.com Message-ID: <3bf6335f-2319-4669-bed2-216a5afbe6db@z27g2000prz.googlegroups.com> References: <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 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1300932286 8978 127.0.0.1 (24 Mar 2011 02:04:46 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 24 Mar 2011 02:04:46 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z27g2000prz.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: g2news1.google.com comp.lang.ada:18412 Date: 2011-03-23T19:04:45-07:00 List-Id: On Mar 23, 6:43=A0pm, Yannick Duch=EAne (Hibou57) wrote: > Le Thu, 24 Mar 2011 01:24:41 +0100, Randy Brukardt = =A0 > a =E9crit:> This is news to me, and I wrote the pragma Import support in = Janus/Ada. > > Parameter passing in all of the Windows conventions (including C!) is > > left-to-right. But perhaps whomever wrote that was confused by the fact= =A0 > > that > > the x86 stack grows downward, so the left parameter is the one at the > > highest address on the stack. Even so, it is the first one pushed. > > While I read you, I can't avoid thinking you must be true, as this is the= =A0 > only way to get variable number of parameters working for C. What is =A0 > confusing also, is that assembly program sometime use the stack as an =A0 > array : allocated room on the stack, and then do something looking like = =A0 > [ebp+0] :=3D ... [ebp+4] :=3D ... and so on. But I feel to remember param= eter =A0 > passing order for WinAPI is the reversed one than C. I will have a test = =A0 > tomorrow to check (I am not running Windows right now). Yes-ish. In the 16-bit world [Win 3.11] WinAPI params were pushed with Left-to- Right [Pascal convention]; in the 32-bit world Win32API params are pushed Right-to-Left (like C, but with calee cleanup, like Pascal calling convention). http://en.wikipedia.org/wiki/X86_calling_conventions