flat assembler
Message board for the users of flat assembler.

Index > Main > Expression verification

Author
Thread Post new topic Reply to topic
Jin X



Joined: 06 Mar 2004
Posts: 133
Location: Russia
Jin X 10 Jul 2018, 08:14
Good day!
Is there a way to verify expression correctness (in fasm 1)?
E.g. something like this:
Code:
macro mova x
{
  if correct <mov x,al>
    mov x,al
  else if correct <mov x,ax>
    mov x,ax
  else if correct <mov x,eax>
    mov x,eax
  else if correct <mov x,rax>
    mov x,rax
  end if
}    

It could be useful feature...
Post 10 Jul 2018, 08:14
View user's profile Send private message Reply with quote
Jin X



Joined: 06 Mar 2004
Posts: 133
Location: Russia
Jin X 10 Jul 2018, 08:16
It can be used for many purposes.
E.g. to detect operand size: https://board.flatassembler.net/topic.php?p=204948
Post 10 Jul 2018, 08:16
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20445
Location: In your JS exploiting you and your system
revolution 11 Jul 2018, 01:04
There is currently no such feature for this. But there are other ways to achieve your suggested example.
Post 11 Jul 2018, 01:04
View user's profile Send private message Visit poster's website Reply with quote
Jin X



Joined: 06 Mar 2004
Posts: 133
Location: Russia
Jin X 12 Jul 2018, 15:46
revolution, how can I do this?
Post 12 Jul 2018, 15:46
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20445
Location: In your JS exploiting you and your system
revolution 12 Jul 2018, 19:30
With match, although it is much more clumsy for what you want to do. You will need to match each syntax you want to support, and perhaps also set some internal flag to indicate successful assembly so that future blocks can be skipped.
Post 12 Jul 2018, 19:30
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8358
Location: Kraków, Poland
Tomasz Grysztar 12 Jul 2018, 19:31
In fasm 1 I think EQTYPE might be a better option to detect various syntactic variants.
Post 12 Jul 2018, 19:31
View user's profile Send private message Visit poster's website Reply with quote
Jin X



Joined: 06 Mar 2004
Posts: 133
Location: Russia
Jin X 20 Aug 2018, 09:08
Tomasz Grysztar wrote:
In fasm 1 I think EQTYPE might be a better option to detect various syntactic variants.
qutype is good instrument but sometimes it needs to many lines of code to detect correctness of expression.
Post 20 Aug 2018, 09:08
View user's profile Send private message 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.