flat assembler
Message board for the users of flat assembler.

Index > Main > How to tell eax, eax+ecx, 5*eax+3 from eax+ebx+ecx, 12*eax

Author
Thread Post new topic Reply to topic
l4m2



Joined: 15 Jan 2015
Posts: 674
l4m2 15 Apr 2016, 07:35
Code:
LEA EAX, [EAX] ;OK
LEA EAX, [EAX+ECX] ;OK
LEA EAX, [5*EAX+3] ;OK, TURNED INTO 4*EAX+EAX+3
LEA EAX, [EAX+EBX+ECX] ;COMPILE ERROR
LEA EAX, [12*EAX] ;COMPILE ERROR    
Post 15 Apr 2016, 07:35
View user's profile Send private message Reply with quote
l4m2



Joined: 15 Jan 2015
Posts: 674
l4m2 15 Apr 2016, 08:15
Thanks but I meant that[EAX+EBX+ECX] EQTYPE [EAX+EBX] will return true, but I want to split them, not asking how to get the value of EAX+EBX+ECX or 12*EAX
Post 15 Apr 2016, 08:15
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1389
Location: Piraeus, Greece
Picnic 15 Apr 2016, 08:15
I accidentally deleted the post, sorry about this.

Code:
;LEA EAX, [12*EAX] ;COMPILE ERROR

lea eax, [eax+2*eax]
shl eax, 2  
    
Post 15 Apr 2016, 08:15
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20301
Location: In your JS exploiting you and your system
revolution 15 Apr 2016, 08:25
l4m2 wrote:
Thanks but I meant that[EAX+EBX+ECX] EQTYPE [EAX+EBX] will return true, but I want to split them, not asking how to get the value of EAX+EBX+ECX or 12*EAX
Use MATCH.
Post 15 Apr 2016, 08:25
View user's profile Send private message Visit poster's website Reply with quote
l4m2



Joined: 15 Jan 2015
Posts: 674
l4m2 15 Apr 2016, 08:28
revolution wrote:
Use MATCH.
and make an analyser?
Post 15 Apr 2016, 08:28
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20301
Location: In your JS exploiting you and your system
revolution 15 Apr 2016, 08:33
Sure, if that is what you want to do. But until you explain your goal we can only keep guessing about what you want.
Post 15 Apr 2016, 08:33
View user's profile Send private message Visit poster's website Reply with quote
l4m2



Joined: 15 Jan 2015
Posts: 674
l4m2 15 Apr 2016, 08:36
I want to calculate the address with some commands when it is not possible to use a SIB to find it
Post 15 Apr 2016, 08:36
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20301
Location: In your JS exploiting you and your system
revolution 15 Apr 2016, 09:06
You didn't mention the input set restrictions so unless you have a some restricted input set then a full parser will likely be needed.
Post 15 Apr 2016, 09:06
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 15 Apr 2016, 13:58
It is worth noting that fasm g offers much better facilities in this regard, since it allows to extract the coefficients and variables of such linear polynomial and this is how it processes the SIB expressions in the 80386 macros.
Post 15 Apr 2016, 13:58
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.