Download Print this page

RCA COSMAC User Manual page 48

Hide thumbs Also See for COSMAC:

Advertisement

Sampte System and Program
Machine-Code
Programming
47
A simple program will illustrate the use of the COSMAC instructions and provide an example of system
design. The demonstration system is a programmed multiple-output sequencer, timer, or controller. Fig. 52
shows a block diagram of the system.
MAO-7
COS MAC
BYTE INPUT
SWITCHES
-l.... 0-
ENTER SWITC H
8-BIT
OUTPUT
REGISTER
SWITCH
INPUT
LOG IC
OUTPUT
LOG I C
!-"":"':":'::..::j1Ool
EFI=INPUT BYTE READY; 68= INPUT BYTE-M(R(X))·,60=M(R(X)) __ OUT, R(Xl+1
92CM-26477
Fig. 52 - Sample microprocessor system.
BIT 0
BIT
I
BIT
2
BIT
3
BIT
4
BIT
5
BIT 6
BIT 7
Because a small memory will suffice for this application, no address latch is required. The program re
quires less than 64 bytes and could be stored in a single-chip ROM. RAM capacity of 64 bytes or less is also
required. The switch input logic is used to enter initial parameters and could be
simil~r
to that shown in
Fig. 47. An 8-bit output register could be implemented as shown in Fig. 50.
The 8-bit output register provides 8 output bit lines. Each output line can be programmed to provide a
repeating sequence of binary output states. Fig. 53 shows an arbitrary sequence of output states that could
be
programmed to apoear on the four low-order output lines.
01, 02, 03, and 04 represent four states for the eight output lines. For example, if 01 =03 (00000011),
then the four low-order output lines will have the states shown during the T1 time interval. They will then
assume the states shown at 02 during the T2 time interval. The state of all eight output lines can be repre-
sented by a single byte. in the sample program, four bytes are entered to specify the value of the output
lines at 01, 02, 03, and 04. This sequence of states will repeat indefinitely as Iorig as the program runs.

Advertisement

loading