WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Sponsors
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
Hard Drive Recovery
Wiring your own LAN
Personal menu
Welcome Guest
User:
Pass:
Register!
Resend Validation Email
 
Forum
 

Labels of the same name, when a label in an included file has the same name with a label in the current file

kamil
Quote Post


Active Member
***

Group: Members
Posts: 44
Member No.: 46261
Joined: 16-September 11


Good day
What happens when a label in the current file has the same name as a label in one of the included files?
Like
L1:
... ...
jmp L1

and there is an L1 label in one of the included files.
How does Assembler resolves such a situation?

Regards
PMEmail Poster
Top
shoorick
Quote Post


Extremely Active Member
******

Group: Admins
Posts: 2303
Member No.: 160
Joined: 22-June 04


there are different ways.
most preferable is using of local labels. some labels become local automatically (for masm inside proc/endp) etc.
there is also "anonimous" label: "@@", but using of it may appear tricky sometimes.

ja @F ; to nearest @@ forward
... ...
@@:
... ...
jmp @B ; to nearest @@ backward

finally, you may use unic names with meaningful prefixes:


my_proc:
...
my_proc_loop:
...
jz my_proc_done
...
jmp my_proc_loop
...
my_proc_done:
...
ret
PMEmail PosterUsers Website
Top
kamil
Quote Post


Active Member
***

Group: Members
Posts: 44
Member No.: 46261
Joined: 16-September 11


The last option i think is the best.

Thank you, Shoorick
PMEmail Poster
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll

 

Sponsors
Computer Science

Internet
C/C++
Hardware & PC maintenance

HiEditor

General Discussions
Suggestions/Bug Reports
WinAsm Studio

General Discussions
Suggestions/Bug Reports
WinAsm Studio FAQ
Multilingual User Interface
Add-Ins
Assembly Programming

Main
Newbies
Projects
Custom Controls
Snippets
Announcements & Rules

Announcements

General

Online Degrees - Distance Learning
The Heap
Russian
Google