flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > fasm if cycle syntax

Author
Thread Post new topic Reply to topic
filox



Joined: 13 Feb 2013
Posts: 11
filox 22 Aug 2019, 15:56
Hi,
POINT 1:

if ~1 eq 0
display "ok! - BITWISE",0xA
end if

if ~1 eq
display "ok! - NULL",0xA
end if

if 0 eq ~1
display "ok! - ZERO",0xA
end if

I think last display directive don't show cause cycle don't read ~ character.
Is there another way to adapt it?

POINT 2:
Is there a way to make more complex if?
example:

if (%>=33 & %<=126) | (%>=200 & %<=500)

Thanks Smile
Post 22 Aug 2019, 15:56
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8354
Location: Kraków, Poland
Tomasz Grysztar 22 Aug 2019, 21:27
This is in fact one of the reasons why in fasmg EQ operator no longer does compare token sequences (it has to be done with MATCH instead) but only values of valid sub-expressions. The way EQ works in fasm 1 is a bit problematic on boundaries. In your first two samples "~" character is a negation of logical condition "1 eq 0" or "1 eq", while in the third sample "~" is just a part of the compared token sequences - it compares "0" with "~1".

As for the second question, yes - you can create complex conditions with help of logical operators.
Post 22 Aug 2019, 21:27
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.