flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Code can't be generated?

Author
Thread Post new topic Reply to topic
l4m2



Joined: 15 Jan 2015
Posts: 674
l4m2 19 Feb 2015, 10:55
Code:
  rept 10 i:0 {
    if ~defined int_#i
      int_#i:
        mov al,i
        iret
    end if
  }     
Post 19 Feb 2015, 10:55
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20445
Location: In your JS exploiting you and your system
revolution 19 Feb 2015, 11:04
Post 19 Feb 2015, 11:04
View user's profile Send private message Visit poster's website Reply with quote
l4m2



Joined: 15 Jan 2015
Posts: 674
l4m2 19 Feb 2015, 11:23


So the reason is that the definition itself made it not to define and a loop happened ?
Post 19 Feb 2015, 11:23
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 20 Feb 2015, 20:07
l4m2,

It's all about prediction. fasm uses data from previous pass to deduce whether that symbol is going to be defined.
Post 20 Feb 2015, 20:07
View user's profile Send private message Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc 20 Feb 2015, 22:31
baldr
It is more important to understand the conceptual reasoning than the technical. Conceptually the source code makes a contradictory statement that cannot be true (a label must be defined if it's not defined and must not be defined if it is), and compilation is a process of finding such conditions that all the statements in the source are true, which is not possible in this case.

_________________
Faith is a superposition of knowledge and fallacy
Post 20 Feb 2015, 22:31
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.