flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > "|" instead of " or "?

Author
Thread Post new topic Reply to topic
Azu



Joined: 16 Dec 2008
Posts: 1159
Azu 21 Aug 2009, 02:04
Why isn't "a|b|c" equivalent to "a or b or c"? It is so much more compact.. I want to use it instead..


I tried putting "| equ or" at the top of the file but it doesn't work.. please help Confused
Post 21 Aug 2009, 02:04
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20413
Location: In your JS exploiting you and your system
revolution 21 Aug 2009, 02:09
"|" is a logical operator.

"or" is a binary operator.

It is explained in the fasm manual.
Post 21 Aug 2009, 02:09
View user's profile Send private message Visit poster's website Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1159
Azu 21 Aug 2009, 02:12
Doesn't a binary or work wherever a logical or does?

true logical or false = true
true(1) binary or false(0) = true(1)

How do I make the | work like binary or? It would save much space.. each time, " or " takes 4 characters, "|" would only take 1.. this makes a big difference in readability with long masks.. please help..
Post 21 Aug 2009, 02:12
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 618
cod3b453 22 Aug 2009, 12:33
If what you're ORing doesn't have overlapping bits, you could use +.
Post 22 Aug 2009, 12:33
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.