anyone could tell me what those jmp @? mean? gosh, i really stupid noobee that i ignore that it is on masm help but got nothing from it :(
where this wierd jmp @ was define? is B for before and F for after? i see there always @@ pair with these wierdy.

thanks
Posted on 2003-01-14 20:51:56 by dion
took me a while to figure them out, too :)

they're anonymous jumps and labels...

xor ax,ax
jmp @F ;jump Forward to the next anonymous label
inc ax
@@: xor bx,bx
jmp @B ;jump Back to the last anonymous label

this "program" would set the value of ax to zero, jump to the @@, xor bx, and get stuck in a loop.
Posted on 2003-01-14 21:10:29 by jademtech
thanks jademtech, so it is Forward and Backward, not so diff with aFter and Before ;)
Posted on 2003-01-15 01:52:48 by dion
Dion,

If you can get used to them, the @B and @F reference to @@: labels is very useful, especially when you are working at close range on an algorithm. It saves you having to invent new names all the time and you get clearer code for it.

Regards,

hutch@movsd.com
Posted on 2003-01-15 02:21:34 by hutch--

It saves you having to invent new names all the time


Exactly, that's I wouldn't be able to live with out the @@/F/B, my lable naming procedure is badly out of alignment... ;) :stupid:
Posted on 2003-01-15 09:15:42 by scientica
To all,
Don't get too happy with them. I have found that sometimes the JMP @B/@F cannot find their labels doing a /Sn assembly. When using the /Sa option, it works fine. Weird. Ratch
Posted on 2003-01-15 13:07:09 by Ratch
I don't use those switches (I don't remember what they do, but probably nothing dead important since I can't recall using them), so I've never had any such problems.
Posted on 2003-01-15 13:59:47 by scientica
At least don't use them in macros since you won't see the label when the macro expands but it will not be local to the macro so jxx @b/f will jump inside the macro...

Thomas

P.S. Real men don't use labels anyway, they just hardcode the relative offsets ;)
Posted on 2003-01-15 14:30:53 by Thomas
And, real men don't code with assembly, they write raw binary code :grin:
Ok, it's not very handy... Takes too long when doing something large.

-Stealth
Posted on 2003-01-15 14:36:54 by Stealth
Stealth
Ok, it's not very handy... Takes too long when doing something large.

But fun, cool, 1337 and just so real mens work (ok, the females on the board may add "wo" before men if they like ;)) ...

And everything that's lagre takes time to write, ofcourse with the exception from apps written in/with VB, C++, etc .... :tongue: :grin: :grin:
Posted on 2003-01-15 14:59:46 by scientica
Yep, it's quite 1337 to write apps entirely in binary, but seriously, you don't usually gain anything, when comparing to things written in asm (unless your assembler doesn't support some instruction, and still, you can write the rest in asm).

But what the heck, all we need is a hex (or more better, binary mode) editor :grin:

-Stealth
Posted on 2003-01-15 15:36:48 by Stealth
woah... thanks guy filling my threads ;)
Posted on 2003-01-16 05:22:07 by dion
Dion, sorry for hijacking your thread :grin:

-Stealth
Posted on 2003-01-16 16:49:49 by Stealth
Personally, I don't use @@/@B and @F... I find that a long, overly descriptive label name also doubles as a comment. And since I usually use such long label names only for short IF/ELSEIF stuff, it doesn't matter too much that the label is long, since I'm just going to type it for that IF statement.
Posted on 2003-01-16 22:37:07 by AmkG
I use them alot... they are very handy to have... I guess i use them most with text manipulaton algo's:



lea esi, lpString
xor eax, eax
@@:
mov al, [esi]
.if( eax == NULL )
jmp @F
.elseif( ( eax > 40h)&&(eax < 5Bh) )
and eax, 0DFh ;; To Upper Case
;; or eax, 020h ;; To lower Case
mov [esi], al
.endif
inc esi
jmp @B
@@:

; Null found...



:NaN:
Posted on 2003-01-17 10:46:24 by NaN
What is the scope? Or lifetime of these? Is that the correct terminology?

If you use @@ within a certain range how does @F and @B know which one you are talking about.

So can you use @@ only once within a proc or something?

Thanks,
Posted on 2003-01-17 20:47:01 by gorshing
Gorshing,
The @@: label defines a local code label, which is in effect until
the next instance of @@:. The @F and @B operands can be used in
conditional and unconditional jump statements to jump to the next
and previous @@: label respectively.

The @@: label is useful for defining a nearby jump point where a
full label is not appropriate.

The MASM Reference tell you everything you need to know. Just seach for
"local code labels". :alright:
Posted on 2003-01-17 20:59:59 by natas
There is no limit to how many you can use (in a proc or not).

The thing to remember is that when ever a @F or @B is found the *FIRST* @@: found going forward or backward in the source will be the destination. This is why its not advised to use them in macro's, cause they *hide* their contents. If there was a loop like my example above, stored into a macro and you did code like:

mov edx, 8
@@: <<< Third @@ back, due to the TO_UPPER MACRO (not the first)
mov esi,
TO_UPPER esi ; <<< my macro example above
dec edx
jnz @B

It would fail to work, creating WIERD results. This is because the next @@: found while jumping back is actually found in the MACRO's souce, not the shown source above.

NaN
Posted on 2003-01-18 16:42:22 by NaN