The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Jimg on August 12, 2008, 04:19:05 PM

Title: What's happening here?
Post by: Jimg on August 12, 2008, 04:19:05 PM
I've spent over an hour trying to figure out what's happen here.  I'm sure is a really stupid simple mistake, but I just can't see it.

.nolist
include \masm32\include\masm32rt.inc
.listall

.data
.code
program:

    xor eax,eax
    jnz @f
    inkey
@@:   
    exit
end program

gives error--

K:\tst3 \masm32\BIN\ML /c /coff /Cp /nologo /Fm /Zi /Zd /I"\masm32\INCLUDE" tst.
asm
Assembling: tst.asm
tst.asm(10) : error A2006: undefined symbol : @@


Works fine without the /Zi /Zd debug switches.

So what the heck am I doing wrong here?  I swear it's worked in the past.
Title: Re: What's happening here?
Post by: Tedd on August 12, 2008, 04:30:41 PM
You're not doing anything wrong, it's a stupid masm bug :wink

It's because the label appears immediately after a macro call.
I can't actually test right now, but try adding a space before the "@@:", or insert a blank line before it, failing that insert a comment.
Title: Re: What's happening here?
Post by: Jimg on August 12, 2008, 04:38:28 PM
I just tried this with the same result-
    xor eax,eax
    jnz @f
;x
    inkey
;y

; this is a test

mov eax,1

@@:

   
    exit


everything works fine if I use actual labels rather then the @@ type labels.
Title: Re: What's happening here?
Post by: MichaelW on August 12, 2008, 05:57:13 PM
The problem appears to be /Zi or /Zd in combination with a macro that changes to the data section (reparg in this case). YAMB
Title: Re: What's happening here?
Post by: Sarel on August 12, 2008, 07:28:54 PM
I copied and pasted it in qeditor. It assembles and links just fine.

Sometimes when I copy and paste some portions, the same problem happens. Then I need to comment those parts and retype them again. I hope this helps.
Title: Re: What's happening here?
Post by: Jimg on August 13, 2008, 04:10:36 AM
Absolute correct Michael, and it doesn't even need a macro-

I just tried this with the exact same results:

program:
  xor eax,eax
  jnz @f
.data
  abcd dd 1
.code     
@@:   
    ret
end program