RCA COSMAC Operator's Manual page 22

Microkit
Hide thumbs Also See for COSMAC:
Table of Contents

Advertisement

MACHINE LANGUAGE PROGRAMMING (cont'd)
The initialization part of the program is above the
dashed line.
The main program loop begins at location 16.
Each call to UT2 (two READ's and one TYPE) is made via a
D3 execution after first initializing R3.0 with the
proper half of R7. in which the two lower half address
constants ('9C' and '3E') are
s~ored.
(R3.l remains
holding its initialization value of '81'.)
Two char-
acters are read and a subtraction is executed.
The
resulting immediate TYPE byte value is conditional on
the results of the subtraction.
The free RAM location
used by READ and TYPE is 0 in this case (since R2=0).
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 16.
R6 is initialized to point to
the immediate TYPE argument location (0026).
Notice that
X must be restored to the value 6 (see instruction at
location lD) since UTZ changes X.
As an example of loading and running a program via the
keyboard. we present below an example of a Microkit
"session" using the elementary program just discussed
above.
In what follows. text enclosed in square brackets.
[ ]. represents UT2 typeout; text enclosed in round
brackets. ( ). represents user input; and other text
represents running commentary.
The user begins by turning power ON and hitting RESET.
followed by RUN UTILITY.
The RUN light goes on.
Then
(CR or LF)
[* ]
Timing/echo control character --
a function of the terminal used.
UT2 prompt character.
(lMl 90 B2 A2 B5 B6 F8 81 B3 F8 3E A7 F8 9C B7 F8 26 A6 F8 16 A5.
D5 87 A3 D3 56 87 A3 D3 E6 F7 3B 23 9F 56 97 A3 D3 00 30 16 CR)
The program has now been loaded starting at location 1.
[* )
UTZ returns with prompt character.
($PI)
Begin execution.
(AB)
[B]
(BA) [B) (12) [2)
(21) [·'2).(MN) [N)
(NM)
[N)
•••
etc ..•
Each character triplet represents one pass through the main
program loop -- consisting of two user input characters and
one system response character.
- 16 -

Advertisement

Table of Contents
loading

Table of Contents