www.digitalmars.com         C & C++   DMDScript  

D - inline assembler: unexpected feature

I have a linker constant that I want to refer to. For lack of something
better I declare it as an external function, like so:

extern (C) {
   // external linker constant
   void FREE_KERNEL_SPACE_START_();
}

When I write the following code:

asm {
    lea    ESP, dword ptr [FREE_KERNEL_SPACE_START_]
}

the compiler turns it into

lea    ESP, FREE_KERNEL_SPACE_START_+ EBP

that is, relative to EBP! I have tried various other forms of 'mov', but
most of the time the compiler says "no size for type voidC"
Jan 25 2003