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 > backward label undefined

Author
Thread Post new topic Reply to topic
CandyMan



Joined: 04 Sep 2009
Posts: 214
Location: film "CandyMan" directed through Bernard Rose
backward label undefined

Code:
if Z-Y>0
@@:
else
@@:
end if
jnz @B  ;undefined symbol
Y:
db 0
Z:


_________________
smaller is better
Post 03 Apr 2017, 07:44
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6517
Location: Kraków, Poland
The @@ label implementation in fasm 1 is in the parser stage before the actual assembly takes place and therefore it is not affected by IF conditions. The "@B" in your sample refers to the second "@@" regardless whether the line later is assembled or not.

You can look at it as if the parser created an unique name for each @@ label (like what fasm's preprocessor does for LOCAL labels) and this is how your sample then looks like to the assembler:

Code:
if Z-Y>0
anonymous1:
else
anonymous2:
end if
jnz anonymous2
Y:
db 0
Z:

The new fasmg engine has no such limitations since it got rid of a separate stages.


Last edited by Tomasz Grysztar on 03 Apr 2017, 08:35; edited 1 time in total
Post 03 Apr 2017, 08:28
View user's profile Send private message Visit poster's website Reply with quote
CandyMan



Joined: 04 Sep 2009
Posts: 214
Location: film "CandyMan" directed through Bernard Rose
all right, I thank for the explanation.

_________________
smaller is better
Post 03 Apr 2017, 08:35
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


Powered by phpBB © 2001-2005 phpBB Group.

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