OS/8 Emacs

830 views
Skip to first unread message

Bill Silver

unread,
Apr 3, 2020, 10:40:08 PM4/3/20
to PiDP-8

I have written an emacs-like editor for my new pidp8/i that runs under OS/8 and communicates with the user via character I/O on the console terminal. The console is expected to be, or behave like, a simple fixed-size character-oriented display terminal of the sort that was available in the 1970's, able to process a few basic ANSI escape sequences. Both MobaXTerm and the basic Linux screen (e.g. CTRL-ALT-F1) support this protocol.


The attached photo shows the editor (“E8”) displaying a portion of its pal8 source code. You can see the typical emacs mode line showing that the file has changed, the filename, and the size in characters. The displayed code shows the command dispatch tables, giving a rough feel for the control, alt, and ^X commands that have been implemented. The only important remaining task is to implement incremental search, which should be done in a day or so.


E8 is pretty responsive, even throttled down to 300K, close to real 8/I speed. It goes to some trouble to minimize characters written to the display, and should run just fine at 1970’s bandwidth, e.g. 9600 baud. (OK, late 70's)


If people are interested in this sort of thing, I can share the source code. It’s just a bunch of pal8 files and is easy to assemble and run under OS/8. Don’t try to assemble it at 300K, though.


E8 screen shot.PNG

Ian Schofield

unread,
Apr 4, 2020, 1:21:57 PM4/4/20
to PiDP-8
Dear Bill,

 If you have come up with a screen editor for OS/8, that is brilliant. Anything is better than TECO. (Now I will be flamed by all DEC fanatics!).

Regards, Ian.

William Cattey

unread,
Apr 4, 2020, 9:07:03 PM4/4/20
to PiDP-8
Wow! 

That’s super impressive. 

I’m definitely interested in this!

Bill Silver

unread,
Apr 4, 2020, 11:50:14 PM4/4/20
to pid...@googlegroups.com
Thanks for the interest and kind words. I'll write some documentation on how to assemble and use and then make the source available. If you're familiar with Emacs it should be pretty natural, although of course this is nowhere near contemporary Emacs in capabilities. But I am using E8 to develop its own source code, and yes it's worlds better than line-oriented editors designed for teletypes. I don't know how I managed that back in 1973, but I was 19 and didn't yet know any better.

Incremental search is now mostly working. See attached picture.

search.PNG

Frank Laczko

unread,
Apr 5, 2020, 12:06:26 AM4/5/20
to Bill Silver, PiDP-8
Interesting. I would like to try it when you're done. 



Sent from my T-Mobile 4G LTE Device

--
You received this message because you are subscribed to the Google Groups "PiDP-8" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-8+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pidp-8/3b970999-ab38-4ad1-8800-9812dec8e929%40googlegroups.com.

Bill Silver

unread,
Apr 5, 2020, 3:04:11 PM4/5/20
to PiDP-8
Attached is source code and documentation. No doubt there will be problems, so let me know how it goes.
E8.zip

Folke Will

unread,
Apr 5, 2020, 5:27:18 PM4/5/20
to PiDP-8
Awesome!

I was able to assemble and run it on my SoC PDP-8/I implementation with enabled EAE. Thanks for not using 8/E instructions and EAE mode 1 only! 

To get the files onto my machine, I loaded them as papertape images and then loaded them in PIP using lines like E8.PA<PTR:. That way, I didn't have to ctrl+z. Instead, I had to insert trailer bytes at the beginning of the files because the first byte is usually lost when reading papertapes.

Assembling on OS/8 V8 went without errors. The assembling process took less than a minute with original speed and reading from a simulated RF08.

Unfortunately I haven't implemented a TTY yet, but I could see the escape sequences on my ASR33 simulation as shown on the attached screenshot. Finally a reason to implement a terminal. 


e8.jpg

William Cattey

unread,
Apr 5, 2020, 9:34:22 PM4/5/20
to PiDP-8
I've downloaded the zip file, and glanced at the documentation.
Very professional in style.

I've got a couple other projects going right now, but I'll try to play with e8 before too long.

Thanks for sharing this!

-Bill (the CATT, not Silver.)  :-)

Bill Silver

