www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/20/05:29:17

From: peter AT PROBLEM_WITH_INEWS_DOMAIN_FILE (Peter Gerwinski)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Does DJGPP allow pascal calling convention ?
Date: 20 Feb 1997 00:33:12 GMT
Organization: Universitaet Essen, Germany
Lines: 26
Message-ID: <5eg648$9cr@sun3.uni-essen.de>
References: <330B2F3E DOT 4452 AT ms2 DOT hinet DOT net>
Reply-To: peter DOT gerwinski AT uni-essen DOT de
NNTP-Posting-Host: ascend207.extern.uni-essen.de
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Luke Lee (comforth AT ms2 DOT hinet DOT net) wrote:
>    Does any one know how to write a function with pascal calling
>    convention ? 

    void foo() __attribute__ ((stdcall));

This means that the called function cleans the stack, not the caller.
But I think it does not reverse the order of arguments.  See also node
"Function Attributes" of gcc.info.

>    Besides, anyone knows how GNU pascal lay its parameter(s) ?

Like GNU C.  Caller cleans the stack.  Can be changed with

    Procedure Foo; attribute ( stdcall );

(* I personally find those double parentheses very funny.  Has anybody
an idea why they are doubled? :*)

Hope this helps,

    Peter

  Dipl.-Phys. Peter Gerwinski, Essen, Germany, free physicist and programmer
peter DOT gerwinski AT uni-essen DOT de - http://home.pages.de/~peter.gerwinski/ [970201]
       maintainer GNU Pascal - http://home.pages.de/~gnu-pascal/ [970125]

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019