TECO for 6502

Keith Packard keith at reed.UUCP
Mon Dec 23 19:03:43 AEST 1985


*** REPLACE THIS LINE WITH YOUR MESSAGE ***
     The accompanying posting is of the TECO text editor in 6502 assembly
language.  I wrote it some time back for GENEROS (GENERic Operating System),
an OS I wrote for assembly language development on OSI computers.  It
should be fairly easily adapted for other 6502 systems like Atari, Apple, and
Commode-odor.

     For those unfamiliar with TECO, it is a character-oriented editor that
can handle arbitrary length files with arbitrary length lines. That in itself
gives it a big advantage over many other editors.  TECO is commonly found on
DEC-based operating systems and has been around quite a long while.  TECO can
also be considered a programming language, in that it programs can be written
containing procedures (macros), variables (Q-registers), and conditionals.
A program to solve general Towers of Hanoi problems has been written!  More
useful macros to do funky sorting, program renumbering, justification, and
other useful things are frequently found.

	Quotes from TECO users:  "Wow!", "Huh?", "Powerful!", and "TECO macros
look like line noise from a modem."  The original EMACS was a macro written in
TECO!

	This perversion of TECO is based on the PDP11 version 36.  I believe
the current version is V38.  This is a pretty complete implementation. The
only thing I can think of missing is the VT52/100 scope watch commands (W and
:W, etc) and perhaps a few of the E flags.  For more info on the command set,
refer to the DEC PDP11 TECO User's Guide, order DEC-11-UTECA-B-D.

	A little bit about this TECO:  Basically, the I/O interface will have
to be redone for your particular operating system.  GENEROS was a pretty basic
OS. To create a file, the appropriate file name string was SCANned, a device
handler was FETCHed, the specified file was CREATEd, allocating as large a
space as was available on the device.  Calls to the handler were made to write
256-byte blocks (TECO handled the buffering itself).  Files are terminated with
a control-Z.  When done, the file is CLOSEd, freeing all unused space.
File names could be 9 characters with an additional 3 character extention and
were packed in a 40-character set called RAD40 (like DECs RAD50) that allowed
3 characters to be packed in 2 bytes.  The set contained space, 0..9, A..Z, and
3 special characters (not normally used).  You'll probably need to hack a lot
of the file handling down to the basic character I/O routines and implement
file handling all over again for your brand of OS.  This should be pretty
straight forward after seeing the I/O calls.

	Screen handling was designed to support a terminal and should easily
convert to mapped screens as well.  The code does binary I/O and knows about
some basic screen control codes like cursor up and back.  You can probably
do a direct OS call without having to hack the code much.

	If you get too lost, I may be able to handle questions.  PLEASE be
sure to direct them to Bob Ankeney at ...!tektronix!reed!omsi

	Good luck!!

Bob Ankeney		...!tektronix!reed!omsi



More information about the Comp.sources.unix mailing list