Ok. I've readed 2 books and god knows how much material on the net about assemly programming, but I have never came across text explainig why some people put @ and @@ before jump labels. Could anybody explain that to me?
PS. maybe I'm just so stupid...
PS. maybe I'm just so stupid...
Well, I know that @@ is a local label you use when you don't want to put a name to it...
However I have no idea of why some labels have a name, and begin with @ and @@... I'd be interested in the answer too :grin:
cmp eax,1
je @F ;this jumps FORWARD to the next @@
; do some stuff...
@@: ;more stuff...
cmp eax,2
je @B ;this jumps BACKWARDS to the previous @@
However I have no idea of why some labels have a name, and begin with @ and @@... I'd be interested in the answer too :grin:
NaN: Thanks for the link :)
Still, how come sometimes I see labels like this?
Why the @ and @@ in the beginning of the label name?
:confused:
Still, how come sometimes I see labels like this?
@MyLabel:
cmp eax,1
je @@MyOtherLabel
; do some stuff...
cmp edx,5
jb @MyLabel
@@MyOtherLabel:
Why the @ and @@ in the beginning of the label name?
:confused:
If others are like me... Then, it is completely a habitual thing. :)
I create local labels (visible only inside a file) prefixed by '?' so that I know it is a local thing when I read it later. Some people prefer '@', and others have their own rules.
I create local labels (visible only inside a file) prefixed by '?' so that I know it is a local thing when I read it later. Some people prefer '@', and others have their own rules.
Hi QvasiModo,
Anything ending in a single colon (:) is a local label i.e.
lable: ; is local
for global labels in MASM you must use a double colon (::)
lable:: ; is global
Anything ending in a single colon (:) is a local label i.e.
lable: ; is local
for global labels in MASM you must use a double colon (::)
lable:: ; is global
Since we are on WTHs
why are some people just crazy with underscores?
_myvar
my_long_ass_blahlah_blah
its ugly as hell :)
why are some people just crazy with underscores?
_myvar
my_long_ass_blahlah_blah
its ugly as hell :)
It more readable than MYLONGASSBLAHLAHBLAH
I used mixed case:
MyLongAssBlahBlah
MyLongAssBlahBlah
right on! :alright:
I think all variables show actually say something too, like:
Like WindowHandle instead of hWnd.etc..
I used hungarian notation at one time and grew sick of it.
EDIT: I'm happy, two people typed ass not in anger! lol
I think all variables show actually say something too, like:
Like WindowHandle instead of hWnd.etc..
I used hungarian notation at one time and grew sick of it.
EDIT: I'm happy, two people typed ass not in anger! lol
Hi QvasiModo,
Anything ending in a single colon (:) is a local label i.e.
lable: ; is local
for global labels in MASM you must use a double colon (::)
lable:: ; is global
Thanks for the tip, donkey! :alright:
I used mixed case:
MyLongAssBlahBlah
MyLongAssBlahBlah
So do I, I think it's more descriptive. But I always end up with the bad habit of using @1, @2, @3... just because I'm a lazy programmer. :grin:
For me its mainly cause of its name "At".
ie. jmp @Error
"Jump at Error" (its how my mind 'says' it while programming).
:NaN:
ie. jmp @Error
"Jump at Error" (its how my mind 'says' it while programming).
:NaN:
I think @@ prefix is a habit whom used to tasm. Because it's already assumes(if any other prefered) @@ is a local variable where prefixed. Nowadays most people using masm32 and it has a @@ as a different purpose but not a prefix. Anyway, if this is not a habit from tasm usage, then it is nothing, meaningless, decoration, i think so.
Regards
Regards
Anonymous labels are good to have, but I find myself moving away from using them and I like it better. :)
since i do lots and lots and lots of loops
mine are normally named LoopA LoopA_1 LoopB_1 but i think loopd is one im not allowed to use lol...
but this helps me when im translating files and lets me know what step im at...
mine are normally named LoopA LoopA_1 LoopB_1 but i think loopd is one im not allowed to use lol...
but this helps me when im translating files and lets me know what step im at...