flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > "out of scope" - please, explain...

Author
Thread Post new topic Reply to topic
IronFelix



Joined: 09 Dec 2004
Posts: 141
Location: Russia, Murmansk region
IronFelix 27 Feb 2009, 18:42
Hi all!
Please explain what does it mean "symbol ... out of scope"? What leads to this message and how to avoid it? Give me please some examples.
Thanks.

_________________
Flat Assembler is the best!
Post 27 Feb 2009, 18:42
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 27 Feb 2009, 22:52
This error happens only when you try to forward-reference assembly-time variable (that is, the numerical constant that gets re-defined).

Example of valid forward referencing:
Code:
dd a

a = 1 ; defined just once in code, 
      ; so it's numerical constant and can be forward-referenced    


Example of invalid forward referencing (causing "out of scope" error):
Code:
dd a  ; error happens here 

a = 1

dd a  ; here "a" has value 1

a = 2 ; re-defined, thus it is numerical variable, 
      ; and cannot be forward-referenced

dd a  ; here "a" has value 2    
Post 27 Feb 2009, 22:52
View user's profile Send private message Visit poster's website Reply with quote
IronFelix



Joined: 09 Dec 2004
Posts: 141
Location: Russia, Murmansk region
IronFelix 28 Feb 2009, 10:47
Thank you very much, Tomasz. Now it is clear for me what should be done in such case.
Post 28 Feb 2009, 10:47
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.