EasyManua.ls Logo

Intel 8080 - B3_Page_41

Intel 8080
224 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter
4.
Assembler
Directives
flags as an error any reference
to
a name or label
that
ha,
not been defined
in
your program. To avoid this,
you must provide the assembler with
a list
of
items used
in
your program
but
defined
in
some
other
program.
These items must be
decldred
in
an
EXTRN directive.
The two remaining program linkage directives,
NAME
and STKLN,
Me
individually explained later
in
this chapter.
PUBLIC
Directive
The PUBLIC directive makes each
of
the
symbol,
listed
In
the operand field available for access by
other
programs.
Label
Opcode Operands
optional: PUBLIC
Each item
in
the operand ndme list must
be
the name or Idbel assigned to ddta
or
an
inqruction
elsewhere
in
this program. When multiple names appear
in
the list, they must
be
separated by
comm~IS.
Edch name may
be
declared PUBLIC only once
in
a
pJ"Ogram
module. Reserved words and external symbols (see the EXTRN
directive below)
cannot
be
declared to
be
PUBLIC symbols.
PUBLIC directives may appear anvwhere within a program module.
If
an item
in
the operand
l1amelist
has
no
corresponding entry
in
the
,ymbol
table (implying
that
it
is
unde-
fined),
it
is
flagged
dS
an error.
Example:
PUBLIC SIN,COS,TAN,SQRT
EXTRN
Directive
The EXTRN directive provides the assembler with a list
of
,ymbol., referencec.l
in
this program
but
defined
in
a
different program.
Because
of
t.his,
the assembler establishes linkdge to the
other
program and does not flag the
undefined references
as
errors.
Label
Opcode
Operands
optional: EXTRN name li,t
Each
item
in
the name list identifies a symbol that may
be
referenced
in
thi,
program
but
is
defined
in
another
program. When multiple items JPpear
in
the list, they must
be
'CpJI,ltec.l
bi
c:ommJs.
If
a symbol
in
the operand
name-list
is
also defined
in
this program by the user, or
is
a reserved symbol, the effect
is
the same
as
defining the same symbol more than once
in
a pmgram. The assembler flags this error.
EXTRN directives
may appear anywhere within a program module.
A symbol may
be
declared
t.o
be
external only once
in
a program module. Symbols declared to
be
PUBLIC
cannot
also be declared to
be
EXTRN symbols.
4-17

Table of Contents

Related product manuals