RCA CDPl8S693 User manual

User Manual for the RCA
Microboard Computer Development
System (MCDS)
CD 18S693 and CD 18S694
M M-293A Sugges'ed rice $10.00

User Manual for the RCA
Microboard Computer Development
System (MCDS)
CD 18S693 and CD 18S694
Solid
State Brussels • Buenos Aires • Hamburg • Madrid • Mexico City • Milan
Montreal • Paris • Sao Paulo • Somerville NJ • Stoc holm
Sunburyon-Thames • Taipei • To yo

CLASS A
RADIO INTERFERENCE WARNING
This equipment complies with the requirements in Part 15
of FCC Rules foraClass A computing device. Operation of
thisequipmentinaresidentialarea maycause unacceptable
interference to radio and TV reception requiring the
operator to ta e whatever steps are necessary to correct
the interference.
__________________
2488834-1
The software described in this manual is copyrighted by Corporation.
Information furnished by RCA is beiieved to be accurate and
reliable. However, no responsibility is assumed by RCA for its
use; nor for any infringements of patents or other rights of third
parties which may result from its use. No license is granted by
implication or otherwise under any patent or patent rights of
RCA.
Copyright 1982 by RCA Corporation Trademark(s)® Registered
(All rights reserved under an-American Copyright Convention) Marca(s) Registrada(s) rinted in USA/7-82

Foreword
The RCA COSMAC Microboard Computer Development
Systems (MCDS) CD 18S693 and CD 18S694 are economi
cal and versatile systems capable of facilitating the design and
development of the hardware and software for applications
based on the RCA 1800 series of CMOS microprocessor
products. With the optional Run-time BASIC available on
ROM, and with the addition, if needed, of any of the many
available expansion Microboards, the MCDS may be used
very effectively for control, testing, or other dedicated
microcomputer applications.
The CD 18S693 includes an eight-card chassis with case, a 5-
volt power supply, a CD 18S601 Microboard Computer, a
CD 18S652 Microboard Combination Memory and Tape
I/O Control Module augmented with a ROM-based monitor
program and a ROM-based extended BASIC3 interpreter, an
audio cassette magnetic tape system for memory storage, and
the cables needed for connecting a data terminal and for
connecting the cassette drive system to the CD 18S652.
The 2-kilobyte monitor program UT62 enables the user to
modify and examine memory, debug programs, store and
retrieve data on tape, and start execution of programs. The
BASIC3 interpreter (12 kilobytes) features full floating-point
arithmetic, line editing capability, and “trace” debugging for
program creation. The audio cassette tape system provides for
economical storage and retrieval of programs or data.
The CD 18S694 has all the features of the CD 18S693 plus
the following. In an additional three-ROM set on the
CD 18S652, a text editor and Level I assembler are provided
that enable the user to create CD 1802 machine language
programs in Level I mnemonic language.
A ROM rogrammer Module is also provided along with
a control program on cassette tape that enables the user to
program a wide variety of E ROM ’s. A second audio cassette
drive is included to support the editor and assembler
operations.
This Manual describes in detail the hardware structure and
the software features and commands of the Microboard
Computer Development Systems (MCDS) CD 18S693 and
CD 18S694. For a description of BASIC3, the user should
refer to the manual BASIC3 High-Level-Language Interpreter
CDP18S841 User anual, M M-841. The user should also refer to
the User anual for the CDP1802 COS AC icroprocessor,
M M-201, for a detailed description of the instruction set and the
architecture of the CD 1802 COSMAC Microprocessor.

4
Contents
Page
1. SettingUptheSystems
......................................
5
2. Features of the UT62 Monitor rogram
...........
7
UT62 Commands
............................................
7
ASCII Coding
..................................................
9
Read and Type Routines
................................
9
Examples of UT62 Usage
.............................
12
Tape READ and WRITE Subroutines .. .. 14
3. Running BASIC3
.............................................
16
4. Running with MCDS COSMAC Resident
Editor (CRE)...................................................17
Introduction .......................................................17
CRE Operating Considerations
...................
18
CRE Command Operation...........................20
CRE Commands
............................................
21
Using CRE
....................................................
25
5. Running the MCDS COSMAC Resident
Assembler (CRA)
..........................................
28
UsingtheAssembler
....................................
29
The Location Counter
..................................
29
The Symbol Table
........................................
29
Expression Evaluation
..................................
29
COSMAC Level I Assembly Language .. .30
6. Hardware Structure and System Signals
........
37
Module Descriptions
....................................
37
System Signals
..............................................
39
7. Memory Addressing and Expansion...............41
On-Board Memory Addressing...................41
Memory Expansion
......................................
42
8. Input/OutputInterfacing
..................................
44
Two-Level I/O Interfacing
..........................
44
Serial I/O Interfacing
..................................
44
arallel I/O Interfacing.................................45
I/O Expansion
..............................................
46
System Signals in I/O Interfacing...............47
Page
9. Using the Cassette Tape D rive
.......................
49
Operation
........................................................
49
System Care
..................................................
49
Controls..........................................................49
10. Usingthe ROM rogrammer
.......................
51
Installation......................................................51
Memory Organization and U se...................51
Software Considerations
..............................
52
recautions
....................................................
53
Operations and Commands .........................54
Examples of Compound Operations
..........
58
Appendix A— Specifications for the Microboard
Computer Development Systems
(MCDS) CD 18S693 and
CD 18S694
....................................
59
Appendix B— UT62 Monitor rogram Listing . .60
Appendix C - Tape Handling recautions .... 87
Appendix D - Connection List for Terminal
InterfaceCableCD 18S516 ... 88
Appendix E— Instruction Summary for RCA
CD 1802A, CD 1804, and CD 1805
COSMAC Microprocessors
..........
89
Appendix F— ASCII-Hex Table
..........................
93
Appendix G— Logic Diagram, Layout Diagram
and arts List for CD 18S652 Micro
board Combination Memory and
Tape I/O Control Module
.............
94
AppendixH— Hardware Description for ROM
rogrammer Module
...................
97
Appendix I— ROM rogrammer
Specifications
.............................
103
Appendix J— Generating Hard Copy on
MCDS.........................................104
Index
........................................................................
105

