Microsoft Editor

(This is a guest post by Antoni Sawicki aka Tenox)

In a recent blog post I lamented the lack of a good console/cmd/PowerShell text editor for Windows. During the process I made a rather interesting discovery, that in a fact there IS a “native” Windows, 32bit, console based text editor and it was available since earliest days of NT or even before. But let’s start from…

…in the beginning there was Z editor. Developed by Steve Wood for TOPS20 operating system in 1981. Some time after that, Steve sold the source code to Microsoft, which was then ported to MS-DOS by Mark Zbikowski (aka the MZ guy) to become the M editor.

M editor

The DOS-based M editor was included and sold as part of Microsoft C 5.1 (March 1988), together with the OS/2 variant, the MEP editor (perhaps M Editor Protected-mode). The official name of M/MEP was simply Microsoft Editor. The same editor was also available earlier (mid-1987) as part of the  MS OS/2 SDK under a different name, SDKED. Note that normally SDKED insists in operating in full screen mode. Michal Necasek generously spent his time and patched it up so that it can be run in windowed mode for your viewing pleasure.


However my primary interest lies with Windows. The NT Design Workbook mentions that an early days self-hosting developer workstation included compiler, some command line tools and a text editor – MEP.  In fact these tools including MEP.EXE can be found on Windows NT pre-release CD-ROMs (late 1991) under MSTOOLS. It was available for both MIPS and 386 as a Win32 native console based application.

MEP on Windows NT Pre-Release

MEP.EXE was later also available for Alpha, i386, MIPS, and PowerPC processors on  various official Windows NT SDKs from 3.1 to 4.0. It survived up to July 2000 to be last included in Windows 2000 Platform SDK. From time perspective it was rather unfortunate that it was buried in the SDK and overshadowed by Visual Studio instead of being included on Windows NT release media.

MEP from NT SDK on Windows NT 4.0

The Win32 version of MEP also comes with an icon and a file description which calls it Microsoft Extensible Editor.

Z editor Icon

But that’s not the end of the story. The editor of many names survives to this day, at least unofficially. If you dig hard enough you can find it on OpenNT 4.5 build. For convenience, this and other builds including DOS M, OS/2 MEP and SDKED, NT SDK MEP can be downloaded here.

Digging in through the archive I found not one but two copies of the editor code are lurking in the source tree. One under the name MEP inside \private\utils\mep\ folder and a second copy under name Z (which was the original editor for TOPS) in \private\sdktools\z folder. Doing a few diffs I was able to get some insight on he differences. Looks like MEP was initially ported from OS/2 to NT and bears some signs of being an OS/2 app. The Z editor on the other hands is a few years newer and has many improvements and bug fixes over MEP. It also uses some specific NT features.

Sadly it looks like the Z editor for Win32 was never released anywhere outside of Redmond. All the versions outlined so far had copyrights only up to 1990, while Z clearly has copyright from 1995. Being a few years newer and more native to NT I wanted to see if a build could be made. With some effort I was able to separate it from the original source tree and compile stand alone. Being a pretty clean source code I was able to compile it for  all NT hardware platforms, including x64, which runs comfortably on Windows 10. You can download Z editor for Windows here.

Z editor on flashy Windows 7 x64

Last but not least there is a modern open source re-implementation of Z editor named K editor. It’s written from scratch in C++ and LUA and has nothing to do with the original MEP source code. K is built only for x64 using Mingw. There are no ready to run binaries so I made a fork and build.

K editor on Windows 10 x64

The author Kevin Goodwin has kindly included copies of original documentation if you actually want to learn how to use this editor.

This entry was posted in Development, DOS, Editors, Microsoft, NT, OS/2, Source code, Uncategorized. Bookmark the permalink.

