Searching \ for 'Local labels in macros' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/index.htm?key=local+labels+macros
Search entire site for: 'Local labels in macros'.

Truncated match.
PICList Thread
'Local labels in macros'
1996\10\18@045316 by Stefan Bormann

flavicon
face
Hi folks!

I wonder if there is a simple way to use jump-labels within macros,
which are instanciated more than once. If I use a normal label, the
assembler complains from the second instanciation of the macro on.
Example:

; macro definition:
mymacro         macro
               bla
local_label:    bla
               bla
               goto local_label
               bla
               endm

; main program:
               bla
               mymacro
               bla
               mymacro
               bla

I have found a workaround for this: I number the labels for each
instanciation, but I hope someone knows a simpler and more straight
forward solution than this:

variable        i
mymacro         macro
               i+=1
               bla
local_label#v(i):
               bla
               goto local_label#v(i)
               bla
               endm

Sorry: Maybe the syntax is not correct, I wrote this down from memory
- but it works for me.

--
Stefan Bormann  spam_OUTs.bormannTakeThisOuTspamtu-bs.de

FREMO: ourworld.compuserve.com/homepages/shipmill/inhalt.htm

1996\10\18@080041 by D. R. Chicotel

flavicon
face
At 10:51 AM 10/18/96 +0200, you wrote:
{Quote hidden}

I think you need to use the LOCAL directive.  Try this:

mymacro         macro
               local local_label
               bla
local_label:    bla
               bla
               goto local_label
               bla
               endm

This should give each invocation of the macro its own local copy of the label.

DRC

1996\10\18@084514 by tjaart

flavicon
face
{Quote hidden}

Try :
mymacro macro
       local this_is_a_local_label
       nop
this_is_a_local_label
       nop
       endm

--
Friendly Regards

Tjaart van der Walt
______________________________________________________________
|  Another sun-deprived R&D Engineer slaving away in a dungeon |
|WASP International GSM vehicle tracking and datacomm solutions|
|           +27-(0)11-622-8686 | http://wasp.co.za             |
|______________________________________________________________|

1996\10\18@091439 by Bob Fehrenbach

picon face
Stefan Bormann <.....i1101211KILLspamspam.....WS.RZ.TU-BS.DE> wrote:

>I wonder if there is a simple way to use jump-labels within macros,
>which are instanciated more than once.

Stefan,

  Define the label as local within the macro definition, e.g.:


; macro definition:
mymacro         macro
               local xxx
               bla
xxx:            bla
               bla
               goto xxx
               bla
               endm

--
Bob Fehrenbach    Wauwatosa, WI     EraseMEbfehrenbspam_OUTspamTakeThisOuTexecpc.com


'Local labels in macros'
1996\11\14@124434 by Bob Fehrenbach
picon face
Stefan Bormann <i1101211spamspam_OUTWS.RZ.TU-BS.DE> wrote:
>I wonder if there is a simple way to use jump-labels within macros,
>which are instanciated more than once. If I use a normal label, the
>assembler complains from the second instanciation of the macro on.
>Example:
>
>; macro definition:
>mymacro         macro
>                bla
>local_label:    bla
>                bla
>                goto local_label
>                bla
>                endm
>

Declare the label as local inside the macro:

mymacro    macro
   local local_label     <--  add this
          bla
local_label:
          bla
          goto local_label
          bla
          endm


--
Bob Fehrenbach    Wauwatosa, WI     @spam@bfehrenbKILLspamspamexecpc.com

More... (looser matching)
- Last day of these posts
- In 1996 , 1997 only
- Today
- New search...