1. Setting Up the Systems
The CD l8S693 and CD l8S694 Microboard
Computer Development Systems, as supplied, need
only be cabled to the user's data terminal and
connected as shown in Fig. I to become operational.
The data terminal may be one having either a current
loop interface or an EIA RS232C interface operating
at llO, 300, or 1200 baud. In the latter case, the
additional negative voltage required is supplied by the
user.
a wire. These additions provide assurance that the EIA
RS232C circuitry is properly biased for operation. It
should also be noted that the EIA RS232C terminal
interface can be used to advantage with the RCA
Interactive Data Terminal V -3301 whichprovidesan
NTSC-compatible video output for direct use with a
525-line color or black-and-white video monitor.
When the V 3301 is used, it is permissible to connect
21 and 11 on the Universal Backplane and not use a
Fig. 1—CDP18S693 Microboard Computer DevelopmentS stem configuration
A cable CD 18S516 is provided for connecting the
user’s data terminal to the system. The cable is labeled
EIA and is keyed at the 10-pin connector end ( 1) to
plug into J2 (EIA) of the CD 18S601.The otherend is
a standard EIA RS232C 25-pin delta connector that
mates with the connector on the data terminal. No
handshaking lines are required for operation. The
details of the cable wiring are given in Appendix D,
Connection List for Terminal Interface Cable
CD 18S516.
When an EIA RS232C terminal interface is used, it
should be noted that (l)the +5 volts dc supply needed is
available at pins 21 and Y of the Universal Backplane
(See Table IX), (2) the user must supply a negative
voltage of -5 to -15 volts at pin 11 of the Backplane,
and (3) pin 20 (+V) and pin21 should bejumpered with
negative voltage for the RS232C interface. This
arrangement allows operation with a single voltage.
MOUNTED I/O
TYPEWRITER MATING EIA
CONNECTORS 2 5 -P IN DELTA CONNECTOR
CDPI8S60I
Fig. 2—Cable connection for I/O data terminals

6
____
User Manual for Microboard Computer Development System CD 18S693 & CD 18S694
The cassette tape interface cable connects the
CD l8S652 controller board to the cassette drive
mechanism. Wire markers identify plugs “MIC,”
“REM,” and “MON” at each end of the cable
assembly. The “REM” plug at each end of the cable is
smaller than the other plugs and is to be plugged into
the “REMOTE” jack at the tape recorder end. lug
“MON” is plugged into the “MONITOR” jack and
plug “MIC” into the “MIC”jack. The other end of the
cable is then plugged into the correspondingjacks of
the tape controller board CD l8S652 at the tape 0 or
the tape l interface. The cassette cable can be attached
or removed with power on the system.
To start the system, the user should first make sure
that the various units are connected as shown in Fig. l,
that the volume control on the cassette recorder unit is
set at maximum (l0), and that the tone control is set at
maximum (l0). The user should then place the
RESET/ RUN switch in the reset position and plug in
the power supply and the cassette tape system power
cable. Next, place the RESET/ RUN switch in the run
position. ress the carriage return key on the terminal
and the system should respond with an asterisk (*)
indicating that the system is ready to accept user
commands. If an asterisk prompt is not received, the
user should examine all connections and restart the
system with the RESET/RUN switch and then press
the carriage return key.
The following brief tests of the system operation
utilize the Insert(I) and Display(D) instructions of the
monitor program and indicate whether the monitor
program is operational. The carriage return key (CR)
signifies the “end of transmission” to the system when
it is waiting for a specific response. (H indicates
hexadecimal notation)
Test l —Display
Type:
E>8000 4 (CR)..Display 4 bytes at memory 8000H
System Response:
8000 7100 F880
Test 2—Insert and Display
Type:
10000 11223344(CR) ..Insert bytes 11, 22, 33
. .44 into memory at 0000H
System Response:
*
Type:
D0000-0003(CR) . .Display memory contents from
. .0000H through 0003H
System Response:
0000 11223344
The Insert and Display instructionsjust illustrated
are discussed in detail in the next section along with
other features of the monitor program.

7
2. Features of UT62 Monitor rogram
The purpose of the monitor program is to provide a
convenient place for the microprocessor to begin
running. The monitor allows the user to start BASIC3,
the editor, the assembler, or a user-generated program
at any address.
While the microprocessor is running in the UT62
monitor, several memory functions are available
through the data terminal. On a byte or block basis,
memory can be displayed, modified, or moved. Also,
the microprocessor register values on entry into the
monitor program can be examined by displaying
memory at location 8C00H. This REGISTER SAVE
feature can be used to debug machine language
programs by inserting an IDLE instruction (00) in the
user’s code at the appropriate place and then running
the monitor program by means of the RESET/RUN
switch. All registers are saved in memory at 8C00EI
except the values of R0, R1, and R4.1 which are lost in
the process.
The monitor can also load and save programs on the
cassette tape units and display ASCII files from tape
on to the terminal. The tape SAVE routine can store 1
byte or any contiguous block of bytes from any space
in memory. The tape LOADER will restore any saved
memory and can also load tapes created by the Level 1
assembler of the CD 18S694.
To start running the monitor program, the user
should place the RESET/RUN switch in the reset
position and then move it back to the run position. The
user should then press the carriage return key (CR) on
the terminal. The * prompt signifies that the system has
calculated the baud rate of the terminal and is now
ready to accept monitor commands.
UT62 Commands
preceded by a space or an inclusive
address range preceded by a hyphen. If
the option is not specified, a default
value of 1 byte results.
Examples: D02F8 8(CR)
D02F8-02FF(CR)
Both of these examples produce the
same output.
I Commands
Name:
urpose:
Format:
Action:
Examples:
Memory Insert
To alter the contents of memory
beginning at the specified address.
I (START ADDR)(SPACE)
(DATA)[(CONT)](CR)
A memory location is accessed at the
specified (START ADDR). The(DATA)
required is one byte specified by two hex
digits. The (CONT) option allows data
to be continued changing the current
memory address. If a (SEMICOLON) is
entered and after a user-inserted
(CR)(LF), a new address is anticipated.
The semicolon allows non-contiguous
memory to be loaded with a single insert
command. The command may be
terminated at any point by the entry of a
(CR) or (SEMICOLON).
I02F8 7100F840B0F88CB1(CR)
I02F8 7100F840B0;(CR)(LF)
03B6 94FB903A0F(CR)
The second example enters data into
two memory areas, starting at 02F8 and
03B6.
Commands
Following is a description of the thirteen UT62
commands. Note that all address, data, and byte
counts are entered as hexadecimal numbers (indicated
by the letter H following the number). In these
examples, the characters generated by the system are
underlined.
D Commands
Name: Memory Display
urpose: To allow a specified area of memory to
be displayed on the user terminal.
Format: D(START ADDR)(OPTION)(CR)
Action: The contents of memory, beginning at
the specified (START ADDR) will be
transmitted to the user terminal.
(O TION) allows the transmission of
either a specific number of bytes
Name:
urpose:
Format:
Action:
Examples:
Memory Move
To move a block of data from one area
of memory to another area.
(SOURCE ADDR)(OPTION)(SPACE)
(DEST ADDR)(CR)
Data is copied from memory location
beginning at the (SOURCE ADDR)
into locations specified by the (DEST
ADDR). (O TION) allows the transfer
of either a specific number of bytes
preceded by a space or an inclusive
address range preceded by a hyphen.
There is no restriction on the direction
of the move and the areas may overlap.
02F8 8 03F8(CR)
02F8-02FF 03F8(CR)

