RCA 1800 Operator's Manual page 22

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

Advertisement

Operating and Programming the CDS
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
21
MEMORY
HEX CODE
LOCATION
00
STORED
90
COMMENTS
00 ..... D. (Assumes RO.1
=
0).
01
04
828586
F8 FF A2
Clear upper half of pointers.
M(OOFF) is the free RAM location.
07
OA
OD
F881 83
F8 3E A7
F8 9C 87
Initialize upper half of I/O call program counter.
Lower half of READ address saved in R7.0.
Lower half of TYPE address saved in R7.1.
10
F8 27 A6
R6 now points to 0027 (the immediate TYPE byte).
13
16
F8 17 A5
D5
R5 initialized to 0017 is ready to be the program counter.
Change P from 0 to 5.
17
87 A3
R3 now points to READ routine (813E).
19
D3
Call READ. Input character to D and RF.1.
1A
56
Save first character in immediate byte location.
18
87 A3 D3
READ second character.
1E
E6
X now points to first character.
1F
F7
D - M(R(X))
.....
D. Subtract first character from second.
20
3824
Print the first character if it is the largest.
22
9F 56
Second character moved to immediate byte location.
24
97 A3
R3 now points to TYPE5D (at 819C).
26
D3
Call TYPE. Output byte at the next location (0027).
27
00
Immediate byte storage for TYPE routine.
28
3017
Loop for another pass.
Fig.
3--
Example of elementary hexadecimal program
.
The routine given exhibits register usage compatible
with the UT20 READ and TYPE calling sequences.
Further, the
110
instructions consist of calls to the
appropriate teletypewriter interface routines.
The initialization part of the program is above the
dashed line. The main program loop begins at
location 17. Each
call
to the utility program (two
READ's and one TYPE) is made by a D3 execution
after first initializing R3.0 with the proper half of R 7
in which the two lower half address constants (9C and
3E)
are
stored.
R3.1
continues to
hold
its
initialization value of 81. Two characters are read and
a
subtraction
is executed. The resulting immediate
TYPE byte is conditional on the results of the
sub-
traction. The free RAM location used by READ and
TYPE is OOFF in this
case
since R2=00FF.
The initialization part of the program is executed
with P = O. R5 is the program counter once the main
program loop is entered at location 17. R6 is
initialized to point to the immediate TYPE argument
location (0027). Notice that X is set to the value 6 (see
instruction at location IE) after the READ routine
since READ changes the value of X.
An exampl
of
loadin
g
and running a program by
m
a
ns
of
th
key
board i a CDS "session" using the
el
"mentary program
just discussed. In what follows,
underlined text represents UT20 printout; text not
underlined represents user input; bracketed text is
commentary.
Begin by turning power ON and pressing RESET,
followed by RUNU. The .RUN light will go on. Then
(CR) [Carriage Return to establish timing
constant and echo)
*
[UT20 prompt character)
!MO 90 B2 B5 B6 F8 FF A2 F8, (CR) (LF)
81 B3 F8 3E A7 F8 9C B7, (CR) (LFI
F8 27 A6 F817 A5 D5 87, (CR)(LF)
A3 D3 5687 A3 D3 E6 F7, (CR) (LF)
3B 24
9F
56 97 A3 D3 00, (CRI (LFI
3017 (CR)
[The program has now been loaded)
..!.
[UT20 ready for the next command)
$U(CR)[Begin program execution)
AB!!BA!!12~21!MN~
[ ..
etc
.. )
Each character
triplet
represents one pass through
the main
I
rogram loop
con
isting
of two user input
character and
11
ntput haracter.
The reader may wish to code his own program at
this point to verify his knowledge of the CPU in-
struction
set and the read and type routines.

Advertisement

Table of Contents
loading

Table of Contents