Chapter
4.
Assembler
Directives
If
no
ORG
directive
is
included before the first
imtruction
or data
byte
in
your
program, assembly begins
at
location zero.
Your program can include
any
number
of
ORG directives. Multiple
ORG's
need not specify addresse,>
in
ascending
,equence,
but
if you fail
to
do so, you may instruct the assembler to write over some previously
a'>5embled portion
of
the program.
If
the optional label
is
present, it
is
a,signed the
current
value
of
the location
counter
before
it
is
updated
by the
ORG directive.
Example:
Assume
that
the
current
value
of
the location
counter
is
OFH
(decimal 15) when the following ORG directive
is
encou n tered :
PAG1:
ORC
OFFH
;ORG ASSEMBLER TO LOCATION
;OFFH
(decimal 225)
The
symbol PAG 1
is
assigned the addl'es'i OFH. The next instruction
or
data byte
is
assembled at location
OFFH.
Introduction
to Relocatability
4-12
A major feature
of
thi,
assembler
i'>
ih
system for creating relocatable object code modules.
Support
for this new
feature
include,> a
number
of
!lew directives for the a'>5embler and three new program'> included
in
ISIS·II.
The
three new programs LIB, LINK, and LOCATE arc de,>cribed
in
the ISIS·II System User'., Guide. The new
assembler directives arc described later
in
this chapter.
lRelocatability
allows the prograrnmer
to
code programs or '>ections
of
rrograms
without
worrying
about
the
final arrangement
of
the object code
in
memory.
Thi,
offers developer,>
of
microcomputer
systems major ad·
vantage'>
in
two areas: memol y management and modulal' program development.
Memory
Management
When developing, testing, and debugging a system on your Intellec
miclocomputer
development system, your
only concern with locating
a program i,
that
it
doesn't overlap the resident routines of ISIS·II. Because the
I:ntellec system has
32K,
48K, or 64K
of
random
acce", memory, the loc,ltion of your future program i, not a
great concern. However, the
p'ogram
you
arc developing
will
,{Immt certainly u,e ,orne mix
of
random
dCCe'iS
memory (RAM), read·only memory (ROM),
and/or
programmable reaclonly
memory
(PROM). Therefore, the
location
of
your
program
affech
both
cost and performance
iii
your application. The relocaLlbility feature allow,
'Iou
to
develop, test,
Jnd
debllg your program on the Intelil:c development
,>ystcm
,lIld then simply relocate the
object
code to suit
your
application.
The relocdtability fcature also has a major advantJge at assembly·time:
often,
large programs with many symbols
cannot
be assembled because
of
limited work
,pace
for the symbol table. Such a program can
be
divided into a
number
of
modules
that
can be assembled 'ieparately and then linked together to form d single object program.