How to mov EAX, &func?

Alex Rønne Petersen alex at lycus.org
Tue May 15 14:58:55 PDT 2012


On 15-05-2012 23:27, deadalnix wrote:
> Le 15/05/2012 21:33, Mehrdad a écrit :
>> How do get the address of a function in naked assembly code?
>>
>> void foo()
>> {
>> asm
>> {
>> naked;
>> mov EAX, &foo;
>> }
>> }
>>
>> This doesn't work...
>
> As it is naked,
>
> mov EAX, EIP;
>
> is enough.

I suspect he wanted a solution where he could load an arbitrary 
function's address.

-- 
Alex Rønne Petersen
alex at lycus.org
http://lycus.org


More information about the Digitalmars-d mailing list