flat assembler
Message board for the users of flat assembler.

Index > Main > can't put dot at start of label

Author
Thread Post new topic Reply to topic
karl



Joined: 07 Feb 2006
Posts: 63
Location: South Africa
karl
i have a label called .customhost
when i say 'je .customhost' fasm complains 'undefined symbol'

problem goes away if i take away the leading dot. and funnily enough 2 lines before says 'je .localhost' which it doesn't complain about.

i'm using 1.65.12 (also tried with 1.64), win32
Post 07 Feb 2006, 10:12
View user's profile Send private message Reply with quote
okasvi



Joined: 18 Aug 2005
Posts: 382
Location: Finland
okasvi
fasm.pdf wrote:
The label whose name begins with dot is treated as local label, and its
name is attached to the name of last global label (with name beginning with
anything but dot) to make the full name of this label. So you can use the
short name (beginning with dot) of this label anywhere before the next global
label is defined, and in the other places you have to use the full name. Label
beginning with two dots are the exception – they are like global, but they
don’t become the new prefix for local labels.


Code:
proc test
  invoke lstrcmpi, szSomething, szSomething2
  test eax, eax
  jz .here
  invoke lstrcmpi, szBleh, szBleh2
  test eax, eax
  jz .there
  jmp.quit
.here:
  xor eax, eax
 jmp .quit
.there:
 mov eax,1
.quit:
  ret
endp
    


i hope this made it clear Smile

_________________
When We Ride On Our Enemies
support reverse smileys |:
Post 07 Feb 2006, 10:40
View user's profile Send private message MSN Messenger Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
or if it doesn't than this should:
Code:
a:          ;namespace 'a'
.sub1:      ;a.sub1
jmp .sub1   ;jumps to a.sub1
jmp a.sub1  ;jumps to a.sub1
jmp b.sub1  ;jumps to b.sub1
b:          ;namespace 'a'
.sub1:      ;b.sub1
jmp .sub1   ;jumps to b.sub1
jmp a.sub1  ;jumps to a.sub1
jmp b.sub1  ;jumps to b.sub1
b.sub2:     ;namespace 'b.sub2'
.sub1:      ;b.sub2.sub1
jmp .sub1   ;jumps to b.sub2.sub1
jmp b.sub2.sub1  ;jumps to b.sub2.sub1
... etc ...    
Post 07 Feb 2006, 10:45
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
karl



Joined: 07 Feb 2006
Posts: 63
Location: South Africa
karl
wicked thanx. should have read fasm.pdf more carefully.
Post 07 Feb 2006, 10:53
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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.