16 Responses to Microsoft Editor

  1. Pingback: Wanted: Console Text Editor for Windows | OS/2 Museum

  2. zeurkous says:

    You misspeeled Michal’s name!

  3. tenox says:

    Haha good catch. It was a spell checker!

  4. zeurkous says:

    Not a .cz one then? 😛

    The reason mespotted it is that me bf happens to have the same name =)
    (He’s from the .cz republic, too.)

  5. Paul says:

    “You misspeeled Michal’s name!”…”mespotted”

    I wonder if someday we could persuade Microsoft to make another source donation to the Computer History Mueseum. A lot of early OS code and associated tools would be fascinating insight into that period, and help dramatically with digital archeologists.

  6. zeurkous says:

    Now *you* mispeeled ‘Museum’!

    Seriously, though, when it’s intentional, it ain’t a tyop.

  7. ths says:

    As a longtime subscriber to the OS/2 developer program I remember a really great editor available for Dos and OS/2 called “T”. It was only 10 KB in size (plus an external help file for keys) and could easily fit on each of my boot and emergency disks. The OS/2 version was called “T2” but I always renamed it to “T” for simplicity.
    It was a bit similar to vi in that it had a “command” and “edit” mode and a mode-switching keystroke; it had a visible command line all time and some very useful features. Obviously it was written by people who had the same requirements as I 😉
    With an external configuration program it was possible to change every key’s function and patch the executable.
    Of course I also loved “EPM” for programming cmd and Rexx but I switched to emacs for programming in C since it integrated emx+gcc and the gdb debugger quite nicely.

  8. Michal Necasek says:

    T think T/T2 was closely related to E.EXE shipped with PC DOS 6.x/7.0 and also TEDIT (OS/2 Warp and later). These editors were all related to something internally used at IBM, much like the folks at Microsoft used the Z editor and its offshoots.

    Personal Editor PE32/PE64 mentioned in the first article is yet another relative of the IBM editor.

  9. Michal Necasek says:

    With OS/2 there’s an obvious legal problem — Microsoft wasn’t the sole owner of the OS/2 source code (neither was IBM). I don’t think either company can publish the source code without the other agreeing to it as well.

    But yes, it’s not like the source code for OS/2 1.0 has any real commercial value nowadays. Publishing the source code would be great.

  10. Fernando says:

    Now Tenox will require a NT kernel mode editor like the clock that I remeber he do. ;-).
    The executable of the editor that came with Windows NT pre-release CD-ROMs would run in any modern Windows?.

  11. zeurkous says:

    Honestly, medoesn’t think tenox and me are the only people who would
    prefer to have the option of not running windoze even when running NT.

    In fact, NT having windoze plastered all over it made me finally switch
    permanently to UNIX-like stuff, many moons ago.

  12. tenox says:

    Yeah this is on my TODO. Instead of doing it in kernel mode I’m thinking of writing an ANSI/vt100 driver for the console that would allow user mode NtDisplayString() to manipulate cursor position and other states. This way you could easily port some apps to run on the blue screen.

  13. tenox says:

    Unfortunately the editor from pre-release cdrom does not run on modern Windows. However the editor from NT SDK does, you can try it.

  14. zeurkous says:

    Yeah, writing a terminal emulator would appear to be a good first step.

  15. Bob Nelson says:

    T/T2 definitely followed in the path of a whole series of similar editors inside (and some outside) IBM. PE/PE2 were the originals as I remember and released as part of IBM’s Personally Developed Software program where IBM sold programs written by employees. If the software was developed on personal time then the employee got royalties. I don’t know how much in common the source code was but the operation and default key bindings were very similar among all of them. There were also editors called E/E2 that were used internally, and T was referred to as Tiny Editor. VE/VE95 were windowed versions of the editor as well. My understanding was that Slickedit was descended from the same line of editors when one of the author(s) left IBM to start that company. The same key bindings are not the default but available as an option last I checked.

  16. Yuhong Bao says:

    @tenox: I wonder with the CSRSS, win32k, etc source can a Win32 console be created?

Leave a Reply

Your email address will not be published. Required fields are marked *