The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: OceanJeff32 on January 18, 2005, 02:26:09 AM

Title: Fireworks Source Code Offset Jumping with @@
Post by: OceanJeff32 on January 18, 2005, 02:26:09 AM
First of all, I have a quick endorsement to make, if anybody wants an awesome fireworks GDI demo, you can find it at:
http://www.ronybc.8k.com

I have been looking over the code for his Fireworks demo, and just have a simple question, I've seen that @@: label used in the code, and then a reference to JMPing to @B or @F or something similar, I found out that this is offset jumping, but my question is, in what direction, and how can one find the exact JMPed to spot in source code.  I have the intel books describing the opcodes, etc.

Hope someone can clear this up for me, thanks in advance if you can.

Enjoy the fireworks!

Jeff Cummings
(Beginning Win32 Assembly Language Programmer - Hobbyist)
:toothy :lol ;) :8) :green :red
P.S. Ok, I had too much fun with these extra guys...<smile>
Title: Re: Fireworks Source Code Offset Jumping with @@
Post by: hutch-- on January 18, 2005, 03:28:15 AM
Jeff,

Its a notation in MASM for what is called anonymous labels and it is used in places where no meaning ful label name is needed. It works like this,


  @@:
    ; asm code
    cmp condition, value
    je @F       ;  jump forward to the NEXT @@ label
    ; more asm code
    cmp another_condition, anothervalue
    je @B        jump back to the LAST @@ label
  @@:
Title: Re: Fireworks Source Code Offset Jumping with @@
Post by: 00100b on January 18, 2005, 03:29:50 AM
@B means to jump back to the previous instance of the @@ label.
@F means to jump forward to the next instance of the @@ label.

The @@ directive (from what I understand) is a place holder for the Assembler to generate a unique label and the @B/@F directives are place-holders for the Assembler to generate the appropriate jump references to those generated labels.  Kinda makes it easier on us so that we don't have to come up with a bunch of unique label names.

[edit]Too slow[/edit]
Title: Re: Fireworks Source Code Offset Jumping with @@
Post by: OceanJeff32 on January 21, 2005, 12:07:20 AM
Thank you guys, awesome!

I noticed the DEBUG information, the numbers made it look like that, but I didn't know how the program came up with those numbers?

Awesome!

gotta go,

later,

jeff cummings
:bdg