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 > LOCAL keeps old value

Author
Thread Post new topic Reply to topic
l4m2



Joined: 15 Jan 2015
Posts: 591
LOCAL keeps old value

Code:
macro d n {
  local x
  rept n \{
    display x
  \}
}
macro f {
  local x
  x#0 equ 123
}
f
rept 61 {
  d 0
}
d 1


f defines x?00 as 123 and d(1) again use the name x?00
Post 15 Aug 2016, 23:17
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15156
Location: GW170817
Yes, that is correct. You can define labels with the same name as local labels. If that is what you want then I guess you can exploit that behaviour for some purpose?

I am only guessing about your actual query here. If you could be more explicit about what you are trying to say/ask then perhaps a better answer could be given.
Post 15 Aug 2016, 23:46
View user's profile Send private message Visit poster's website Reply with quote
l4m2



Joined: 15 Jan 2015
Posts: 591

revolution wrote:
Yes, that is correct. You can define labels with the same name as local labels. If that is what you want then I guess you can exploit that behaviour for some purpose?

I am only guessing about your actual query here. If you could be more explicit about what you are trying to say/ask then perhaps a better answer could be given.

When a lot of local used, it can probably happen that the "local value" was used so the result go against idea
Post 16 Aug 2016, 00:21
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15156
Location: GW170817
Unfortunately local naming rules are not defined within fasm, so they could change in the future, and have changed in the past. So keeping that in mind, just try to ensure that your label naming doesn't clash with local naming.

Appending a single 0 (i.e. with "x#0") is where your problem starts. If you included an underscore ("x#_0") or a dot ("x#.0") or similar, then your label name will be fine.
Post 16 Aug 2016, 00:29
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.