Local Labels

A local label is a symbol that represents an address and has local scope: the range forward and backward within the file to the points where the assembler encounters non-local labels.

The first character of a local label must be an at-sign (@). The subsequent characters of a local label can be:

Within an expanded macro, the scope of local labels works differently:

Local Label Scope in a Macro shows the scope of local labels in macros: the @SKIP label defined in the macro does not conflict with the @SKIP label defined in the main body of code.

Listing: Local Label Scope in a Macro

MAKEPOS .MACRO
        cmpwi           0,r3,0

        bge     @SKIP

        neg     r3,r3

@SKIP:                  ; Scope of this label is within

                        ; the macro

        .ENDM

START:

        lwz     r3,COUNT

        cmpw    0,r3, r4

        beq     @SKIP

        MAKEPOS

@SKIP:                  ; Scope of this label is START to

                        ; END excluding lines arising 

        ; from macro expansion

        addic   r3,r3,1

END:    blr