How to mov EAX, &func?

Gor Gyolchanyan gor.f.gyolchanyan at gmail.com
Tue May 15 13:51:29 PDT 2012


I think I had that one before. Try this one:
void foo()
{
    void* foopt = cast(void*)&foo;
    asm
    {
        naked;
        mov EAX fooptr;
    }
}

On Tue, May 15, 2012 at 11:33 PM, Mehrdad <wfunction at hotmail.com> wrote:

> How do get the address of a function in naked assembly code?
>
> void foo()
> {
>        asm
>        {
>                naked;
>                mov EAX, &foo;
>        }
> }
>
> This doesn't work...
>



-- 
Bye,
Gor Gyolchanyan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120516/d9499261/attachment.html>


More information about the Digitalmars-d mailing list