unread,
Apr 6, 2020, 9:14:17 AM4/6/20
to pid...@googlegroups.com
Regarding 8/e and EAE instructions: The 1970 edition of the Small Computer Handbook, which describes the 8/I,, says nothing about what happens if you combine the MQA and MQL bits. The result is the SWP instruction, which very usefully swaps AC and MQ. SWP is documented for the 8/e, and if it was ever documented for the 8/I I an mot aware of it. But it did work on the 8/I, or at least it worked on the 8/I that I used. So E8 uses SWP in one or two places, and if you have an 8/I simulator and want to run E8, you need to have SWP.

Bill Silver

unread,
Apr 8, 2020, 7:44:19 PM4/8/20
to PiDP-8
Attached is a new version dedicated to updated documentation. The instructions have a few clarifying remarks, and one important missing item--the ^F option during an incremental search. The code has lots more comments, and the executable is unchanged expect for a couple of trivial simplifications.

Thinking about query-replace...
E8v1.zip

Bill Silver

unread,
Apr 9, 2020, 7:31:41 PM4/9/20
to PiDP-8
Attached is a new version with five new commands, including search for previous search string, and forward and back one word.

I've noticed that there have been over 130 views of this thread, but no significant comments that indicate that anyone has tried this out and what they found. So I can't tell if this is of much interest to the community and whether I should continue development for other than my personal amusement. I don't really know what kind of things do interest folks, and it's quite OK if this is not one of them.

E8v2.zip

John Kennedy

unread,
Apr 9, 2020, 7:36:04 PM4/9/20
to PiDP-8
I'll be trying it this evening or at the weekend.

Mike Katz

unread,
Apr 9, 2020, 7:44:15 PM4/9/20
to John Kennedy, PiDP-8
I am interested I just haven't have time to try it yet.  I was thinking of writing a key mapper to emulate my favorite editor, Brief, by Underware. 

The last time I used EMACS Gerald Ford was president :)

I'm currently using the Slickedit Editor with Brief Emulation on Windows and Linux.
--
You received this message because you are subscribed to the Google Groups "PiDP-8" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-8+un...@googlegroups.com.

Bill Silver

unread,
Apr 9, 2020, 8:13:20 PM4/9/20
to PiDP-8
The command dispatch tables in E8.PA define the key mapping, and you could change them to whatever you want, although you'd still get Emacs-like behavior just with different command keys. I've been thinking about other customizations that users could define.

Bill Silver

unread,
Apr 10, 2020, 8:36:42 PM4/10/20
to PiDP-8
Hey, if you used Emacs during the Ford administration (say 1976), were you at the MIT AI Lab? Or was it running somewhere else that early?


On Thursday, April 9, 2020 at 7:44:15 PM UTC-4, Mike Katz wrote:

Bill Silver

unread,
Apr 11, 2020, 3:08:42 PM4/11/20
to PiDP-8
New version with query-replace. I'm thinking this is the last major "must-have" for a competent editor.

Also, source files reorganized and simplified for those using better methods than PIP to copy to OS/8. PIP still works. The manual gives details.

Happy to answer any and all questions, fix bugs, etc. This project has been highly amusing for me personally, and I hope others may find it useful. 

E8v3.zip

Obsolescence

unread,
Apr 12, 2020, 7:33:51 AM4/12/20
to PiDP-8
Bill,

Amazing! This must be the most significant new PDP-8 program in a long long time. I always hoped for a nice OS/8 editor... it completes the PDP-8 as a fully fledged personal computer IMHO.

A simpler way to move the source code over:
I used os8-cp to copy the source files onto the regular OS/8 RK05 disk image:

   sudo ./os8-cp -rk0s <path and file of disk img> -a <path and file of source file to be copied> DSK:

And then your compile recipe worked flawlessly. Amazingly for a modern piece of software, E8 compiled and ran straight away. This is a major improvement in my life with the PDP-8. I always cross-compiled with palbart due to the lack of a comfortable OS/8 editor, to be honest... TECO is a bit too spartan for most of us (avoiding the word 'me' here), and I never got far with VT52-edit.

These weeks, I am forced to migrate from vi to emacs because of my pidp-10 project, so having a PDP-8 version is a MAJOR thing. I'll be the first one on the planet to learn & get comfortable with emacs - on a PDP-8!

I have not tested out all the features (that comes next) but all the basics work as they should for sure.

Thank you so much!

Kind regards,

Oscar.

(*disclaimer: I used regular simh, as I am PiDP-less in my current location, thanks to this bloody virus. But it does not matter I would think).

Obsolescence

