flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Bug or not a bug?

Author
Thread Post new topic Reply to topic
CandyMan



Joined: 04 Sep 2009
Posts: 414
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan 30 Oct 2014, 17:43
Code:
Fill rb (($ mod $200)>0)*128 ; invalid argument
    

_________________
smaller is better
Post 30 Oct 2014, 17:43
View user's profile Send private message Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc 30 Oct 2014, 22:19
CandyMan
Even though the term of a logical operator is a bit mixed up in the manual, fasm neither casts logical values into numeric values nor it provides operators able to take logical arguments and return a numeric value. You can't use a logical value anywhere except as an argument of if/else if/while/assert or as an argument of one of the 3 logical operators: ~, &, |. In particular you can't multiply a logical value by something.

_________________
Faith is a superposition of knowledge and fallacy
Post 30 Oct 2014, 22:19
View user's profile Send private message Reply with quote
CandyMan



Joined: 04 Sep 2009
Posts: 414
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan 31 Oct 2014, 15:02
Thank you.

_________________
smaller is better
Post 31 Oct 2014, 15:02
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 01 Nov 2014, 06:34
CandyMan,

To test for non-zero value you may use x or -x bithack:
Code:
rb (($ mod $200) or -($ mod $200)) shr 1 and 128    
Post 01 Nov 2014, 06:34
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.