This is an example of code that declares and uses a local label legally:
QBEQ $1, r14, 0
ADD r14, r14, 1
$1:
.newblock
QBEQ $1, r15, 0
ADD r15, r15, 1
$1:
JMP r3.w2
The following code uses a local label illegally:
QBEQ $1, r14, 0
ADD r14, r14, 1
$1:
QBEQ $1, r15, 0
ADD r15, r15, 1
$1:
JMP r3.w2
The $1 label is not undefined before being reused by the second branch instruction. Therefore, $1 is redefined, which is illegal.
Local labels are especially useful in macros. If a macro contains a normal label and is called more than once, the assembler issues a multiple-definition error. If you use a local label and .newblock within a macro, however, the local label is used and reset each time the macro is expanded.
Up to ten local labels of the $n form can be in effect at one time. Local labels of the form name? are not limited. After you undefine a local label, you can define it and use it again. Local labels do not appear in the object code symbol table.
For more information about using labels in macros see Section 6.6.