flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > "defined" directive with floating point literals.

Author
Thread Post new topic Reply to topic
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
Is there a reason for the following to not compile?
Code:
if defined 2.3
  display 'yes',13,10
else
  display 'no',13,10
end if    


Floating point numbers are defined to be valid numeric expressions.

_________________
Faith is a superposition of knowledge and fallacy
Post 20 Nov 2015, 15:47
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7756
Location: Kraków, Poland
Tomasz Grysztar
I'd qualify this as a bug. The floating point numbers are a special type of value that is allowed only in a few specific places and almost no operators can be applied to them, that is probably the reason why I overlooked this.
Post 20 Nov 2015, 17:59
View user's profile Send private message Visit poster's website Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
That was exactly my guess. But at the same time I was positively surprised about not encountering a similar bug in the context of relativeto .

_________________
Faith is a superposition of knowledge and fallacy
Post 21 Nov 2015, 02:00
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7756
Location: Kraków, Poland
Tomasz Grysztar
Turns out that this case was already implemented, too - but it contains a bug, one of the constants defining the adjustment to the source pointer in EXPRCALC.INC is wrong:
Code:
defined_fp_value:
        add     esi,12
        jmp     expression_checked    
It should be 13 there.
Post 05 Dec 2015, 13:23
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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.