flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
h4ng4m3 07 Aug 2004, 08:10
Code: work: lea ebp, [esp+ebp+14] but below lea does not compile: lea ebp, [ebp+esp+14] |
|||
![]() |
|
Frank 07 Aug 2004, 16:06
Quote: The ESP register cannot be used as an index register. Source: IA-32 Intel Architecture Software Developer's Manual Volume 1: Basic Architecture, p. 70 (or, in their notation, 3-20) |
|||
![]() |
|
Betov 07 Aug 2004, 19:30
After having read this thread, i took a look at the way RosAsm does it. Same problem, here. I just solved it by exchanging the two Registers, when wishable. I don't know how it is in FASM syntax, but, in RosAsm one, we can as well have the Base first or second (and Index second or first), so it seemed to me logical to enable both ways for that case, as well. Just a special condition to be added for SIB with two different Regs with no Scale, and one of the regs being esp...
Betov. |
|||
![]() |
|
JohnFound 07 Aug 2004, 20:30
Yes, FASM allows exchange index and base registers - it is equal to write
[esi+4*edi] or [4*edi+esi]. But in the case of esp, there is special case, so I think it can be considered as "minor bug" and probably Privalov will fix it very quick. Regards. |
|||
![]() |
|
Betov 07 Aug 2004, 21:04
Oh, i wouldn't even say "a minor bug"
![]() Betov. |
|||
![]() |
|
Octavio 07 Aug 2004, 21:05
The problem is that [esp+ebx] uses by default stack segment
while [ebx+esp] is suposed to use data segment. if fasm swap registers the programmer could think erroneously that he is using data segment instead of stack segment. Of course, for flat memory model this is not important but fasm is a generic assembler. Only [ebp+esp] can be exchanged because both registers use stack segment by default, but i don´t consider this a bug, and some times is better than the assembler shows to the programmer that this instruction does not exist instead of arrange the code. |
|||
![]() |
|
pelaillo 07 Aug 2004, 21:25
I agree with Octavio's point of view.
|
|||
![]() |
|
scientica 07 Aug 2004, 22:24
I agree with Ocatvio, privalov better document ths feature
![]() |
|||
![]() |
|
Betov 08 Aug 2004, 08:33
Oh, Yes.
Betov. |
|||
![]() |
|
h4ng4m3 08 Aug 2004, 09:34
[quote="Betov"]Oh, Yes.
quote] M3 too ![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.