8
____
User Manual for Microboard Computer Development System CD 18S693 & CD 18S694
F Commands
Name:
urpose:
Format:
Action:
Examples:
S Commands
Name:
urpose:
Format:
Action:
03B0-03BF 02B0(CR)
03B0-03BF 03B2(CR)
Memory Fill
To load a defined area of memory with a
specific constant.
F(START ADDR)(OPTION)(SPACE)
(DATA)(CR)
The specified (DATA) is loaded into
memory beginning at the (START
ADDR). (O TION) allows the loading
of either a specific number of bytes
preceded by a space or an inclusive
address range preceded by a hyphen.
F02F8 8 00(CR)
F02F8-02FF 00(CR)
Thfese examples fill with zeros the eight
bytes beginning at location 42F8.
Memory Substitute
To display and, if desired, alter the
contents of sequential memory locations
beginning at the specified address.
S(START ADDR)(OPTION)(CR)
A memory location is accessed at the
specified (START ADDR). Itscontents
will not be displayed, however, until
(O TIONS) is entered. (O TIONS)
allows two methods of display. If
(S ACE) is entered, the current data
will be displayed on the same line
followed by a hyphen. New data may be
entered at this point. Only the last byte
entered will be written. If no data is
entered, the current data will remain
unchanged. If a (LF) is entered, a
(CR)(LF) will result and the current
memory address will be echoed to the
terminal prior to the printing of the
current data. New data may be entered
as described above. The command can
be terminated by a (CR) or continued by
the entry of any of the (O TIONS).
Examples: S02F8 63-71 00- 0F-C0(CR)
The current data of 63 is changed to 71.
The 00 data is retained, and the 0F is
changed to C0.
S02F8 7F 00- C0- H-82(LF)
02FC 52-AE(LF)
02FD 00-F8 n-40 23-A3(CR)
In this example, the 71, 00, and C0 are
retained and the 11 is changed to 82.
Each (LF) causes the next address to be
typed followed by its data.
P Commands
Name: rogram Run
urpose: To allow a user program to be run
beginning at the specified address.
Format: P[(START ADDR)](CR)
Action: The user program will begin execution
at the specified(START ADDR) with
= 0 and X = 0. Ifthe (START ADDR) is
not specified, the default value is 0000.
R Commands
Name: Read Tape
urpose: To load a user’s program from tape.
Format: R
Action: Load selected tape into memory. Tape
specifies target address. Assembled or
SAVED programs can be loaded.
Examplef: R
TAPE# 1 (CR)
LOADING
*
W Commands
Name: Write Tape
urpose: To save a user’s program on tape.
Format: W
Action: Write user memory to tape from address
AAAA to BBBB on tape selected.
Examplef: W
FRO ? 0100(CR)
TO? 0300(CR)
TAPE# 0(CR)
DONE!
J Commands
Name:
urpose:
Format:
Action:
Examplef:
Rewind Tapes
To allow user to rewind tapes normally
under system control.
J
Turn on tape drives and wait for user to
press a key.
J
REWIND TAPES, THEN TYPE ANY
KEY (X)
*
B Commands
Name:
urpose:
Format:
Action:
Run
To start execution of BASlC3.
B
System prints out BASIC3 title and asks
for “cold or warm” entry.
Examplesf: B
BASIC3 VX.X
c/w?
CREADY
E Commands (CDP18S694 only)
Name: Run Editor
urposes: To start execution of the text editor.
Format: E
Action: System pauses to search for top of free
RAM and then issues the title and
prompt.
fIn these examples the system response is indicated byan underline.

2. Features of UT62 Monitor rogram 9
Examplest: E
CDS TAPE EDITOR VERSION X.X
A Commands (CDP18S694 only)
Name: Run Assembler
urpose: To start execution of the Level I
assembler
Format: A
Action: System pauses to search for the top of
the free RAM and then issues the title
and starts by asking for “READ” tape.
For subsequent action refer to Chapter
5, Running the CDS COS AC
Resident Assembler (CRA).
Examplest: A
CDS ASSE BLER VER. X.X
READ?
C Commands
Name:
urpose:
Format:
Action:
Examplef:
Copy to Monitor
To display ASCII file on the Video
Monitor from tape.
C
Data in ASCII format is read from tape
and displayed on the Video Monitor.
After twenty Carriage Returns (ASCII
ODH). The display is stopped and 4 *’s
are displayed on the bottom line. To
restart the display, press any key. While
characters are being written on the
screen (not while the tape is being read)
pressing the BREAK key will halt the
display. ressing the Q key will abort
the routine and return the prompt.
ressing any other key will start the
display. (The space bar is recommended
because whichever key is pressed is
echoed to the screen.)
C
TAPE# 0 (CR)
user’s code
ASCII Coding
The CD 18S693 and CD 18S694 are designed to
interface to a data terminal via a serial ASCII code
using either a 20-mA current loop or an EIA RS232C
standard electrical interface. When a key is struck on a
TTY terminal, the information denoting that character
is converted to its ASCII code and appears on the
output terminals as a serial data-bit stream. The serial
data originating at the TTY for the letter ‘M’is shown
in Fig. 3. The character is framed by a start bit B and
two stop bits FF. By convention two stop bits are used
for data transmission at 10 characters per second
although 1, 1 ‘/2, or 2 are also acceptable outputs from
various different terminals. A parity bit is also
shown. For even parity, the parity bit would be a ‘1’
only if the 7 data bits contain an odd number ofTs.
fIn these examples the system response is indicated byan underline.
Hence, the total number of l’s in the eight intelligence
bits is always an even number. Some data terminals
may be set up to generate either even or odd parity.
UT62 ignores the parity bit, so either even or odd
parity is acceptable.
LOGIC I
-----
LOGIC 0
2 3 4 5 6 78
----------------
i H
I D I
I D I D ID | D I D
I P
li
i
L_
u_
ACTUAL »J
DATA BITS *
B
INTELLIGENCE BITS
*
-----
7 DATA BITS
-----
<
PLUS I PARITY BIT
_____
COMPLETE CHARACTER
"M " (4D|6)
* = ONE BIT TIME
B = START BIT
F = STOP BIT
P = PARITY BIT
D= DATA BIT
-------
=ASYNCHRONOUS TIME
BETWEEN CHARACTERS
92CS-3296I
Fig. 3—Data terminal bit serial output for the
character “M”.
Data from the MCDS are generated with the same
format; i.e., a start bit, 7 data bits, a parity bit, and two
stop bits. Note that the MCDS does not generate
parity—the parity bit is always a ‘1’ regardless of the
data bits. Therefore, terminals interfacing to the
MCDS should ignore the parity bit.
Read and Type Routines
The UT62 read and type routines provide the basic
software mechanism for communication between the
System and the data terminal. Several different
routines are available to facilitate different types of
I/O data transfers. These routines are listed in Table I.
These routines are designed to allow adoption to
various terminal speeds and to determine whether or
not characters read in should be “echoed” (i.e., typed
back immediately). For these purposes, a 'sub-
subroutine' called DELAY1 is included which
provides the necessary bit timing delays to the read and
type routines. DELAY 1 uses the CD 1802 register RC
as its program counter, which must be set-up to point
to location 80EF. UT62 does this set up automatically
when it is started. Any user program using a read or
type routine must not alter RC, or must restore it to
80EF before calling a read or type routine. Also, the
upper half of register RE (RE.1) contains a control
constant. The least significant bit specifies echo (0
denotes echo, 1 denotes no echo). For full-duplex
operation, then, this bit is a zero. Again, this bit is
automatically set when UT62 is started and the CR or
LF characters received.
The remainder of RE.1 constitutes a timing

