News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Fireworks Source Code Offset Jumping with @@

Started by OceanJeff32, January 18, 2005, 02:26:09 AM

Previous topic - Next topic

OceanJeff32

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>
Any good programmer knows, every large and/or small job, is equally large, to the programmer!

hutch--

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
  @@:
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

00100b

@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]

OceanJeff32

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
Any good programmer knows, every large and/or small job, is equally large, to the programmer!