Thread overview |
---|
December 08, 2008 Inline Assembler: Getting the offset of a label. How? | ||||
---|---|---|---|---|
| ||||
Hello d folk, I have a question about D 1.0 inline asm. Has anyone an idea how to get the offset of a label without using "call Label1", then "pop eax". Actually there would be an offsetof but it seems not to work. In other (inline) assemblers I'd just use offset or addr, but it seems that my Win32 DMD 1.037 does not understand it. I'd be really helpful for any solution, because I need it to write position independend code. Thanks. regards, pimp |
December 08, 2008 Re: Inline Assembler: Getting the offset of a label. How? | ||||
---|---|---|---|---|
| ||||
Posted in reply to poly | poly Wrote:
> I have a question about D 1.0 inline asm. Has anyone an idea how to get the offset of a label without using "call Label1", then "pop eax". Actually there would be an offsetof but it seems not to work.
mov eax, Label1
|
December 08, 2008 Re: Inline Assembler: Getting the offset of a label. How? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kagamin | Kagamin schrieb:
> poly Wrote:
>
>> I have a question about D 1.0 inline asm. Has anyone an idea how to get the offset of a label without using "call Label1", then "pop eax". Actually there would be an offsetof but it seems not to work.
>
> mov eax, Label1
Hi Kagamin,
I've just tried this piece of Code:
[snip]
asm
{
call Label1;
Label1: pop ECX;
mov EAX, Label1; //error reported on this line
}
[/snip]
And I still got an error like: "undefined identifier 'Label1'".
Do you have maybe another solution or know whats wrong here? Thanks.
regards, the pimp
|
December 09, 2008 Re: Inline Assembler: Getting the offset of a label. How? | ||||
---|---|---|---|---|
| ||||
Posted in reply to poly | poly Wrote:
> asm
> {
> call Label1;
> Label1: pop ECX;
> mov EAX, Label1; //error reported on this line
> }
I tried several tricks, seems like compiler doesn't support this.
|
Copyright © 1999-2021 by the D Language Foundation