Symbol names begin with a letter or with one of “._”. On most machines, you can also use “$” in symbol names; exceptions are noted in See Chapter 30. That character may be followed by any string of digits, letters, dollar signs (unless otherwise noted in Chapter 30), and underscores.
Case of letters is significant: foo is a different symbol name than Foo.
Each symbol has exactly one name. Each name in an assembly language program refers to exactly one symbol. You may use that symbol name any number of times in a program.
Local symbols help compilers and programmers use names temporarily. There are ten local symbol names, which are re-used throughout the program. You may refer to them using the names “0” “1” ... “9”. To define a local symbol, write a label of the form “N:” (where N represents any digit). To refer to the most recent previous definition of that symbol write “Nb”, using the same digit as when you defined the label. To refer to the next definition of a local label, write “Nf”—where N gives you a choice of 10 forward references. The “b” stands for "backwards" and the “f” stands for "forwards".
There is no restriction on how you can use these labels, but remember that at any point in the assembly you can refer to at most 10 prior local labels and to at most 10 forward local labels.
Local symbol names are only a notation device. They are immediately transformed into more conventional symbol names before the assembler uses them. The symbol names stored in the symbol table, appearing in error messages and optionally emitted to the object file have these parts:
All local labels begin with “L”. Normally both the assembler and the linker forget symbols that start with “L”. These labels are used for symbols you are never intended to see. If you use the “-L” option then the assembler retains these symbols in the object file. If you also instruct the linker to retain these symbols, you may use them in debugging.
If the label is written “0:” then the digit is “0”. If the label is written “1:” then the digit is “1”. And so on up through “9:”.
This unusual character is included so you do not accidentally invent a symbol of the same name. The character has ASCII value “\001”.
This is a serial number to keep the labels distinct. The first “0:” gets the number “1”; The 15th “0:” gets the number “15”; etc.. Likewise for the other labels “1:” through “9:”.
For instance, the first 1: is named L1C-A1, the 44th 3: is named L3C-A44.