10 ____ User Manual for Microboard Computer Development System CD 18S693 & CD 18S694
parameter (T ). T is calculated as follows:
T = 2 x interval between two serial bits
320 x (C U clock period) t
where the fraction is rounded to the nearest integer.
For example, because a Teletypewriter Model 33
operates at 10 characters per second and ll bits per
character, for the CD l8S693 running from the
supplied 2.0-MHz clock,
T = 2 x
ls x l char
10 char 11 bits
320 x
___
L_5
____
2.0 x 106 J
= 2 x 56.8 (rounded to 57)
= ll4 = 72H
Because for proper operation T must be less than
255, there is a bound on the speed of terminals
supported at any given clock rate. Faster terminals or
slower clocks can be supported to the extent that
roundoff errors do not cause bad timing. For example,
at 2.0 MHz and 30 l0-bit characters per second,
T = 2 x 30 10 = 2(20.8) = 42 = 2AH
320/2.0 x ion
and the round-off error is small (2100 instead of 20.8).
On the other hand, at 2.0 MHz with baud rates above
1200, the round-off error would be too high.
The utility program UT62 uses a subroutine
“TIMALC” to generate the operating time constant,
using the first character typed in by a user. This routine
times the intervals between incoming bits to calculate
T and reads one bit to determine whether or not to
echo. Specifically, if a CR is entered while TIMALC is
running, then echoes will be provided; an LF
suppresses echoes. In either case, RE. 1 is loaded with
the appropriate constant. TlMALC also loads the
subroutine pointer for the DELAY 1 routine. The user
of TY E and READ has the option of calling
TIMALC or setting up RE. 1 and the pointer to the
DELAY1 routine himself. As a convenience to the
user, UT62 leaves RE.1 and RC properly adjusted
while performing a operation and may be used unless
they have been altered by the user. A summary of
UT62 register utilization is given in Table 11.
All read and type routines and TIMALC use R3
as their program counter and return to the caller with
SEP R5. They can be called directly from a program
that can use R5 as its program counter, or they may be
called through the Standard Call and Return
Technique (SCRT) described in the User anual for
the CDP1802 COS AC icroprocessor, P -201
in the Section Programming Techniques under
“Subroutine Techniques”. This programming tech
nique is the most general and is recommended.
tThe factor of 2 comes from the fact that the input serial waveform is
sampled over two successive bit times. The factor of 320 comes from
the fact that the time between samples is 20 instruction times, with
each instruction taking 16 clock periods.
RE. 1 is reserved for the operating constant (control
constant 0 or 1 added to the timing parameter T )
discussed above.
RF. 1 is used in certain cases to pass the byte being
read or typed between the calling routine and these
subroutines. When READ is exited, it leaves the input
byte in RF. 1. When TY E is entered at location 81 A4,
the byte to be typed is taken from RF.1.
All routines alter RE.0 and RF.0. They also alter D,
DF, and X. All TY E routines modify RD.0 also. The
READ routine leaves the input byte in D as well as in
RF.1, but the byte in D will be destroyed if the
Standard Call and Return Technique is used.
When TlMALC exits, R3.1 is left holding A.1
(READ) = A. 1 (TY E) = 81, but R3.0 is meaningless.
When READ exits, R3 is ready forentryat READAH
(see Table 1). When TY E exits, R3 is ready for entry
at TY E5 (see same table). When DELAY exits, RC
is ready for another call to DELAY1. When the
Standard Call and Return Technique is used, R3 is
automatically set up.
The READ routine has two entry points - READ
and READAH. The former acts as described above
and has no other side-effects. The latter operatesjust as
READ does, but with the following side-effect. If the
character read in is a hex character (0-9, A-F) then the
16-bit contents of RD are shifted four bits to the left,
and the 4-bit hex equivalent of the input character is
entered at the right. DF is then set to 1 on exiting. If
the input character is not a hex character, RD is not
affected, but DF is set to 0 on exiting.
CAUTION: A READ may immediately be followed
by another READ, but not immediately by a TY E.
The caller should wait 1.5 bit times first, which he can
do by entering TY E at TY ED or TY E5D or by
calling DELAY1, with a parameter of 7 or greater.
The DELAY1 subroutine assumes that the calling
program counter is R3. It uses the value, n, of the
immediate byte at M(R3) to generate a delay equal to
(20 + m (2n + 6)) instruction times
where m is time constant in RE.1 (see previous
discussion). It then increments R3 past the calling
parameter and returns via a SE R3.
The TYPE routine has six different entry points.
Three of them simply specify different places to fetch
the character from: TY E types from RF.1, TY E5
types from M(R5) and increments R5, and TY E6
types from M(R6) and increments R6. TY ED and
TY E5D are entries that provide a 1.5-bit delay before
going to TY E and TY E5, respectively. The purpose
of this delay is to let an immediately preceding echoed
READ process to complete before typing. TY E 2 is
an entry which results in RF.1 being typed out in hex
form as two hex digits. Each 4-bit half is converted to
an ASCII hex digit (0-9, A-F) and separately typed
out.
Notice that the READ routines are designed to
facilitate repeated calls on READAH, while the TY E
routines are designed for repeated calls to TY E5. In

