This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
What's the best way to define local labels in an assembler macro?
- From: "R. Diez" <rdiezmail-binutils at yahoo dot de>
- To: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Mon, 30 Apr 2012 11:08:12 +0100 (BST)
- Subject: What's the best way to define local labels in an assembler macro?
- Reply-to: "R. Diez" <rdiezmail-binutils at yahoo dot de>
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