flat assembler
Message board for the users of flat assembler.

Index > Main > Not Local labels in proc?

Author
Thread Post new topic Reply to topic
alorent



Joined: 05 Dec 2005
Posts: 221
alorent 07 Jan 2006, 10:11
Hello,

If I have:

Myproc1 proc

mylabel:
mov eax, eax
ret

endp

and

Myproc2 proc

mylabel:
mov eax, eax
ret

endp

I get "mylabel" as redefined variable. Ain't labels locals to "proc" like in MASM?

Cheers
Post 07 Jan 2006, 10:11
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 07 Jan 2006, 10:18
"proc" is just a macro, so assembler itself doesn't see anything special about it, thus the labels are defined as everywhere else. On the other hand, it allows you to jump to any such label from any place.

In fasm there's however the label localization scheme borrowed from NASM, that can be used in such cases:
Code:
Myproc1:
 .mylabel: ; defines label local to Myproc1

Myproc2:
 .mylabel: ; defines label local to Myproc2    
Post 07 Jan 2006, 10:18
View user's profile Send private message Visit poster's website Reply with quote
alorent



Joined: 05 Dec 2005
Posts: 221
alorent 07 Jan 2006, 10:40
great! Very Happy

Thanks.
Post 07 Jan 2006, 10:40
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.