flat assembler
Message board for the users of flat assembler.
Index
> Main > lea: bug or feature? |
Author |
|
Madis731 18 Oct 2004, 07:02
Works for me, I don't know where the problem is?
I have to see the full code... |
|||
18 Oct 2004, 07:02 |
|
Joshua 18 Oct 2004, 07:40
This has to do with relocations, search the board for a more complete answer.
A workarouns is this: Code: virtual dd var2 load var2.offset dword from $-4 end virtual lea esi,[edi-var2.offset] |
|||
18 Oct 2004, 07:40 |
|
Dunduk 18 Oct 2004, 08:04
Yes, this is solution, but code:
Code: lea esi,[edi+var2] works fine without any "virtual" tricks. What's the difference between these two cases? |
|||
18 Oct 2004, 08:04 |
|
JohnFound 18 Oct 2004, 08:39
var2 - var 1 is positive value.
var1 - var2 is negative. AFAIR, Windows can't relocate negative offsets. For detailed explanation look here: http://board.flatassembler.net/topic.php?t=37 Regards. |
|||
18 Oct 2004, 08:39 |
|
Dunduk 18 Oct 2004, 08:50
Thanks for answer JohnFound. I've tried to find answer on forum but failed. Thanks for the link too.
|
|||
18 Oct 2004, 08:50 |
|
Dunduk 18 Oct 2004, 09:30
That's me again.
I've thought a little and found that (var1-var2) is negative number, but not offset. And Code: lea esi,[edi-number] is legal instruction... What the difference between (-var1+var2) and (var2-var1)? |
|||
18 Oct 2004, 09:30 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.