flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > LOCAL keeps old value

Author
Thread Post new topic Reply to topic
l4m2



Joined: 15 Jan 2015
Posts: 674
l4m2 15 Aug 2016, 23:17
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: 20422
Location: In your JS exploiting you and your system
revolution 15 Aug 2016, 23:46
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: 674
l4m2 16 Aug 2016, 00:21
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: 20422
Location: In your JS exploiting you and your system
revolution 16 Aug 2016, 00:29
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


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.