Chapter 6.
Symbols
Symbols are a central concept: the programmer uses symbols to name things, the linker uses symbols
to link, and the debugger uses symbols to debug.
Warning: as does not place symbols in the object file in the same order they were declared. This may break
some debuggers.
6.1. Labels
A label is written as a symbol immediately followed by a colon
:
. The symbol then represents the
current value of the active location counter, and is, for example, a suitable instruction operand. You are
warned if you use the same symbol to represent two different locations: the first definition overrides
any other definitions.
On the HPPA, the usual form for a label need not be immediately followed by a colon, but instead
must start in column zero. Only one label may be defined on a single line. To work around this, the
HPPA version of
as
also provides a special directive
.label
for defining labels more flexibly.
6.2. Giving Symbols Other Values
A symbol can be given an arbitrary value by writing a symbol, followed by an equals sign
=
, followed
by an expression (Chapter 7 Expressions). This is equivalent to using the
.set
directive. Section 8.79
.set symbol, expression
.
6.3. Symbol Names
Symbol names begin with a letter or with one of
._
. On most machines, you can also use
$
in sym 
bol names; exceptions are noted in Chapter 9 Machine Dependent Features. That character may be
followed by any string of digits, letters, dollar signs (unless otherwise noted in Chapter 9 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.
6.3.1. Local Symbol Names
Local symbols help compilers and programmers use names temporarily. They create symbols which
are guaranteed to be unique over the entire scope of the input source code and which can be referred
to by a simple notation. To define a local symbol, write a label of the form
N:
(where N represents
any positive integer). To refer to the most recent previous definition of that symbol write
Nb
, using the
same number as when you defined the label. To refer to the next definition of a local label, write
Nf
  
The
b
stands for"backwards" and the
f
stands for "forwards".
There is no restriction on how you can use these labels, and you can reuse them too. So that it is
possible to repeatedly define the same local label (using the same number
N
), although you can only
refer to the most recently defined local label of that number (for a backwards reference) or the next






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

canadian web hosting

 

Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Inexpensive Web Hosting  Jsp Web Hosting

Cheapest Web Hosting Jsp Hosting Cheap Hosting

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved