One of the main advantages of local labels is that since the same identifier can appear several times, they can be used in macros. Consider some hypothetical local labels like this:
.macro dothething rega regb ptr ldrex \regb, [\ptr] cmp \rega, \regb beq 1 2: <more instructions> ... strex \regb, \rega, [ptr] cmp \regb, #0 bne 2 1: .endm myfunction: dothething r0 r1 r2 dothething r0 r1 r3 bx lr
In fact, this is permitted in armasm (albeit with a slightly different syntax), where the behavior in the absence of the specified direction is a search back, then forward ", but with any reasonable default behavior, at least one of the jumps in the above code will be aimed to an incorrect label instance. Explicitly causing a direction with beq 1f and bne 2b in a macro, resolves the ambiguity and generates the correct jumps in both macro calls.
If you decide to use something that is not a true local label, then you will not only interfere with your character table with garbage, but you will also be robbed of the possibility of using loops or conditional branches in macros, since you generate unique characters. My example may seem a little far-fetched, but switch from assembler macros to asm built-in blocks in C functions that become embedded throughout your complex code base, and things get a lot more real .
source share