unread,
Apr 12, 2020, 7:49:50 AM4/12/20
to PiDP-8
All features seem to work fine here, although I have not tried editing/inserting very large files yet.

How did you complete such a large programming project? Was it something you had been working on back in the day, or something from scratch?

Thank you!

Vincent Slyngstad

unread,
Apr 12, 2020, 10:26:38 AM4/12/20
to PiDP-8
Loving this and hoping to play with it more soon!

Here's my tiny suggestion to allow E8 to build with different assemblers:
*** e8.pa-      2020-04-12 00:21:44.553211800 -0700
--- e8.pa       2020-04-12 00:21:58.771754400 -0700
***************
*** 20,25 ****
--- 20,27 ----
  LSR=7417
  CAM=7621
  SWP=7521
+ MQL=7421      / Added by VRS
+ MQA=7501      / Added by VRS

  / DISPLAY SCREEN DIMENSIONS. WD * (HT+1) MUST BE < 3968 TO AVOID
  / RUNNING INTO OS/8 USE OF LAST PAGE OF FIELD 1

Then I wouldn't have to keep patching it :-).  Also, I've got a simple Makefile that keeps the various source modules synced so you needn't edit everything 3 times.

I wondered if it would be worthwhile documenting and/or eliminating differences from pico or nano?

    Vince

Bill Silver

unread,
Apr 12, 2020, 2:38:15 PM4/12/20
to PiDP-8
I first thought of writing E8 two weeks ago when I got my PiDP8/I working. I got it mostly to write code, rather than just running old programs. When I thought about a good first program to write, I remembered what text editing was like back then and realized that I’m just too old for that. So E8 was an ideal project. I have written emacs-like editors twice before, and well remember how to do it (once for the TI-980 minicomputer and once for the Z80 micro, both over 40 years ago). I wrote most of it using modern Emacs on my Windows PC, and then switched to E8 itself when it became functional enough. 

For your PiDP-10, are you going to run ITS or some DEC OS? I ask because you mentioned migrating to Emacs for that project, and Emacs was introduced on a PDP-10 running ITS.

Bill Silver

unread,
Apr 12, 2020, 2:41:11 PM4/12/20
to PiDP-8
I added those EAE definitions. You'll see them in the release I plan for later today. What are pico and nano?

Steve Tockey

unread,
Apr 12, 2020, 3:09:42 PM4/12/20
to PiDP-8
Bill,
I loaded the E8 source code and got it built just fine. However, I am running my PiDP-8/Is with the OS/8 console in a Raspbian Terminal window. It's not responding to the ESC sequences as I thought it should. I was under the impression that Raspbian Terminal windows did handle standard VT-100 commands. At least it appears to so on my PiDP-11/70. Anyway, more work needs to be done on my end before E8 does what it is supposed to in my configuration. If I need to edit the E8 source code to make it use different ESC sequences, do you have a quick start pointer to where in the E8 code base I need to go (hint: that would be a useful thing to include in the manual)?

Vincent Slyngstad

unread,
Apr 12, 2020, 3:10:03 PM4/12/20
to PiDP-8


On Sunday, April 12, 2020 at 11:41:11 AM UTC-7, Bill Silver wrote:
I added those EAE definitions. You'll see them in the release I plan for later today. What are pico and nano?

My understanding is that the PINE email client comes with an editor called pico, which is a very small, very fast emacs-like editor,  for composing emails and replies and such.  The license has since been relaxed, but at one point licensing issues meant that it was not possible to include it in the open source Linux base.  So, nano was created, instead.  Nano is the default editor in the Linux distributions I've tried.  I was thinking that a new generation of folks is growing up with nano "muscle memory".

Vince

Oscar Vermeulen

unread,
Apr 12, 2020, 3:24:52 PM4/12/20
to Steve Tockey, PiDP-8
Steve,

Make sure that you have
   set tti 7b
in your boot script.

Kind regards,

Oscar.

Bill Silver

unread,
Apr 12, 2020, 3:48:19 PM4/12/20
to PiDP-8
If "Raspian Terminal window" is what you get when you do CTRL-ALT-F1, then it works fine on my end. Maybe Oscar's advice will do the trick. If not, it's easy to change the escape sequences. In E8BASE search for "CLRSC," (clear screen), "CLREOL," (clear to end of line), and "SETCUR," (set cursor). The first two are simple 0-terminated strings. SETCUR is a subroutine. Let me know how it goes. Good idea to include this in the manual.

