User manual

ST Assembler-Linker ST assembler
Doc ID 11392 Rev 4 19/89
For example:
Figure 2. Assembler source code format example
The next sections describe the main components of a source code file.
4.3.1 Label structure
Labels must start in column one. A label may contain up to 30 of any of the following
characters:
Upper case letters (A-Z)
Lower case letters (a-z)
Digits (0-9)
Underscore (_)
The first letter of a label must be a letter or an underscore. Note that upper and lower case
are treated differently because assembler is case sensitive.
Upon assembly, any label that exceeds 30 characters is truncated and a warning alerts the
user that this has occurred. When truncated, if two of more labels have the same name, a
phase inconsistency error is generated.
When labels are defined, several attributes are defined along with the value. These are:
Size (Byte, Word or Long)
Relativity (Linker Relative or Absolute)
Scope (Internally or Externally defined)
The function of each attribute is explained in the following sections.
4.3.2 Label size
Defining a label’s size allows the assembler to determine what kind of addressing mode to
choose even if the value associated with the label is undefined.
The default size of the memory location for a label is word (2 bytes). Whenever the label has
no suffix, then the default size is assumed.
The directives BYTES, WORDS and LONGS (4 bytes) allow you to change the default.
Regardless of the default size, you can define the size for a specific label by adding a suffix
to it:
.b for byte,
.w for word
.l for long.
examp ld A,$ffff ; long addressing mode
comments
operand
opcode
label
separator