'naked' keyword

Duane Bailey bailey.d.r at gmail.com
Fri Jan 2 16:39:48 PST 2009


bearophile Wrote:


> From my very limited experiments with naked functions I think I may enjoy to add some I/O into naked functions: to be able to define new variables before the asm and to copy registers into some variable before the final return. What I am asking here may make useless the "naked" attribute, in such case please ignore what I have said here.

The problem is, the 'naked' keyword remove the prologue and epilogue, which set up the stack frame, i.e. allocates space for variables. So any D code used in a naked function must A) either not use any stack space, a tricky proposition, or B) wait until a bit of assembly does the prologue itself.

Cheers!

-Duane



More information about the Digitalmars-d mailing list