Local labels are special labels whose scope and effect are temporary. A local label can be defined in two ways:
- $n, where n is a decimal digit in the range 0-9. For example, $4 and $1 are valid local labels. See Example4-1.
- name?, where name is any legal identifier as described above. The assembler replaces the question mark with a period followed by a unique number. When the source code is expanded, you will not see the unique number in the listing file. Your label appears with the question mark as it did in the source definition. See Example4-2.
You cannot declare these types of labels as global.
Normal labels must be unique (they can be declared only once), and they can be used as constants in the operand field. Local labels, however, can be undefined and defined again. Local labels cannot be defined by directives.
A local label can be undefined or reset in one of these ways:
- By using the .newblock directive
- By changing sections (using a .sect, .text, or .data directive)
- By entering an include file (specified by the .include or .copy directive)
- By leaving an include file (specified by the .include or .copy directive)