Steve Tockey

unread,
Apr 12, 2020, 3:51:09 PM4/12/20
to PiDP-8
Oscar, Thanks, that did it.

Bill Silver

unread,
Apr 12, 2020, 7:24:56 PM4/12/20
to PiDP-8
Attached is version 4. Major feature is a limited undo to recover deleted characters--see the manual for a description. Also followed suggestions from Vince and Steve. Note that this version doesn't clear the screen on exit, it just puts the cursor at the last line. 

Not sure if I can think of any practical thing left to do, but this has been amusing and I don't really want to stop, but we're almost out of memory for more code, and I have a day job, so who knows.

e8v4.zip

Steve Tockey

unread,
Apr 12, 2020, 7:32:54 PM4/12/20
to PiDP-8
Bill,

> . . . but we're almost out of memory for more code . . .

It’s not a *real* PDP-8 project until you have to struggle with compressing what you already have in order to make room for just a little bit more.

Vincent Slyngstad

unread,
Apr 12, 2020, 8:48:49 PM4/12/20
to PiDP-8


On Sunday, April 12, 2020 at 4:24:56 PM UTC-7, Bill Silver wrote:
Not sure if I can think of any practical thing left to do, but this has been amusing and I don't really want to stop, but we're almost out of memory for more code, and I have a day job, so who knows.

I hadn't wanted to distract from your development, but for running on real hardware, the EAE requirement limits the number of machines that can be used.

Vince

Bill Silver

unread,
Apr 12, 2020, 9:23:25 PM4/12/20
to PiDP-8
Interesting. It would be a pain, but no EAE could be done. How many PDP-8s are still running in the world, do you think? How many have EAE? Do the ones without EAE have enough core? I suppose if someone had a specific 8 who wanted to run E8 and had enough core, I'd pay attention. 

Steve Tockey

unread,
Apr 12, 2020, 9:34:05 PM4/12/20
to PiDP-8
That would be a good question to also ask on the alt.sys.pdp8 group as well?

Vincent Slyngstad

unread,
Apr 12, 2020, 10:19:55 PM4/12/20
to PiDP-8


On Sunday, April 12, 2020 at 6:23:25 PM UTC-7, Bill Silver wrote:
Interesting. It would be a pain, but no EAE could be done. How many PDP-8s are still running in the world, do you think? How many have EAE? Do the ones without EAE have enough core? I suppose if someone had a specific 8 who wanted to run E8 and had enough core, I'd pay attention. 

I was thinking about doing it eventually, as I have some machines like that.  I also know of a few 8/E which don't have the option.  For space war, I tacked on a DECUS EAE emulator and tweaked the source.  That needs a couple of code pages free, though.

Also, IAC cannot be combined with RAL or RAR on some CPUs, and you've got an instance of that in your code, too.

    Vince

Oscar Vermeulen

unread,
Apr 13, 2020, 7:28:53 AM4/13/20
to Bill Silver, PiDP-8
Bill,

On Sun, 12 Apr 2020 at 20:38, Bill Silver <bsi...@tidewater.net> wrote:
I first thought of writing E8 two weeks ago when I got my PiDP8/I working. I got it mostly to write code, rather than just running old programs.

I wish I could say that. Mostly because the lack of a comfortable editor so far has been a bit of a pain for spoiled youngsters (I qualify for that label at 52, in the PDP-8 world?), I only wrote programs using palbart as a cross-compiler, which os8-cp makes very simple to do. Or even just used the built-in simh features. Which do not feel the same as native development obviously. I once thought of porting the tiny CP/M VDE editor, but quickly shrank back from the reaiity of doing so...

For your PiDP-10, are you going to run ITS or some DEC OS? I ask because you mentioned migrating to Emacs for that project, and Emacs was introduced on a PDP-10 running ITS.

The PiDP-10 simply uses Rich Cornwell's KA10 simulator, so it will run anything, no credit to me. But ITS was my motivator, it is the ultimate retrocomputing playground when you invest an hour or so to get comfortable with the basics. Lars (and Angelo, and all the other ITS contributors, he pointed out to me!) made the ITS distribution very rich in fun things to do. Like all the graphics options, firing up the attached PDP-6 with simulated front panel, and loads of languages and applications. The ITS simulation project ventures out way beyond giving you the CPU through a text terminal.

Kind regards,

Oscar.