Kernel Calling Conventions



Depends on the situation. With stack you can pass more variables
into the system call. It can be a pain when the register's contents
change after the syscall. But if the parameters of the call are set
minimum , registers can be used without using more memory
for the stack operations.

It depends on your application. For limited memory, I would
go for registers..

john


On 19 Mar 2006 13:14:04 -0800, "Kroll" <spamtrap@xxxxxxxxxx> wrote:

Greetings all,
I was reading the "FreeBSD Assembly Language Programming" tutorial
(http://www.int80h.org/bsdasm/), when I came across something that
piqued my curiosity.

The C calling convention is touted as being more convenient, and
superior to the calling convention used by linux and microsoft of
passing arguments within registers. I was wondering if this is just a
bias on the part of the writer or what.

What are the actual advantages of popping the arguments onto to the
stack as opposed to passing them via registers?

Thanks in advance, :)
Kyle

.



Relevant Pages

  • Re: Kernel Calling Conventions
    ... The C calling convention is touted as being more convenient, ... passing arguments within registers. ... calling convention is to use registers and not the stack. ... over the DJGPP GCC based compiler, is due to the fact that the OW ...
    (comp.lang.asm.x86)
  • Re: Statement on Schildt submitted to wikipedia today
    ... you discover that Schildt was libeled. ... It turns out that, on this particular architecture, some registers are saved ... The problem is, even though indeed this implementation has "a stack", if you ... end up adjacent to one of our newest automatic variables. ...
    (comp.lang.c.moderated)
  • Re: Kernel Calling Conventions
    ... The C calling convention is touted as being more convenient, ... passing arguments within registers. ... stack as opposed to passing them via registers? ... by the C compiler or tell the C compiler to "reoptimize" your assembly code. ...
    (comp.lang.asm.x86)
  • Re: Geriatric Pentium
    ... processor scavenging spare ram cycles to back it up to ram and restore ... Let's say I had hardware for 128 registers. ... Ditto for caching the stack. ... PUSHL P+2;; take parameter #2 and push it ...
    (comp.lang.java.advocacy)
  • Re: [OT] PostLisp, a language experiment
    ... >> that a C compiler generates code to arrange the parameters where it ... > value from the user stack. ... > can be simply passed in registers. ... common for the top stack item to reside in a register, ...
    (comp.lang.lisp)