2. Features of UT62 Monitor rogram 11
Entry Absolute
Table I—UT62 Subroutine Calling Sequence
Description
Name Address
READ 813E Input ASC11-RF.1,D (if non-standard lin age).
READAH 813B Same as READ. If hex character, DIGIT—RD (see text).
TYPED 8198 1.5 bit delay. Then TYPE function.
TYPE5D 819C 1.5 bit delay. Then TYPE5 function.
TYPE5 81A0 Output ASCII character at M(R5). Then increment R5.
TYPE6 81A2 Output ASCII character at M(R6). Then increment R6.
TYPE 81A4 Output ASCII character at RF.1.
TYPE2 81AE Output hex digit pair in RF.1.
TIMALC 80FE Read input character and set up control byte in RE.1.
DELAY1 80EF Initialize RC to point to DELAY1.
Delay, as function of M(R3) (see text). Then R3 + 1.
OSTRNG 83F0 Output ASCII string at M(R6). Data byte 00 ends typeout.
MOVE 8429 See text.
FILL 824B See text.
I NIT 1 83F3 See text.
INIT2 83F6 See text.
GOUT62 83F9 See text.
CKHEX 83FC See text.
CALLR 8364 SCRT call routine.
RETR 8374 SCRT return routine.
Notes
(1) All routines, except DELAY, use R3 as program
counter, exit with SEP5, and modify registers X, D,
DF, RE, RF and location M(R2).
(2) DELAY routine uses RC as program counter, exits
with SEP3 after incrementing R3, and alters
registers X, D, DF, and RE.
(3) READ and READAH exit with R3 pointing bac at
READAH.
(4) All five TYPE routines exit with R3 pointing at
TYPE5. All TYPE routines modify register RD.
(5) R0, R1, and R4. 1 are altered by UT62 while storing
registers.
Table II—UT62 Register Utilization
Register Register
Name Number Function and Comments
SP R2 Stac pointer. UT62 sets R2 = 8CFF
PC R3 Program counter for UT62.
CALL R4 Call routine counter.
RETN R5 Return routine counter.
LINK R6 Subroutine data lin .
CNT RA Byte count.
PTR RB TablepointerusedbyUT62
SRC RB Source register
DELAY RC Program counter for delay routines. Points to DELAY1 in memory
ASL RD Hex input register.
DEST RD Destination register. RD.0 is used by all TYPE routines.
AUX RE RE.1 holds time constant and echo bit. RE.0 is used by all read
and type routines and by TIMALC, OSTRNG, and CKHEX.
CHAR RF RF.1 holds input/output ASCII character. RF.0 is used by all read
and type routines and by TIMALC, OSTRNG, and CKHEX.

