flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Compiler Internals > "defined" directive with floating point literals.

Author
Thread Post new topic Reply to topic
l_inc



Joined: 23 Oct 2009
Posts: 868
"defined" directive with floating point literals.
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
Assembly Artist


Joined: 16 Jun 2003
Posts: 6255
Location: Kraków, Poland
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: 868
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
Assembly Artist


Joined: 16 Jun 2003
Posts: 6255
Location: Kraków, Poland
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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.