flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > 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: 598
How to tell eax, eax+ecx, 5*eax+3 from eax+ebx+ecx, 12*eax

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: 598
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: 1211
Location: Greece
I accidentally deleted the post, sorry about this.


Code:

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

lea eax, [eax+2*eax]
shl eax2  


Post 15 Apr 2016, 08:15
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15312
Location: Bigweld Industries

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: 598

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: 15312
Location: Bigweld Industries
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: 598
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: 15312
Location: Bigweld Industries
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
Assembly Artist


Joined: 16 Jun 2003
Posts: 6677
Location: Kraków, Poland
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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.