Contents|Index|Previous|Next
Symbol names

Symbol names begin with a letter or with either a dot ( . ) or an underscore ( _ ); on most machines, you can also use $ in symbol names (exceptions are noted in the documentation for particular machines; see Machine Dependent Features). That character may be followed by any string of digits, letters, dollar signs (unless otherwise noted in the documentation for particular machines; for specific machines, see Machine dependent features), and underscores. For the AMD 29K family, ? is also allowed in the body of a symbol name, though not at its beginning. 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 symbol names

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.

Local symbols are not emitted by the current GNU C compiler.

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 the following parts.


Top|Contents|Index|Previous|Next