User manual

ST Assembler-Linker Assembler directives
Doc ID 11392 Rev 4 61/89
Table 33. END
Purpose End of source code.
Format END
Description
This directive marks the end of the assembly on the main source code file. If no END
directive is supplied in a source-code file then an illegal EOF error will be generated by
the assembler. Include files do not require an END directive.
Example END
See also
Table 34. EQU
Purpose Equate the label to expression.
Format label EQU <EXPRESSIONS>
Description
Most labels created in a program are attached to a source code line that generates
object code, and are used as a target for jumps or memory references. The rest are
labels used as 'constants', used for example, to hold the IO port number for the system
keyboard: a number that will remain constant throughout the program.
The EQU directive allocates the value, segment type and length to the label field. The
value is derived from the result of the expression, the relativity (absolute or segment-
relative derived from the most recent segment), the length is BYTE, WORD or LONG,
derived from the size default (starts off as WORD and may be changed by directives
BYTES, WORDS or LONGS).
Example labl END 5
See also
Table 35. EXTERN
Purpose Declare external labels.
Format EXTERN
Description
When your program consists of several modules, some modules need to refer to labels
that are defined in other modules. Since the modules are assembled separately, it is
not until the link stage that all the necessary label values are going to be known.
Whenever a label appears in an EXTERN directive, a note is made for the linker to
resolve the reference.
Declaring a label external is a way of telling the assembler not to expect the label to be
defined in this module, although it will be used. Obviously, external labels must be
defined in other modules at link stage, so that all the gaps left by the assembler can be
filled with the right values.
Because the labels declared external are not actually defined, the assembler has no
way of knowing the length, (byte, word or long) of the label. Therefore, a suffix must be
used on each label in an EXTERN directive declaring its type; if the type is undefined,
the current default label scope (set by BYTES, WORDS, LONGS directives) is
assumed.
Example EXTERN label.w, label1.b, label2.l
See also PUBLIC