Wednesday, September 21, 2016

Cromemco and the line editor

Marcus is in the middle of rebuilding this circa 1980 Cromemco Computer.  Actually the circuit cards and all software are from Cromemco, the case shown is one from any number of manufacturers at the time.

But I digress.

In order to successfully configure the system I have to edit, i.e. textually manipulate a number of Operating System files.

Here is an example

ty /cmd/makeram.cmd
% create ram disk directory and fill it with progs necessary to copy disk

echo "Creating ram disk of 128K bytes, 2016 version"
ramdisk -c 128 rd0
if -err exit

makfs -b 2 -i 20 rd0
if -err exit
mount rd0 /ram
chowner bin /ram

% copy useful files into /ram
d /bin
copy -v copy.bin cptree.bin ls.bin mount.bin mode.bin /ram
copy -v unmount.bin inithard.bin initflop.bin makfs.bin  /ram
copy -v icheck.bin dcheck.bin readall.bin free.bin citoh/screen.bin /ram

But modern text editors, and even those in about 1984 were screen oriented.  Trouble is I can't use the screen editors until the Operating System config files are corrected.


It is back to the Cromeco Line Editor,

Editor Types
I'd divide text editors into the following categories from newest to oldest

Gui Word Processor
Like Microsoft Word.  Able to Type into a Graphical User Interface (GUI) into a window that is resizable  (i.e. not full screen), able to display proportional text  (i.e. not monospaced all same width).  And seamlessly include graphics and any diagrams.  Able to handle colour.

Gui Screen Editor
A Screen based editor, meaning you can move around the editor window with cursor keys, but not usually interact with the mouse.  And only display monospaced text and no graphics or bitmaps. Colour support may be there but only in a rudimentary fashion

Line Editor
You view the file that you are editing one line at a time.  Text is monospaced, their is no mouse support or screen based editing e.g. cursor keys.

Often you are simply adding to the beginning or to the end of an existing document.  Adding or changing text in the middle of the document often involves you moving an invisible document pointer using text commands and then once you move from command mode to insert mode, typing in text, returning to command mode and printing the page again to see if you made the right changes.

A line editor is probably the most basic form of interactive input to a computer.  The only thing worse would be punched cards  (where you convert a handwritten program to cards with holes in them in special places, and those cards is read to convert those specially placed holes into the text that you want).  A card reader is not interactive.

Cromemo Line Editor

Yes it is pretty basic!  And this is the best version that they had


Cromemco made 2 versions of the editor  00.09 and 00.10 and you can see that the best is 00.10 and it is under 7K bytes in size.

Program Loading
This program was written in Z80 Assembler and when the computer loads this program it simply reads the code and loads it to hex 0x100.   One should contrast this with

- Relocatable code
The code is written in such a way that it can be freely loaded at any start address without patching or manipulation

- ELF format or similar
Today code would be in ELF or similar format meaning that the binary cannot simply be loaded into memory but the disk image contains different parts of the program that are loaded and patched appropriately.

Additionally today programs with make use of 'dynamic link libraries' meaning that they rely on subroutines not in the Operating System but (say) in a set of Shared library directories.  This too needs resolution at runtime

But back in 1980 such mechanisms were not invented.  A program would load statically, in this case at hex 0x100 and the program would make calls to the CDOS Operating System as required.


CDOS i.e. Cromemco Disk Operating System,  was a superset of the then standard Digital Research CP/M Operating System.

These are the main Operating System Calls that were available to any programmer.   Really just a basic set of commands to read and write files from the disk and also to write character output, line by line to a Serially connected terminal screen.

CP/M,  the rival Operating System also provided an editor called ED.   Here is some documentation  Both ED and Cromemco edit were laughably unforgiving but at the time, a lot better than punched cards, or nothing! UNIX also had a line editor called ed, really unfriendly.

Text Editor Messages

Copyright (c) 1978 CROMEMCO, INC.
Rewinding file
Type a command line to be executed by the M command.
Obliterate Text Buffer and rewind Input File (Y/N)?
Discard Text Buffer, restore Input File, and quit EDITOR (Y/N)?
File not found
Room for yyy  more characters in buffer
Save Buffer Full
Use space bar to move across line; set tabs with "T".
         1         2         3         4         5         6         7
Macros nested too deep
CROMEMCO Text Editor version 00.10
All text now on Output File
Cannot find "
End of Input File
Text Buffer Full
"-" not allowed in this command
" not legal here
Missing ">"
No Directory Space
Output File Write Error
Illegal Filename
Cannot edit xxx file; rename file

New File


The full manual for the Text Editor is Here

The full Manual for the CDOS Operating System is here

Some Time Later

After what seems like an eternity later I have made the necessary edits to the screen Editor configuration files, using the line editor.   So now I can continue my editing using a Screen based editor and so further configuration will be accelerated.

But before further ado, time for a full backup, this system is now a mature 38 years old and in the case of disk failure I want to be able to revert back to this moment and not have to start configuration again from scratch.