How to mov EAX, &func?

Mehrdad wfunction at hotmail.com
Tue May 15 20:41:10 PDT 2012


On Tuesday, 15 May 2012 at 21:58:56 UTC, Alex Rønne Petersen 
wrote:
> 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.

indeed


More information about the Digitalmars-d mailing list