Thursday, July 9, 2015

It's TECO Time!

Although it took some time, I have more or less figured out EDIT.  But I also realize that writing any sizable amount of code in it is going to be painful.  So I decided it was time to look at TECO, OS/8's other built-in editor.  I looked over the section in the OS/8 Handbook, fired it up, and tried it out on my Hello World program.

While TECO is a lot more powerful than EDIT, it's also a lot more complex.  And it was made even more so by the OS/8 Handbook, which turned out to just be wrong or incomplete.  Even just loading a file was a major chore.  According to the Handbook, you start up the editor with the command RUN TECO.  This will give you the * prompt, at which point you type in either ERHELLO.FT$EWHELLO1.FT$$ or something like that.  (One peculiar thing about TECO is that you have to hit the Escape key a lot, and this echoes on the screen as a $.  So the command above is actually ERHELLO.FT<esc>EWHELLO1.FT<esc><esc>.  Commands are always terminated with 2 Escape presses.)  This is supposed to open HELLO.FT for reading, and HELLO1.FT for writing.  It was annoying, because I would have to make a copy of my source file every time, but c'est la vie. 

Well, as it turned out, I tried a number of variations of this command and none of them worked.  After a quick Google I found both TECO's Wikipedia entry and especially the TECO Pocket Guide to be much more helpful.  It turns out there's a simpler command, EBHELLO.FT$Y$$, which opens HELLO.FT for read/write and even creates a backup.  Not really sure what the Y is for, but it seems to need it to work.  So to open an existing file to edit:

      .RUN TECO

      *EBHELLO.FT$Y$$

But The TECO Pocket guide actually provided an even simpler way, which is the equivalent of the above:

      .TECO HELLO.FT

If only the Handbook had given me that...  

I have similarly found other commands that the Handbook was wrong about, so I've decided to rely on the Pocket Guide for commands.  The Handbook might still be useful for TECO concepts, so I'm going to continue reading through the rather large section, but refer to the Pocket Guide as I'm actually using it.

Btw, even if you have no interest in using TECO (and unless you're working on a PDP-8 or similar computer, I can't see why you would), reading the Wikipedia entry is still interesting.  Apparently TECO started with the PDP-1, not the PDP-8, and the famous Emacs actually started out as a set of macros for TECO until it was developed as a stand-alone editor.

No comments: