Stack and calling convention questions

"Thelonious Georgia" <olsonr@panix.com>
1 Aug 1999 23:04:28 -0400

          From comp.compilers

Related articles
Stack and calling convention questions olsonr@panix.com (Thelonious Georgia) (1999-08-01)
Re: Stack and calling convention questions rkrayhawk@aol.com (1999-08-07)
Re: Stack and calling convention questions mikov@usa.net (Tzvetan Mikov) (1999-08-12)
| List of all articles for this month |
From: "Thelonious Georgia" <olsonr@panix.com>
Newsgroups: comp.compilers
Date: 1 Aug 1999 23:04:28 -0400
Organization: Compilers Central
Keywords: C, practice

Hey all-


I'm trying to understand better the assembly created by the compiler
for my C++ programs, especially the differences in the various calling
conventions. I understand why a function like printf() or main()
needs to be cdecl, but under what circumstances would I want to
deliberately make a function fastcall? Thus, I'm trying to use the
assembly output to glean some more information, but I'm a bit stuck at
what I'm looking at; I'm not confused about the assembly output
itself, I'm just wondering why it's doing some of the things it does
(like, why have an xor eax,eax *after* the program returns?) I'm
sticking with a super duper simple example:


int foo(int x);


int main(int argc, char* argv[])
{
  int x,y;


  y = 3;


  x = foo(y);
  return 0;
}


int foo(int x)
{
  return ++x;
}


Anyway, if anyone knows of any good books or websites to examine, I
would greatly appreciate it.


Thelonious

















Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.