This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

What's the best way to define local labels in an assembler macro?


Hi all:

What's the best way to define local labels in an assembler macro?

I read the GNU Assembler manual, but I still cannot figure it out. Say you've got some complicated nested macros invocations like this:

? .macro MACRO_A

??? local_label_1:
??? local_label_2:

??? MACRO_B local_label_2?? // Passes one of the local labels down.

??? jump local_label_1

? .endm

The questions are:

1) Defining a label like "1:" does not make it local to the macro, right?
2) Appending "$" to the macro name helps a little, but it still isn't watertight, is it?
3) Can pseudo-variable \@ help? How does it behave in nested macro invocation scenarios?
4) Is .altmacro and its "LOCAL xxx" syntax the only safe way?

Please copy me on the answers, as I'm not subscribed to this list.

Thanks in advance,
? rdiez


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]