Routine To Restart Ut20; Additional Notes On Ut20; Programming Methods; Machine Language Programming - RCA 1800 Operator's Manual

Cosmac development system ii
Hide thumbs Also See for 1800:
Table of Contents

Advertisement

20 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Operator Manual for the RCA CDS II CDP18S005
Routine to Restart UT20
A
means is
provided
to
automatically
transfpr
('ontrol back to
UT20
from
a
user program. An
entry
point
routine.
GOLT'20.
is providpd for
this
purpmw.
WIH'n
pntered via
this
routine.
UT20 will relStart and
iSSIW
a
*'
prompt to
the terminal.
A
long
branch
to
(;()L'r~O
at
location
#lBF9 will
cause
this transfer.
LT2()
depends
on the following conditions upon re-
('n
tr~
:
:\.
I) HE.I
=
tNminal timing
constant
2)
Two-Ipvel
110
is
enabled
.
In order
to
assure
the
second condition,
the user
program must be initiated via the $U command. The
GOUT20 routine
can
be
called only
by a program
having R3
as
its program counter.
Additional Notes on UT20
LT20
automatically
enables group
1
1/0 devices.
which indudf's the terminal and floppy disk in-
t('ffan·s.
when
it is
started. tJ s('r-addpd TlO
devices
win·d
to tlw samp group-splpct signal are
also
enabled.
For more information
on
this
subject,
refer
to "Two-Level I/O" under Input/Output Intt'r-
facing in the next
Section,
titled
Hardware
Structure
of the CDS.
Intt'fmpts arf' automatically disabled when UT20
is running. They are
re-t
nabled by
either
the
$P
or
SU
command.
Because R
I
and R2 must be initialized
bv
a
wwr
program
before
iIllerrtll
t.
are allowed
.
u"T20
prohibits
start-up
via
lhe~e cCll1l1nands
if an
Intt·rrupt
i:-;
pt~
nC!in
g
.
In:
t
'
ad
.
it wi
ll
lype
IN-
TEHRUPT
and
issue
an
*.
This f{'atllr(' i:
a con-
vpnience to the WH'r to prevent
start-up
problems if
intprrupts have not been
externally
disabled. If
custom
hardware is installed that may
cause
in-
t('rmpts at
start-up.
the user program should be
startt'd
via
the RUN
P
switch.
Programming Methods
Machine Language
Programming
With an
understanding
of
the
structure and
olH'ratio/l of
tlw
P
and th
e
material rrovid d thll
,'
rur.
Lhe
reHdf'1'
i!i
rre
ra rt~d
to
b ,ill using
'
tilt>
I)I'V
lopment
S
stem
in
an
el
m
nlar
wa
y.
For
C'xamrle. hf'
'an
now
lind rstand
and
po.
ihl
y
mod
if_
the
lim e-out
le~1
program pr
S
Ilt
d
a'rli r in
this
Manual.
Howf'
r. a
lmo
'
t
an.
hexad
·imallmachin
e
langlta
g
)
t
t program 'wi
II
reCJllir u
e
(If
th
e
110
IYI
ewritt·r.
Th
mos
t
basi
'
wa
to
commllni cal
by
til·
t
-IN pewril r. lherf'for
.
will
be
covered next.
To read a
character
from the
I/O
teletypewriter.
the llser
program should
transfer
control
to READ-
nn UT20). That is. load R3 with
HUE
and execute a
D3 instruction, making
sure
that R2 is pointing to a
free RAM location. After the typed character is read,
the
utility
routine
will return by setling P
to
5,
i.
e.,
by
executing
the in truction D- (making
it
most con-
ven ient if
the
program counter
of
the
calling
r outin
e
were
t
begin
with I. The ASCII
code
for
the
input
character (with a 0 parity
bit)
will
b in
both RF.)
and
in D.
The
memory location
pointed to
by
R2 and
registers
RE, RF
,
X,
and
OF
will
have
been changed
in
value (not preserved
over
the call).
- A
list of
key
UT20
sYlllblllic locutiolls and
their
cllrrespolldill~
ab sulute IllCIl111ry addresses is
!(ive
n in
Table
II
.
Because the READ routine uses R3 as its program
...
counter,
it is most convenient to branch to READ by
~.
a 03 instruction. When READ returns to the caller,
R3.0 will
contain
a modified
value,
necessitating
another initialization if a repeated I/O is to be per-
formed. Because the READ routine uses the values in
registers RC and RE which UT20 will normally
initialize, it is
essential
that the user
refrain
from
using these registers unless their
values
are saved and
later restored by his program
..
To cause a
character
to be typed out by the I/O
typewriter, the user program should transfer control
to TYPE5D at location 819C, by means of a D3
instruction, again making sure that R2 is pointing to
a free RAM location. As discussed above, the calling
P value
should
be 5 and, for this case, the ASCII
code
for the
output character should
be an immediate byte
(i.e., the byte after the 03 instruction). After typing
the
character,
READ will have advance R5 past the
argument byte and again return by a 05 execution.
M(R(2)), as well as registers RE, RF, X, D, OF, and
R3.0 return altered. All other register
values
are
preserved. For the reasons previously cited, the user
should
again refrain from using registers RC and RE.
Given
the
a'bility
to execute simple
I/
O
terminal
functions
the
user can now code elementary te
t
,
program
to
further
exercise
the
COSMAC
Development
System.
As a simple
example,
consider
the
routine shown in
Fig. 3 that
reads two bytes,
compares them, and outputs the "larger" of the two.
T

Advertisement

Table of Contents
loading

Table of Contents