Talk:Calling convention

From Wikipedia, the free encyclopedia

Contents

[edit] To dos

I put up some quick information now, but i dont really have the time or all the know-how to fill out the article in it's entirety right now. here is a list of things that (as I see it) this article will need:

  • translation to other ASM codes (i use only x86 architecture right now)
  • examples using high-level languages (C/C++ for cdecl and stdcall, Pascal for pascal, don't new versions of Delphi use fastcall?)
  • performance indices
  • history of calling conventions, inventors, initial implementations, etc.

--Whiteknight 18:58, 25 Apr 2005 (UTC)

I also see the need for an explanation of various methods of implementing multiparameter functions. Despite statements to the contrary, I do not see how caller balanced stacks are better for such a task. What is frequently left out is how the called function knows how many parameters is on the stack, or more accurately accesses all of the parameters on the stack, not knowing beforhand how many are there. Hackwrench 01:51, 6 November 2005 (UTC)

To clarify BASIC uses callee stack balancing, but it has several internal functions that are muliparameter.

Not all returns are through registers. I noticed returning a structure seems to be using a pointer put on the stack from the caller. Other return methods such as this need to be added. -- para45

[edit] Other languages

anybody with knowledge on the calling conventions of other languages (as opposed to the focus on C and C++ in the artical as it currently stands) would be greatly appreciated. it is easy for people to forget that there are other common compiled languages besides C/C++: Pascal, Fortran, Ada, Delphi, etc... --Whiteknight 15:52, 8 September 2005 (UTC)


[edit] Safecall?

I've heard of a "safecall" calling convention before, but frankly, i dont know any of the details, or even if it is conceptually different from any of the other calling conventions. also, i havae no idea when/where it is used, and by which compilers. should i just delete that heading from the artical? --Whiteknight 15:54, 8 September 2005 (UTC)

My Delphi helpfile says that I must declare my routines with the "Safecall" convention if it is to support both compile time binding and runtime binding through COM automation. Not sure if this is used outside Delphi... --203.173.159.178 23:10, 27 June 2006 (UTC)

[edit] Standard Entry and Exit sequences.

I'm wondering if the last section on standard entry and exit sequences would be better served by moving them to a separate artical on stack frames. any ideas? --Whiteknight 15:57, 8 September 2005 (UTC)

A separate article seems like a good idea. However, in my opinion it should really try to give a high-level picture, rather than going into miniscule details of a particular (not even typical) architecture (such as explaining which programming language constructs need a stack pointer, which need a frame pointer, which need the stack to be dynamically allocated etc.). --Mellum 16:56, 8 September 2005 (UTC)


[edit] Grammar

The grammar and punctuation of this page need serious work, and the content is disorganized and fairly confusing. Marking for cleanup. --bmills 18:24, 21 October 2005 (UTC)


[edit] Another type of fastcall convention

I've encountered a program that uses register calling convention that passes as many as FOUR parameters via registers (EAX,EDX,EBX,ECX). Does anyone know to which language/compiler does this concern? I have only an assembly with no evidence of compiler info :( --Ivan Pozdeev 08:09, 13 June 2006 (UTC)

This turned out to be Watcom's version of __fastcall
(oh my! one more meaning for the same keyword!) --Ivan Pozdeev 07:47, 14 June 2006 (UTC)

[edit] Ather architectures?

What about Sparc and Sparc64? MIPS? PPC? Others? Should not this article be renamed into "Calling convention x86"?

I split the article and created section stubs for those other architectures. Allnamesinuse 23:32, 2 September 2006 (UTC)