Re: Procedure Calling Conventions (Jacob Navia)
15 Sep 1997 21:29:43 -0400

          From comp.compilers

Related articles
Procedure Calling Conventions (Mr. Yogi) (1997-09-12)
Re: Procedure Calling Conventions (1997-09-15)
Re: Procedure Calling Conventions (Shankar Unni) (1997-09-23)
| List of all articles for this month |

From: (Jacob Navia)
Newsgroups: comp.compilers
Date: 15 Sep 1997 21:29:43 -0400
Organization: Compilers Central
Keywords: architecture, registers

> please suggest me some reference/book on procedure calling conventions
> for intel's x86 family processors. I need to know the
> Caller-save/Callee-save partition of integer and FPU registers.
> [Interesting question, I don't have any references at hand. There are at
> least two popular x86 calling sequences, C (push args right to left and
> caller pops) and Pascal (push args left to right and callee pops), with
> mutants. At least they agree that floating registers are all caller saves
> and nobody seems to worry about FP stack overflow. -John]

There is increasingly popular _stdcall calling convention under
windows: It is like the C procedure call (push right to lefti), but
callee pops, and not the caller. This can be used only for functions
with a fixed number of arguments of course.
[That's the Pascal convention. -John]

Another convention is for floating point: results are returned at the
top of the FPU stack. 64 bit Integers are returned on EAX:EDX
register pair, with the low 32 bits of the result in EAX, high part in

Saved registers:
The registers EBX ESI, EDI and EBP are always saved. All others are destroyed.
The FPU stack is volatile. No compiler/system saves the contents of the FPU

Jacob Navia Logiciels/Informatique
41 rue Maurice Ravel Tel (1)
93430 Villetaneuse Fax (1)
[Is this all written down anywhere? -John]


Post a followup to this message

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