1 2____ User Manual for Microboard Computer Development System CD 18S693 & CD 18S694
order to output a string of variable data characters
following a READ, given the timing restriction
mentioned earlier, it is most logical to call TY ED or
TY E5D first, using an immediate “punctuation” byte
(i.e., non-data such as space, null, etc.) to get the
required initial delay and to follow either with repeated
calls on TY E (with the output variable data
characters picked up from RF.l) or repeated calls on
TY E5 using immediate data characters. This
procedure permits a maximum output character rate.
Another routine, OSTRNG, can be used to output a
string of characters. OSTRNG picks up the character
string pointed to by R6 and tests each character for
zero. The characters should be already encoded in
ASClE If a zero is found (ASCII 'nulE), the program
terminates and returns control to the user via a SE
R5. If the character is not a zero, it is typed out to the
terminal. The OSTRNG routine uses TY ED so that
it may be called at any time - even following a read.
Tables I and II summarize the functions and calling
sequences just described.
Examples of UT62 Usage
The following examples should help clarify how to
use the UT62 read and type subroutines. Most
examples use the standard subroutine linkage which
requires that R2 point at a free RAM location.
READ Routines
This sample program will read ASCII-hex
characters into register RD translating them from
ASCII to hex in the process. Reading will terminate
when a carriage return is entered. Entry of a non-hex
digit other than a carriage return will cause a branch to
an error program. This sample program as called by
use of the standard subroutine call and return linkage.
(# indicates hexadecimal notation)
READAH = #8l3B
LOO : SE R4; ,A (READAH) . .Call the hex
. .read program
BDF LOO . .As long as ASCII hex
. .digits are entered
. .Read and shift in
. .Fall through if not hex
. .character
GHI RF . .See what character was last
. .entered
XRI #0D . .What is carriage return
BNZ ERROR..If not, BR to error
. .Characters entered are now
..in RD
The READ routine (at 8 l3E) could be used similarly
to enter characters; however, READ only enters them
one at a time into RF.l (and D) writing over the
previous entry. Note that, even though incoming data
is entered into D, the subroutine return program alters
D. Therefore, valid data will only be found in RF.l
(and RD when READAH is used) if the standard
subroutine call and return programs are used. An
alternative technique is to use R5 as the main program
counter (because all read and type routines terminate
with a SE R5) and call the program with a SE R3
(because all read and type routines use R3 as their
program counter). Example l below under TY E
Routines illustrates this technique.
TYPE Routines
Three examples using the various type routines
follow.
Example 1: This program outputs a single character
using the TY E5 routine. It uses R5 as the program
counter.
LDI#81 . .Set R3 to TY E5 routine
HI R3
LDI#A0
LO R3
LDI #FF . .Set R2 to free RAM location#3FFF
LO R2
LDI #3 F
HI R2
SE R3 . .Call type
,T’R’ . .An “R” will be typed
yy . .Next instruction
The TY E5D routine is used in the same way.
Example 2: This program outputs a character using
the TY E6 routine. Note that R6 should be the
program counter for the program calling TY E6 if the
character to be typed is an immediate byte because
TY E6 must always be from M(R6). But, because
TY E6 exits with SE 5, TY E6 must always be
called using standard subroutine linkage for typing an
immediate byte. An alternative is to use R5 as the main
program counter but point R6 at the memory location
containing the byte to be typed. This example uses
standard subroutine linkage.
SE R4 . .Branch to call routine
,#81A2 . .Address of TY E6
,TT . .Byte to be typed out
yy . .next instruction
Example 3: The TY E and TY E2 routines pick up
the byte inRF.l for typing. TY E simply outputs the
character, whereas TY E2 considers RF. 1 a hex digit
pair which it encodes in ASCII before typing. This
example types out the hex digits ‘D5\ and uses
standard subroutine linkage.
LDI #D5 . .Load hex digits D5
HI RF ..Into RF.l
SE 4 . .Call TY E2
,#81AE
yy . .Next instruction
The TY ED routine is used the same way.
Note that all type routines, except TY E2, expect
the character they pick up to be already encoded in
ASCII.

2. Features of UT62 Monitor rogram 13
OSTRNG Routine
An entire message can be typed by using the
OSTRNG routine. The ASCII bytes pointed to by R6
will be typed. When a ‘00’ byte is detected, OSTRNG
returns to the caller. This example will output the
string
RCA COSMAC
MICRO ROCESSOR
The standard call and return linkage is assumed.
OSTRNG = #83F0
SE R4; ,A(OSTRNG) . .Call OSTRNG
DC,T'RCA COSMAC’ . .lst Line
,#0D0A . .(CR)(LF)
,T’MICRO ROCESSOR\.2nd Line
,#00 ..EndofText
emory OVE Routine
This routine allows the user to move a block of data
from one area of memory into another area. There is
no restriction as to the direction of the move, and the
areas may overlap. Before a call can be made to this
subroutine, the lowest address of the source data must
be placed in register RB, the lowest address of the
destination in register RD, and the number ofbytes to
be moved in to register RA. MOVE returns to the user
via SE R5. The following example uses the Standard
Call and Return Technique.
Move = # 8429
LDI #02
HI RB
LDI #FO
LO RB
LDI #03
HI RD
LDI #F0
LO RD
LDI #00
HI RA
LDI #l0
SE R4; , A(MOVE)
yy
This sequence will move 16 bytes of data from #02F0
to #03F0.
emory FILL Routine
An area of memory can be initialized by a known
value by use of the FILL Routine. Registers RA, RB,
and RD must be initialized before the call is made. RA
must contain the number of locations to be filled, RB
must contain the lowest address of the area to be filled,
and RD.0 the data to be placed in memory. FILL also
returns to the user program via SE R5.
The following example, using SCRT, will initialize
one page of memory to #00 beginning at address #0200.
FILL = #824B
LDI #0l
HI RA
LDI #02
HI RB
LDI #00
LO RA
LO RB
LO RD
SE R4; ,A(FILL)
yy
ASCII to Hex
Conversion Routine (CKHEX)
The ASCII to hex conversion routine, CKHEX,
examines the ASCII character in RF.l. If this
character is notahex digit, CKHEX returnsto the user
(via SE R5) with DF = 0. If the character is hex,
CKHEX returns with RE.0 = hex digit, DF = l and
with the digit shifted into the least significant 4 bits of
register RD. CKHEX uses the registers described
above and, as with the other routines, is most readily
handled via the standard call and return techniques.
CKHEX is located at 83FC.
Initialization Routines
Two routines are provided, INIT1 and INIT2, that
initialize C U registers for the standard call and return
technique. These routines set up registers as follows:
R2 = R(X) -pointing to 8C3F
R3 -will become the program counter on
return
R4 -pointing to the call routine in UT62
R5 -pointing to the return routine in
UT62
RC -pointing to the delay routine in
UT62
. .Source address
. .Destination address
. .No. of bytes
. .To move
. .Call MOVE
. .Next instruction
. .Byte count
. .Destination
. .Address
. .Byte count
. .Destination
. .Data
Call FILL
. .Next instruction

14
___
User Manual for Microboard Computer Development System CD 18S693 & CD 18S694
The only difference between lNITl and INIT2 is the
location to which they return. IN IT l returns to
location 0005 with = 3, while INIT2 simply returns by
setting = 3 and assumes that the user has already set
R3 pointing to the correct return point. These
programs are intended as a convenience to free the user
from generating the overhead code required by the
standard subroutine technique. They may also be used
as an integral part of custom support programs
running on the MCDS. Their absolute addresses are
INlTl = 83F3 and INIT2= 83F6. Refer to Appendix A,
the UT62 listing, for the absolute addresses of CALL
and RET, which will be loaded into R4 and R5
respectively.
Following are examples of the use of these
programs:
Example 1: Using lNITl
lNITl = #83F3
AddressCode nemonics Comment
0000 71 DIS,#00 .Disable interrupts
0001 00
0002 CO LBR INlTl .
, .Initialize registers
0003 83
0004 F3
0005 —USR GM: . .User program starts here;
..p = 3
Example 2: Using lNIT2
1N1T2 = #83F6
Address Code nemonics Comment
0000 71 DIS,#00 .Disable interrupts
0001 00
0002 F8 LDIA.1
(START) .Set R3 to return
0003 00 .point
0004 B3 HI R3
0005 F8 LDI A.0
(START)
0006 50
0007 A3 LO R3
0008 C0 LBR 1N1T2 . .Branch to 1N1T2
0009 83
000A F6
0050 -START:- . .User program starts here
. = 3
UT62 Reentry
UT62 can be reentered by means of a branch
instruction to address 87F0H. There are no
restrictions.
Tape READ and WRITE
Subroutines
UT62 contains two subroutines, READ TA E and
WRITE TA E, of interest to users who wish to write
programs that communicate with the cassette tape
hardware. These subroutines perform read and write
operations byte by byte in a serial manner. The
routines are evoked by the standard call and return
technique described in the User anual for the
CDPI802 COS AC icroprocessor, M M-201.
READ TAPE
The READ TA E subroutine at location 8502H is
used to transfer bytes of data one byte at a time from
the tape’s buffer into register RF.1. A three-byte
memory table, given in Table III, holds the current
block number, the tape drive selected, and the current
byte count in the selected block. At the time the call is
placed, register C should be pointing at byte 3 of this
table. On return, register RF.1 contains the byte read
from tape and the table is updated by 1 byte. Register
RC is unchanged. When the byte count reaches 384
(180H), it is reset to 0, the block number is
incremented, and the next block is loaded from tape to
the buffer.
To call the READ TA E subroutine, the user’s
responsibility is only to create a 3-byte table in RAM,
set the byte and block count to 0, and set the
appropriate tape drive bit. As an alternative, the
FNDTA routine in UT62 can be used. The user
should then point register RC at byte 3 of the table and
call the subroutine. UT62 takes care of updating the
table. If a parity error is encountered, UT62 issues the
following message:
PARITY BAD THIS BLOCK
The user can either abort further calls at this point or
continue. Also, DF will be set to 0 on return from the
read that generated the parity message. Note that the
tape should be rewound at the beginning of the first
read and the play key depressed.
WRITE TAPE
The WRITE TA E subroutine at location 8500H is
used to write the byte in register RF.1 into the tape
write buffer and then to tape. When the tape buffer is
full (384 bytes), the write routine dumps this block out
to tape. The requirements for WRITE TA E are
similar to those for READ TA E. A 3-byte table in
RAM selects the tape to be written to. The write
subroutine takes care of updating the byte and block
counts.
To call the WRITE TA E subroutine, the user
needs to create a 3-byte table in RAM as shown in
Table III. The user should set the block and byte count
to 0 and set the desired tape drive bit to 1. As an
alternative, the FNDTA routine in UT62 can be
used. Then, put the byte to be written in register RF. 1
and set register RC to point to table byte 3. A call to
write (standard call and return) places the byte in the
tape write buffer. On return, register RC is intactand
the byte and block counts are updated. Because the
WRITE TA E subroutine stores blocks of data on

2. Features of UT62 Monitor rogram 15
tape, the user needs to fill the block after writing the
last byte to the buffer to assure that the last block is
written to tape. The block size is 384 (l80H) bytes.
Successive calls to write for 383 bytes (block-1) would
assure the last block transfer. The user can also
examine the byte table to see how many bytes remain
in the block and write out that quantity. Another
technique is to change the table to a count of 383
(17FH). This technique will write the final byte in the
block buffer and cause the buffer to be written to tape.
REWIND TAPE
The TA E REWIND subroutine at location 8504H
is used to enable the “REM” input on Cassette Tape
units. The prompt
REWIND, THEN HIT ANY KEY
is written on the Video Monitor screen.
Table lll—Read/write RAM table
BITS
INCREASING
ADDRESSES
765432I 0
MSB LSB
TAPE TAPE ~^m
--------------------------------
M O T l l< 5 F n ^ M C D
I0- i»w I u o t U — ^m M O D
LSB
BLOCK NUMBER
MSB, BYTE COUNT
NEXT 8 BITS,
BYTE COUNT
92CS-342I2

3. Running BASIC3
16
BASIC3 is a full floating-point BASIC in ROM
with cassette tape I/O capability. Entry into BASIC3
is accomplished while UT62 is running by the user
typing B. After responding with the title, BASIC3 asks
the user if the entry is “warm orcold."(C/ W7)Awarm
start enables the user to re-enter BASIC3 with an
existing program and data intact. A cold start clears all
program and data storage and should be used
whenever there is no existing program in memory.
While in BASIC3, the user can create and debug a
BASIC program and save it on tape in a compressed
form called pseudocode. Line editing is also available
in BASIC3 to enable program modification without
requiring the retyping of a new line.
On the CD l8S694, programs can be created,
edited, and loaded by using the text editor. The editor
stores text in ASCII code on tape which can then be
loaded into BASIC3 by the user declaring the tape as
the input device through the DIN command.
BASIC3 also allows calls to user machine language
subroutines and provides for input/output instruc
tions to any COSMAC Microboard device. For
example, BASIC3 can talk to an external UART
Module such as the CD l8S64l or input data from an
A/D Converter such as the CD l8S642.
For further information on BASIC3, the user
should refer to the manual BASIC3 High-Level-
Language Interpreter CDP18S841 User anual,
M M-84l.

17
4. Running the MCDS COSMAC
Resident Editor (CRE)
The text Editor supplied with the CD l8S694 and
available as an option for use with the CD l8S693
allows the user to create ASCII files on cassette tape.
These files can be Level I CD l802 language, BASIC3
instructions with line numbers, or simply text. The
Editor, in ROM, is evoked while UT62 is running by
the user typing E. Upon this command, the Editor
searches memory starting at 7FFFH for the top of free
RAM. After finding the top, the Editor types its title
and a prompt (^) thereby indicating its readiness to
accept commands.
Introduction
After the user has written his COSMAC assembly
language program and wants to assemble and run it, he
immediately faces the problem of convertingthe hand
written source file into a machine-readable form. This
conversion involves a keyboard-to-tape operation in
which lines on the coding sheet are transcribed to
become lines on a source tape. The Editor provides
assurance that the created files are in proper format for
later reading by the Assembler and for later
modification, if necessary, by the Editor. Details on
formats are given later in this Chapter.
Once a source file has been created and a first
Assembly run made, it is very likely that error
diagnostics will be returned by the MCDS COSMAC
Resident Assembler (CRA) asking for corrections to
the source file to conform to CRA’s rules. Typically,
the changes required at this point are “trivial” but
necessary. For example, spaces may have to be
removed in one or more expressions. The same symbol
may have been erroneously used for two purposes. An
operation mnemonic may have been misspelled or a
punctuation character such as a comma, colon, or
single quote omitted. The number of possible trivial
errors is clearly large.
To correct the errors and to alter the source file to
conform the program to the CRA rules, the Editor is
used. Typically, modifications at this point merely
involve insertion and deletion of single characters or
replacement of a small string of characters by a
substitute string. The erroneous source file is used as
an input to the Editor and the user generates a
corrected source file as an output. The new file is then
re-assembled. At this point other trivial errors may
appear which were not apparent to CRA on the first
run. For example, an erroneous instruction operand
may not have been flagged on the first assembly
because its associated statement label or operation
mnemonic may have also been in error. Thus, a new
Edit-Reassemble pass may be necessary. Finally, a
program is developed to which CRA does not object.
At this point, a first run can take place.
The probability of a logical error in the program
depends on its length and the previous experience of
the programmer. Assuming one or more logical errors
are found (via some “debugging” procedure), the
source file must again be modified. Often such
modifications are no longer trivial. For example, it
may be necessary to find all instructions which branch
to a given location and precede some of them with one
or more instructions currently not in the program.
Often, it may be necessary to delete some code or insert
some code or move some code to a different point in
the program. Several duplicated sets of in-line
instructions may have to be removed and replaced with
calls to one common subroutine which is to be added.
The user may decide to “clean up” the program
logically, in any one of several ways, or to improve its
“readability” by modifying its comments or statements
formats (by inserting TAB’s or S ACET, for
example).
Such modifications to the source file also involve use
of the Editor. After they are completed, a reassembly
may again turn up new errors of the “trivial” variety.
And so on. Thus the generation of a bug-free program
typically involves the chart shown in Fig. 4. It is quite
likely that the amount of time spent “conversing” with
the Editor will be much larger than that spent with the
Assembler.

User Manual for Microboard Computer Development System CD 18S693 & CD 18S694
18
CREATE SOURCE FILE
USING EDITOR
l i l t I
FIX "TRIVIAL" ERRORS (RE) ASSEMBLE FIX LOGICAL ERRORS
USING EDITOR ANY ERROR DIAGNOSTICS? USING EDITOR
•YES
----------
NO
l
RUN
ANY BUGS?
I
PROGRAM WORKS
92CS-28I98
Fig. 4—Flow chart for “bug-free” program.
A source program may be viewed as a long sequence
of characters. When the COSMAC Resident Editor
reads the source file, it places this character sequence in
memory, with the code in each memory byte
representing one source program character. The user is
then free to type commands to the Editor to
manipulate the memory representation of the
program. For example, the user may identify a specific
location and specify a character sequence to be
inserted there. He may also identify certain characters
to be deleted or altered. He may ask the Editor to
search for the occurrence of specific character
sequences, after which further memory modifications
(corrections) may be made. (Details of available
commands are given later).
After he is satisfied that the new memory
representation of the file contains all the desired
changes (frequently the user begins an editing session
with a hand-written list of the changes to be made), he
asks the Editor to write (create) a new file containing
the new version of the program. This new file is then
used as the input file for a reassembly.
CRE Operating
Considerations
emory Space Requirements
CRE requires about l00 bytes of the RAM work
space for its own internal purposes. The remainder of
the available RAM space is used as an editing area
called a buffer. Virtually all CRE operations involve
the buffer. CRE is designed to take advantage of all of
the available RAM space for its buffer area.
All but the l00 bytes of work space are available for
this purpose in the 4 kilobytes of RAM supplied. If
more RAM is present in the system, CRE will
automatically add it to its buffer area. It tests for
additional RAM the same way CRA does.
Input and Output Files
Normally, a user creates a file using CRE by filling
the buffer from the I/O terminal keyboard and then
causing CRE to write this information onto an output
tape (which will contain the created file).
An existing (input) file may be modified (edited) by
reading portions of it into the buffer, then using CRE
commands to alter the contents of the buffer, and
finally writing the results onto the output file.
Typically, the output file is a new version of the input
file. After an editing session, the new version is
retained and the old version is discarded (although it
may be temporarily saved for future reference or
backup).
Thus CRE has means to read an input file into the
buffer, means to examine and modify the contents of
the buffer in many ways, and means to write the buffer
contents onto an output file. Alternatively, when an
input file does not exist, the user creates an output file
by loading the buffer from the keyboard.
Record Formats
In order to understand the various commands which
CRE is designed to execute, it is fundamentally
important that the user understand how information is
normally recorded on the I/O media (tapes) and in the
buffer.
A file is a sequence of records or lines. Each line
consists of a sequence of characters. The length of a
line is restricted to 78 or fewer characters of data. Thus,
a line in a file is normally printable as a line on the 1/ O
terminal printer. Each character is represented by an 8-
bit code or byte, either on the tape or in memory.
Typically, every character in a line is a printable
character (including space or blank). Every non
printing character code represents a control character.
A control code may be generated on the keyboard
either by hitting an appropriately marked key (e.g.,
RETURN, ESC, etc.) or by depression of the CTRL
button while hitting another key. The printer reacts to
the receipt of a control character in one of several
possible ways. Some control characters (such as
carriage return, line feed, bell, etc.) cause the printer to
execute a specific control function. Other control
codes either are ignored by the printer or may cause the
equivalent of a space on the printed line.
A line in a file may contain control characters (with
certain restrictions to be discussed later). If it does, it is
quite possible that its printed record will not
completely reflect the true contents of the line. CRE
treats most control characters which it encounters
within a line in the same manner as it treats printing
characters. However, certain control characters have
special meaning to CRE.

4. Running the MCDS COSMAC Resident Editor (CRE) 19
The proper format for tape files is shown in Fig. 5.
Each line is terminated with a CARRIAGE RETURN
(CR), LINE FEED (LF) pair, followed by afield of six
nulls. The NULL character (hex code 00) is ignored by
the system. A set of nulls appears after each CR, LF,
pair merely to provide a sufficient time delay for the
printer carriage to settle to the new line when the tape
contents are being printed. Note that the last line on
the tape should be followed by a “dummy” line
containing only the single data character DC3. DC3 is
a special control character (generated on the keyboard
by hitting CTRL and S). It acts as an END OF FILE
indicator.
Tape records read by CRE are deposited into the
buffer as they appear on the tape, but with all LF’s and
NULL’s ignored. (Incidentally, the DEL or RUBOUT
character, hex code 7F, is also ignored on tape input)
While CRE operates on the data in its buffer, it
specifically uses the CR character as an indicator of the
end of a line. (Recall that a line has a variable length.)
A new line is assumed to start with the next character
in the buffer. The buffer format is shown in Fig. 6.
When CRE is depositing keyboard data into its
buffer, the ASCII code equivalent of each struck key
(any printing character, and almost any control
character - with exceptions as noted below) goes into
memory and is also “echoed” back to the printer.
However, CRE specifically ignores the LF key.
Further, when the RETURN key is hit, the CR
character goes into memory and a CR, LF pair of
characters is echoed back to the printer to start a new
line. Thus, the user terminates a line ofkeyboard input
with a single carriage RETURN. Normally, then, the
LF character should not appear at any point in the
buffer.
Whenever CRE transmits a CR character to the
terminal, it automatically appends to it the LF, six
NULL field to maintain the tape formatjust discussed.
It is conceivable that due to the user error one or
more lines on the input file or in the buffer may exceed
the 78 data character length restriction. For example,
data alterations in the buffer may have resulted in
deleted CR’s. (Note that each CR deleted in the buffer
causes the concatenation of its adjacent lines.) CRE
has the following provisions for handling lines that
exceed the length restriction:
(1) Whenever CRE is outputting a line to the printer as
the result of a user TY E command, if the line exceeds
78 characters, a “LINETOO LONG” message will also
be printed.
(2) IF CRE encounters too long a line while writing
from the buffer to the output tape, the line will be
broken up, using as many 78-data-character records as
are necessary - each terminated by an appended CR,
LF, 6-NULL field.
(3) A line which is too long on the input file is truncated
to 78 characters, with a CR appended, in the buffer.
Buffer Pointer
The total RAM space available for the buffer is
generally partially filled. When CRE is first initialized,
the buffer is empty. When data is added to the buffer
(from the keyboard or from the input tape) the buffer
expands. When data is deleted, the buffer contracts.
CRE continually keeps track of the present extent of
the buffer within the work space.
UP TO 78 DATA
CHARACTERS CR LF SIX
NULLS zDC3 CR LF SIX
NULLS
~* I *~ ~~ I *~ ~* I ► ~* I *■
FIRST LINE SECOND LINE LAST LINE END OF FILE
( FOLLOWED BY ( FOLLOWED BY " DUMMY " LINE
LF + 6 NULLS ) LF + 6 NULLS)
92CM-282I5
Fig. 5—Tape file format.
DATA CHARACTERS CR 77 DC3 CR
~~
---------------------
1
--------------------
^h- | *~ h- | ^
LINE I LINE 2 LINE m |
___
PRESENT ONLY IF LINE m IS THE
LAST LINE IN THE INPUT FILE
Sc CM - c8 2I4
Fig. 6—Memor buffer format.
This manual suits for next models
1
Table of contents