flat assembler
Message board for the users of flat assembler.

Index > Main > a question in the fasm.txt

Author
Thread Post new topic Reply to topic
hume



Joined: 08 Jul 2003
Posts: 4
Location: China
hume 19 Sep 2005, 05:59
in fasm.txt the sample code for display directive is as follows:
bits = 16
display 'Current offset is 0x'
repeat bits/4
d = '0' + $ shr (bits-%*4) and 0Fh
if d > '9'
d = d + 'A'-'9'-1
end if
display d
end repeat
display 13,10

noticed that fasm thought and have higher predence than shr,so should it more correct to write as?
d = '0' + ($ shr (bits-%*4)) and 0Fh
Post 19 Sep 2005, 05:59
View user's profile Send private message MSN Messenger Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20422
Location: In your JS exploiting you and your system
revolution 19 Sep 2005, 07:56
'shl' and 'shr' are priority 4, 'and', 'or' and 'xor' are priority 3. So 'shr' is higher prioity than 'and'.
Post 19 Sep 2005, 07:56
View user's profile Send private message Visit poster's website Reply with quote
hume



Joined: 08 Jul 2003
Posts: 4
Location: China
hume 19 Sep 2005, 08:22
oh,sorry,I get the priority table with those tables see normally in c/c++,without carefully notice that the table seq is reverse from those.
a stupid mistake...
Post 19 Sep 2005, 08:22
View user's profile Send private message MSN Messenger Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 21 Sep 2005, 07:15
Hmm, but why is it so...shouldn't "the first priority" be the highest one Confused
Post 21 Sep 2005, 07:15
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger 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.