[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rep:Re: Rep:Re: Rep:Re: [f-cpu] Stack handling



On Wed, Jul 24, 2002 at 06:36:13AM +0200, Thomas Lavergne wrote:
> Michael Riepe wrote:
> > Is it so large that you can't convert it to ASCII and post it here?
> 
> I've started to write this paper for with two objectives, first explain 
> the standard call convention, and second take some hints about compiler 
> specific calling convention. So it was not a simple message but a doc 
> about calling convention in FCpu.
> But if you don't want to clic on the link, I can made post on the list 
> (but it was alittle big when it was finished)

Not necessary.

> > On the other hand, we already had this discussion, didn't we?
> > 
> 
> Yes but the objectives of this paper was not to restart a discution 
> about this. And I think the actual call convention was not ok, we have 
> some language/compiler specific feature, and we have thing like frame 
> pointer that was not calling convention related but function prefix code 
> related.

If we want to link the output of several compilers (or written in several
languages), we need to fix things. We also have to define a process<->OS
kernel API.

A single user stack pointer is important for the OS kernel: it
indicates how much stack memory the process has allocated. That does
not mean that the register has to be changed on every push/pop, which
leaves room for optimization.

A frame pointer is not strictly required in any language, but helps with
debugging: programs like gdb use it to trace function calls. Therefore,
all compilers/languages that support a frame pointer must use the same
register.

An explicit "number of arguments" argument, on the other hand, is not
required by most languages. It's the compiler's job to make sure the
number of arguments is correct, except in languages like Lisp (but in
Lisp, you may have to use different calling conventions anyway).

-- 
 Michael "Tired" Riepe <Michael.Riepe@stud.uni-hannover.de>
 "All I wanna do is have a little fun before I die"
*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/