News:

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

Label, forward reference and opattr

Started by jj2007, June 08, 2009, 09:26:19 PM

Previous topic - Next topic

jj2007

I am aware of this thread, but it didn't solve my problem:

codesize macro algo
  print "size="
  mov eax, offset &algo&_END-&algo&
  print str$(eax), 13, 10
ENDM
...
MyAlgo proc
  ret
MyAlgo endp
MyAlgo_END:


That works. However, I would like to check whether MyAlgo_END exists, and there I am in trouble:
- ifndef fails:
         tmp$ CATSTR <algo>, <_END>
         ifdef tmp$
.. and various other constructs like &algo&_END etc return either always "defined" or always "undefined".
- opattr fails for MyAlgo_END because it is a forward reference
Now my question:
opattr works for MyAlgo because MyAlgo is a proc and defined via PROTO. Is there a similar way to pre-define the label?
Thanks for any hint.

EDIT: I found the solution (in an old code of mine ::))

Externdef MyAlgo_END:NEAR