flat assembler
Message board for the users of flat assembler.

Index > Main > Legal label characters

Author
Thread Post new topic Reply to topic
marksibly



Joined: 10 Sep 2003
Posts: 2
marksibly 08 Feb 2004, 01:49
Hi,

The docs are a bit vague on this, so what exactly are the legal characters that can appear within a label?

A forum search reveals that '.' is legal, but not at the start of a label. How about '$'? any others?

Will such labels export correctly?

Bye!
Mark
Post 08 Feb 2004, 01:49
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 08 Feb 2004, 02:30
Hi.
Actually "." is valid symbol even at the begining of the label, only it have a little bit special meaning. Point as first char in label defines so called "local" labels. Actually this means that the label with point will be concatenated with the last used "global" label (i.e. without "." as first char) for form the full name of the label. This allows programmer to create equal names for labels in different parts of code, for example subroutines.
Another case is with labels begining with two points: '..'
Such labels are global, but they did not become "current" global label. Example:
Code:
SomeGlobal1:
    nop
.local1: 
    nop
.local2:
SomeGlobal2:
    nop
.local1: 
    nop
..GlobalNotCurrent:
    nop
.local2:
    ret     Wink
    


In the above example the full names of the labels are:
1) SomeGlobal1
2) SomeGlobal1.local1
3) SomeGlobal1.local2
4) SomeGlobal2
5) SomeGlobal2.local1
6) ..GlobalNotCurrent
7) SomeGlobal2.local2

Regards
Post 08 Feb 2004, 02:30
View user's profile Send private message Visit poster's website ICQ Number 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.