
30 Assembly Language Programming for the 68000 Family
as a field separator; most assemblers also recognize the tab character as
a field separator, and treat it as a space. Generally, where one space or
tab is allowed, you may also use more than one. You must be careful not
to insert a space in the middle of a field, as this causes the assembler to
treat the next non-blank characters as the next field.
A delimiter is a special character that can serve to mark the end of
a token, besides having its own special meaning. Punctuation characters
such as commas, periods, and colons are examples of delimiters.
Figure 6 is an excerpt from a sample program that we will use to
further discuss the format of assembler source lines. As you can see, the
program consists mainly of character sequences that look like English
language words separated by punctuation. These character sequences
are the identifiers. The rules for creating identifiers varies slightly from
assembler to assembler, but the following rules work with almost every
assembler:
1. The first character must be alphabetic (A...Z, a...z).
2. Any additional characters may be alphabetics or digits (0...9).
3. Only the first eight characters are significant; the rest are ignored.
There are a number of variations from these rules. Some assemblers re
tain significance for more than eight characters. Others treat the upper-
and lower-case alphabetic characters as equivalent, or retain uniqueness,
or allow only the use of one case. For example, “COUNT” and “count”
may be completely different identifiers. Generally, assemblers allow in
structions and directives to be in either case. Characters other than the
alphanumerics are sometimes allowed. Check your assembler manual to
be sure. Throughout this book we will use upper case, and be careful not
to mix cases.
The Label Field
The label field always contains a symbol formed with the standard
rules for identifiers. If a label is present, it is used to associate the symbol
with a value. This value may represent the location of data in memory,
a constant, or the location in memory of the instruction in the operation
field.
Labels can be used to locate data, such as a variable, stored at par
ticular locations in memory. A variable consists of one or more bytes.
Normally variables will be bytes, words, or longwords. It is important
to reserve sufficient space for a variable. If an instruction tries to place
a longword of data at a memory location only large enough to hold a
word, the data will overwrite a part of memory that it shouldn’t.
Kommentare zu diesen Handbüchern