Introduction
This is a short guide to using the text editor called “KED” in RT-11 on the PDP-11.
KED is a full-screen editor that comes with RT-11. It is intended to be used with a VT100 or later model DEC serial terminal. A similar editor called K52 is for use with VT52 and VT55 terminals.
For the sake of simplifying this guide, I am going to be focussing on VT100 (and VT100 compatible) terminals. So I will not be discussing the differences between K52 and KED here.
My main interest in KED is using it to create and edit PDP-11 assembly language source code files and plain-text files, both on real VT100 terminals, and on a PC-keyboard under SIMH.
Starting KED
There are several ways to start KED (KED.SAV) and load your existing text file (or create a new text file).
The method I prefer is to type “KED [filename] <CR>” at the RT-11 prompt.
If the file does not exist, you will be asked to confirm that it should be created.
Here is an example of starting KED and creating a new file:
.KED MYDOC.TXT ⤶ ?KED-W-File not found - Create it (Y,N)? Y ⤶
KED will then start and your file will be displayed. If you are creating a new file, the screen will be blank except for a flashing cursor in the top left corner.
VT100 Keyboard
KED relies heavily on special functions that are accessible only via the terminal’s numeric keypad. So getting familiar with the numeric keypad, and the commands that are accessible via the numeric keypad, is a necessary first step to editing and saving files.
The KED numeric keyboard configuration for the VT100 is shown to the right. Click on the picture, to see a larger version of it.
The text at the lower-right corner of the key shows the key name.
Keys PF1 and PF2 have a special purpose. PF1 is the “Gold” key, and PF2 is the “Help” key.
All other keys have two functions. The text on the top row of the key shows the function that the key will perform if pressed alone. The text on the bottom row shows the function that the key will perform if the PF1 (“Gold”) key is pressed first. It may be helpful to think of PF1 as being a “Shift” key for the numeric keypad.
PuTTY Keyboard
I use PuTTY as a VT100 emulator on the PC when running RT-11 under SIMH.
Configuring PuTTY to work properly as a VT100 emulator and to talk to SIMH involves a few steps. I will sometime put together a separate How-to Guide for that. But just be aware that if the display or keyboard are not responding under KED as expected, you may need to change some configuration settings in PuTTY. This is necessary sometimes to enable the PC’s numeric keypad to emulate the VT100 keypad, and for the VT100’s escape codes (sent to the display) and text scrolling to work properly.
In particular, your .INI file in SIMH will need to include the following lines>
set tti 8b set tto 8b
You should also look the terminal size (in PuTTY) to 24 lines of 80 characters. Otherwise you will get odd behaviour when scrolling up or down.
One thing to be aware of: For the PC’s numeric keypad to function correctly in KED under PuTTY, you will need to go into PUTTY’s Change Settings -> Terminal -> Features panel and check that “Disable application keypad mode” is unticked. If it is ticked, the keypad will return the ASCII code corresponding to the numeric key pressed (such as 0x37 for the ‘7’ key) rather than the special sequence that signifies a numeric key press. The result will be that you won’t be able to access any of the KED numeric keyboard functions (such as GOLD -> 7, which is necessary to enter a Command, such as EXIT, SAVE or QUIT).
Once PuTTY and SIMH are configured, you will notice the following differences when attempting to use the PC’s keyboard to emulate a VT100 keyboard:
- The top row of the PC’s numeric keypad (Numlock, /, * and -) does not emulate the top row of the VT100 numeric keypad. Ignore the top row on the PC. You won’t need it.
- The first four function keys on the PC (F1, F2, F3 and F4) are instead used to emulate the top row of the VT100 numeric keypad. Of these, the two you will use the most are F1 (equals the PF1 “Gold” key) and F2 (equals the PF2 “Help” key).
- The PC’s numeric keypad has a large (double-size) “+” key above the Enter key. This emulates the DELCHAR/UNDELCHAR key in KED (marked as a comma key on the VT100). Because of the size of this key on the PC, there is no DELWORD/UNDELWORD KED key on the PC (this is the minus key on the VT100).
Functions and Commands
KED is a fairly powerful editor. It can (for example) perform search-and-replace and cut-and-paste operations. However, this How-to Guide is only concerned with using KED for the simplest operations. You’ll need to consult the KED documentation for information about its more advanced commands.
Here is a list of the basic functions and commands that are useful when getting started with KED:
Function or Command | Real VT100 | PuTTY in VT100 mode |
---|---|---|
Move cursor within file | Arrow keys | Arrow keys |
Move to top of file | PF1-5 | F1-5 |
Move to bottom of file | PF1-4 | F1-4 |
Delete character to left of cursor | Delete (on main keyboard) | Backspace (on main keyboard) |
Delete character under cursor | DELCHAR | + |
Delete to end of line | PF1-2 | F1-2 |
Paste last deleted character | PF1-UNDELCHAR | F1 then + |
Advance forwards through file | 4 | 4 |
Backup through file | 5 | 5 |
Advance/Backup by one character | 3 | 3 |
Advance/Backup by one word | 1 | 1 |
Advance/Backup to end of line | 2 | 2 |
Advance/Backup by one “section” | 8 | 8 |
Update the display | CTRL-W | CTRL-W |
Save file and exit | PF1-7-EXIT-ENTER | F1-7-EXIT-ENTER |
Abandon changes and exit | PF1-7-QUIT-ENTER | F1-7-QUIT-ENTER |
A few things to note about the table above:
- Text in italics represents text that needs to be typed on the main keyboard. All other text represents the key of that name (usually on the numeric keypad).
- ENTER means the Enter key on the numeric keyboard (the Return key on the main keyboard is not an acceptable alternative).
- By default a “section” is 16 lines, but this can be changed.
- On a real VT100, the DELCHAR/UNDELCHAR key is the comma key on the numeric keypad. It is immediately above the Enter key.
A concise summary of major KED commands can be found in Chapter 1 of the RT-11 Quick Reference Manual (DEC Order Number AA-M241D-TC). See the links section below for access to the full document. Alternatively, click here to access a local copy of Chapter 1.
Brief guide to compiling PDP-11 assembly-language programs
Source files have the suffix “.MAC”.
To compile the source file MYFILE.MAC:
.MACRO MYFILE/LIST
To link the resulting object file:
.LINK MYFILE
To run the resulting executable file:
.R MYFILE
Revision History
16 September 2015:
- Posted initial version
22 December 2015:
- Added link to the RT-11 Quick Reference Manual, and a local copy of Chapter 1
- Explained the significance of the PuTTY “Disable application keypad mode” setting
30 July 2016:
- Ported this page across to WordPress. Made formatting changes to suit.
5 June 2017:
- Updated the “PuTTY Keyboard” section to include some speicifc information about configuring PuTTY and configuring the SIMH .INI file.
- Added the new section titled “Brief guide to compiling PDP-11 assembly-language programs”.