Dec 242017
The TERSE programmer's editor. Small but powerful editor. Text and Binary.
File TERSE12.ZIP from The Programmer’s Corner in
Category Word Processors
The TERSE programmer’s editor. Small but powerful editor. Text and Binary.
File Name File Size Zip Size Zip Type
MID-EAST.R13 143 116 deflated
PRINTDOC.BAT 65 50 deflated
PRTIP.BAT 138 94 deflated
ROT13.COM 4908 2969 deflated
T.COM 4096 3433 deflated
TERSE.DOC 31421 11603 deflated
UNROT13.BAT 129 84 deflated
_DESC.BTM 557 279 deflated

Download File TERSE12.ZIP Here

Contents of the TERSE.DOC file

"You can never be too rich, too thin, or
have too much RAM and Disk storage."

Ancient American proverb, ca. 1980
(As quoted by the QEDIT manual.)

| TERSE Version 1.2 |

Tiny ``brief'' like editor by
Joseph (Yossi) Gil.

TERSE is a tiny (only 4096 bytes) but amazingly powerful full-screen
editor for files of up to 64K in length. TERSE runs on all PC compatible
machines. Its command keys are very similar to those of the famous BRIEF
editor (by UnderWare Inc.). TERSE can edit both UNIX and MS-DOS style
text files as well as binary files. No hacker's disk is complete without

TERSE is free (but copyrighted) to private users. However, if you use
TERSE for any commercial application, i.e., in your company at work
etc., or make money from selling software or distributing shareware, you
are *required* to register your copy of TERSE. Registration cost is only
$15 and will buy you a personalized version, configuration utilities and
grant your institution a site license.

o Very small: fits in 4096 bytes (4 clusters on 5.25" and 3.5" floppies).
o Minimal free memory requirements: 137KB.
o Use current screen size, including the common 80x25 configuration
but also unusual sizes such as 40x16, 40x25, 40x40, 40x50, 132x25,
132x43, 96x33, 80x30, 80x33, etc.
o Fully DESQview (version 2.0+) aware.
o Edit binary files. Terse is ideal for a quick and dirty job
of patching strings in small executables.
o Supports editing of UNIX style files (lines terminated with '\n').
o Edit lines of unlimited length (limited only by file size).
o Automatic unlimited horizontal scrolling.
o Status line indicating: current column, current line, horizontal
scrolling, total number of lines, file name, modified status and
insert/overwrite status.
o Brief like keyboard configuration.
o Support for TABS, and configurable tab positions.
o Prevents snow when run on a CGA screen.
o SEARCH, SEARCH again, and TRANSLATE commands.
o Safe: ask before loosing work.
o Edit files whose name contains spaces and other weird names.

o PC-DOS/MS-DOS version 2.0 or higher
o 137KB free memory
o 64KB free disk space

New in Version 1.2
Code size was shrunk by another 9 (!) bytes.

The restriction on distribution by fee shareware distributers
have been removed.

After a successful print (Alt-P) the marked block is unmarked.

Pre-Release versions of Slim, Lean, Wee and Terse for HP are available
upon request.

New in Version 1.1
A bug in the snow prevention routine which caused TERSE to hang on some
CGA systems was corrected. TERSE should run now with no problems on all
adapters. Many thanks to Andrea OMODEO
for identifying the bug and for suggesting the correction.

After considerable work the 27 bytes code fragment required for DESQview
awareness was squeezed in. TERSE can now run in a DESQview window and it
is fully DESQview aware.

Terse uses only pure 8088 instructions, so it should run on your good
old original 4MhZ IBM-PC as well as on 80486 50MhZ machine. More than
once, during the development I was tempted to save 2-3 bytes by using a
more advanced instruction, but I managed to resist this temptation.
Other than that every dirty assembly trick I could think of was used. It
is conceivable that some of the tricks will prevent TERSE from running
on some DOS-like environments and simulators, although I don't know of
any concrete example.

UNIX style files
TERSE will edit UNIX style files directly. That is TERSE uses both '\n'
(LF aka Line-Feed) and a '\r\n' (CRLF aka Carriage-return + Line-feed)
combo for line ends. Hitting ENTER will enter '\r\n', but Ctrl-ENTER
will enter '\n'. (Configuration utilities allow swapping these 2 keys)
Thus you can transfer UNIX text files to your PC, edit them on the PC
and then transfer them back without need for file conversion.

Binary files editing
TERSE can edit binary files as well. It is somewhat limited in the sense
that it does not display the HeX value of each char, so you need to keep
an ASCII table handy. In addition the following characters: space (ASCII
32), Null (ASCII 0), and Meta-Del (ASCII 255) all look the same. The
configuration utilities give a simple solution to this problem on
EGA/VGA compatible systems. I may add HeX value display feature in a
future version.

Configuration Utilities
If you are a private user who uses Terse "for pleasure" you are not
required to register. If you use TERSE as part of your work, or make
money from its distribution, you are required to register. The small
registration fee ($15) will buy you a site license. Yes, this is
correct, the whole site such as a university with all its PCs, need only
to register once.

The configuration utilities will allow you to: swap the Enter and
Ctrl-Enter keys, change the tab size to 2/4/8/16. (I personally prefer
tabs set every 4 characters.) And, modify the key assignments (with some
very minor restrictions). In addition, you could eliminate snow check
done automatically on CGA screens, and will get better support (as
describe above) for editing binary files on EGA/VGA screens.

How to get
Archive name is:

Available in:

FTP site Path Comments
======== ==== ======== /pc/editor Finland, Europe /pub/msdos/editor Simtel20 mirror PD1: Non-UNIX site.

Some of these sites have mail-server services. If you cannot get TERSE
from these sources, feel free to write to me and ask for a copy to be
e-mailed to you. The compressed uudecoded file is only ~40K, and if you
don't need the documentation, it could be trimmed down to ~5K. I answer
all messages within few days, so if you do not receive a response within
a reasonable time, try a different path.

This program in written in highly optimized assembly language. The code
is probably the worst spaghetti you have ever seen! This means that the
risk of TERSE having bugs is especially high. The author exterminated
all the bugs he identified, and he did his very best to test the program
thoroughly. However, there might be still other unidentified bugs
lurking there. These bugs by nature are unpredictable. Usage of the
program acknowledges the following disclaimer of warranty: "This program
is supplied as is!" All warranties, expressed or implied, including,
without limitation, the fitness of this program for any purpose, are

The main constraint in adding features to TERSE are that its total size
must be exactly 4096 bytes. Currently I have a slack of 4 bytes. That
is, the actual editor size is 4092 bytes, and there are 4 dummy bytes.
All additions are dependent on my ability to squeeze the current code
further. This task is getting harder and harder all the time. My
approximate work per each byte squeezed is two hours.

I have several other possible directions for the development of TERSE.
These directions are: ``the terse family'' and the ``terse library''. I
am looking forward to hearing from _you_, the user, communicating your
thoughts and comments.

The TERSE library is nothing but an object code library which could be
invoked from a C program. The members of the TERSE family will be:

LEAN A 3K file viewer. This is basically TERSE without the
editing code. Naturally, LEAN could not compete with the
excellent LIST utility of Vernon D. Buerg, and many other
fine tiny file listers.

WEE A terse version requiring only 70KB free memory. This is
intended for palmtops, and it will be restricted to 32KB
files. Another way for reaching the 70KB free memory
operation level it to disable the cut and paste feature. If
both restrictions (cut and paste disabling, and 32KB file
size limit) are placed, then Wee will need only 36KB free

Which of these sounds the best?

SLIM An extended TERSE version (at the 5K level) with some extra
features. Some features for which I have received requests

o Read file into buffer.
o Move to editing another file.
o Goto line.
o Word wrap, margin setting and word-wrap on/off.

In addition, I would like to get MEAN work at the following
levels of free memory for buffers. Add to the numbers below
the 6.5KB or so which will be required for MEAN's code and

32KB File size limit 32KB, no cut and paste.

64KB File size limit 64KB, no cut and paste, or File size
limit 32KB, cut and paste.

128KB File size limit 64KB, cut and paste.

Configuration will be selected at run time, dependent on
available memory and input file size.

In addition, MEAN will have a read-only (view) mode for
read-only files.

The distribution of TERSE includes the following files:

T.COM The actual TERSE editor program. No other files are
necessary for proper operation of TERSE.

TERSE.DOC This file. The documentation for the program. It may be
printed by:

PRINTDOC.BAT A batch file for printing the documentation of TERSE.
This file will also print MID-EAST.MBX if you created

_DESC.BTM A 4dos batch file for creating file name description for
the above files.

MID-EAST.R13* (rotate 13 encrypted file). This file (because of local
management rules) is not available in Garbo and Simtel.

ROT13.COM A ``rotate 13'' filter.

MID-EAST.MBX Some facts and tips about the Middle East (uncrypted).
This file is _not_ part of the distribution, but it can
be created by

UNROT13.BAT Batch file to (i) create MID-EAST.MBX from MID-EAST.R13
using, the ROT13 filter, and (ii) display MID-EAST.MBXP
using T.COM.

PRTIP.BAT Batch file to send MID-EAST.MBX to the printer

License (copying policy)
The following policy is intended to promote free private use and
distribution, and to collect money from those who can. In particular,
these institutions which make money from private users, are required to
pass on part of their income to whoever is responsible for generating

PRIVATE USERS. You are free to use, copy and distribute TERSE for
noncommercial private use provided that:

a) No fee is charged for use, copying or distribution.
b) It is not modified in any way.
c) It is distributed as a package. All files in this package must be
included, none should be added, and none of the files are changed.

Thus if you are a private user, you you can *use* TERSE freely, and you
are are under no obligation to register. (The only restriction is on its
further distribution.) If you find TERSE useful, easy, and nifty editor
you may show your appreciation in one of two ways:

A) Send the author the 15 US dollars registration fee.

All registered users will receive the most recent version of
TERSE, configuration utilities, and if you wish a personalized
version. Please, do register if you can afford it, and would like
to support financially the production of this high quality

B) Decrypt, print and read the enclosed MID-EAST.R13 file, and learn
some facts about the middle east and of MID-EAST's role in it, its
problems etc.

IMPORTANT: The file is given in ``ROT13 form''. This means that
although it contains only pure printable ASCII characters, it has
to be decrypted before you can read it. A ROT13 filter is supplied
with TERSE so that you can decrypt it. The easiest way to decrypt,
and print then print this file is to:

1) Run the enclosed UNROT13.BAT batch file. Doing so will produce
MID-EAST.MBX, a clean version of MID-EAST.R13, and then display

2) To print MID-EAST.MBX run the enclosed PRTIP.BAT batch file.
Also, if MID-EAST.MBX exists when you run the PRINTDOC.BAT batch
file, it will be printed as well.

This somewhat complicated form of distribution is partly so there
that you will feel that you have applied some conscious effort to
read it.

MID-EAST.R13 is an integral part of the TERSE distribution, but it
is not required for the normal operation of TERSE. It is supplied
so that you could show your support for the quality to the concept
of TERSE, and if you cannot afford to register by reading it.

SIDE COMMENT: Being outside of home for some time, I learned that
the many things about the Middle-East are reflected in a very
distorted manner from the media. The file MID-EAST.MBX is a part
of a large file which I am compiling which consists of verifiable
facts gathered from various resources about Israel and the middle
east (political views are filtered out).

Naturally, there would always be people who will think that these
facts are not "complete" and that they represent only the Israeli
side. If you are among those who might feel so, my advise is
simple: do not read the file. If not, MID-EAST.MBX is expected to
give you, the reader, a more informed perspective of events in the
Middle east and of the author's country.

This version of MID-EAST.MBX has facts about terrorism in the
Middle East. Occasionally, I change the contents of MID-EAST.R13,
to keep it relevant and interesting. I hope that the quality of
TERSE will encourage you to learn more about the country of its
author. Naturally, you are under no obligation to do so.

NON_PRIVATE USE. Institutions and companies MUST register this package
after an evaluation period of 21 days. Registration of one copy per
company site is sufficient.

Shareware distributor: You may distribute this package as long as
no more than a nominal fee (up to $10) per disk is collected per disk.

NON-FEE DISTRIBUTION: Simtel/ Garbo/ other FTP collections: Obviously,
you may store this package and offer it package to your users free of
any restrictions.

Author's Address
E-mail internet addresses:
[email protected] (Hebrew University, Jerusalem, Israel),
[email protected] (Vancouver, Canada),
[email protected] (might work if others fail).

Permanent mailing address is:
Joseph Gil,
P.O. Box 3148,

North America mailing address (until October 1st 1992):
1418 Park Drive, Vancouver, B.C. V6P 2K7, Canada.

Hebrew mailing address (you cannot read the following unless your
screen adapter can display Hebrew character):

3148 ..

Terse is an exercise of editor writing inspired by TED, the famous Tiny
EDitor (written by Tom Kihlken and published November 1988 in PC
Magazine, Copyright 1988 Ziff Communications Co.). Some features of
TERSE are borrowed from fine descendants of TED called TEDPLUS
(apparently also written by Tom Kihlken in November 1988) and TED2
(written by James E. Galbraith, 1201 Chase st., Novato CA, 94945, USA).

There is not a single piece of code in TERSE which is the same as in
TED, TEDPLUS or TED2. TERSE represents almost three years of work on
space optimization of the code, and on added functionality. Some of the
newly added features include help screen, unlimited line length, status
line, smooth horizontal scrolling, previous and next word, UN*X files
editing, search and replace, safety features and support for insertion
of all 256 characters of the IBM-PC extended ASCII set (including ,
, , and ). Some old features include scrolling, cut, copy,
paste, and printing operations.

Some of the documentation for TERSE is based on the documentation
provided with TED2. See the article "The tiniest editor you'll ever
need" by Tom Kihlken, in the November 15, 1988 issue of PC Magazine for
further details about TED. Also, TED, TEDPLUS and TED2 are available
from SIMTEL20:


t [filename]

To invoke TERSE just type "T" from DOS command line, possibly followed
by a filename.

TERSE will open and read a file whose name (and path, if required) is
initially supplied on the command line. If no files name is provided,
TERSE will open a new file. A name may be supplied later during the
editing session using the ``Output'' command invoked by . TERSE
expects a legal DOS filename, which many include a path name. TERSE can
also edit files whose names contain spaces. Those names are legal,
although most DOS commands cannot manipulate them.

Upon save, the original of the modified file is saved with the extension
.BAK. TERSE will prompt before exit without save. If the file has the
Read- only attribute set, TERSE will open the file to allow browsing,
but will not allow any edit changes. There is no "load" or "save" file
function from within TERSE.

Basic Editing
In TERSE, the cursor movement keys (Left, Right, Up, Down, PgUp, PgDn,
...) allow you to move around in the text. Text is entered in insert
mode by default. Text can be deleted using the and

Help screen is available upon pressing or . When the help
screen is displayed pressing any key will return you to the text.

Pressing the key will toggle between Insert and Overstrike mode.
The Insert/Overwrite state is displayed by an 'Ins' or 'Ovr' in the

The key restores up to 255 characters deleted by the key
or overwritten while in the Overwrite mode. The key will only
restore the last character deleted with the key.

TERSE text buffer is limited to 65535 characters. An attempt to extend
the buffer beyond that will result in a short beep.

Lines may be of any length. TERSE recognizes both the UNIX and DOS
convention for line termination, i.e., both pair and a single
denote end of line. Off screen characters may be viewed by moving
the cursor toward them. Lines may be broken by pressing (insert
pair) or (insert character) at any point, in
either Insert or Overstrike mode. Lines may be joined by pressing
at the line end or at beginning. Pressing deletes
the entire line and closes the gap. Pressing deletes from the
cursor position to the end of the present line. Pressing
restores the most recent line deletion. The line delete buffer remains
intact until another line is deleted. The line delete buffer has room
for 255 characters.

A Block is some portion of the text file which has been specifically
delineated for later manipulation. One end of a "block" of text is
defined by hitting key (anchor drop/raise). The other end of the
block is where the cursor is located. Move the cursor with the cursor
control keys to the block end. As you move the cursor not that the
blocked area is shown in reverse video. The is a toggle key,
hitting it again will raise the anchor dropped at the block end, and
thus cancel the blocking operation..

Pressing the key (keypad grey minus key) removes it to a paste
buffer; this operation is known as ``Cut''. The copies the block
to the paste buffer without removing it from the text; this operation is
known as ``Copy''. The ``Paste'' operation copies the text stored at any
point where the cursor is located; it is invoked by hitting the
key. he paste buffer remains intact until another section is marked and
cut or copied. The paste buffer has room for 64K bytes.

When a block is marked, pressing prints the marked text
(directly from the file buffer). After the print, the block will remain

Search and Replace

55 Lines section was omitted in the Garbo and Simtel archives


Character Set and Binary file editing
Any of the characters in the IBM extended ASCII set can be entered and
manipulated by TERSE. To enter control characters (ASCII 00-31 and 127),
use , , ... , , , , ,
, and . A more general method is press
the Alt key and without releasing it, typing a character ASCII decimal
value on the numeric keypad, and then releasing the Alt key. The PC-BIOS
does not support entry of the character (00h) in this fashion.
Instead, you may enter the character by hitting with key.

The ASCII Backspace (BS) code can be entered as , and the
key deletes the character to the left of the cursor.
Similarly, ASCII Carriage-Return (CR) and Line-Feed (LF) character codes
can be entered directly as and . TERSE interprets the
character as an end-of-line. An is considered an ordinary text
character except when it is immediately preceded by a , in which
case it is considered part of the end-of-line marker. If are
entered together, or ever become adjacent, they cannot be separated. The
key inserts an end-of-line marker (CR)(LF).

TERSE does not use the CP/M style End-of-file marker, , to
indicate the last character in a text file. If a character
appears in the file, it is shown as is.

The Screen
TERSE configures itself to the display adapter in use, and supports text
modes other than the standard 80 columns by 25 rows e.g., EGA 43 lines
and CGA 40 columns mode. and scroll the file by the number
of rows displayed. TERSE would not work properly if the screen is
initially in a graphic mode.

TERSE does not alter screen attributes or colors. Inverse video is used
in the status line and to indicate a MARKed block. TERSE uses blinking
inverse video to indicate that the search string has been found. It
automatically handles "de-snow" on a CGA display.

Because TERSE makes BIOS calls and writes directly to the screen buffer,
it would probably not work properly on MS-DOS computers that are not
sufficiently IBM-PC compatible.

The Status Line
At the bottom of the editing screen is the Status Line. The Status Line
constantly displays information regarding the file you are currently
editing. The Status Line is shown below with a description of the
information displayed.

F1 Help | Line 137 Col 25 =282 +0 @893 #10324 Ins letter.doc*

File modified
since last
The current written
cursor column
number The name of file
you are editing
The current
cursor line Insert mode is ON
File length in characters
A reminder that
Help screen is Current offset in file
available upon
pressing the The number of columns scrolled off to
key to the left of the screen

The total number of lines in the file

The following is a description of all TERSE commands and their key
binding. To get a help screen with keyboard usage summary, hit or

Cursor movements
Moves cursor left one column
Moves cursor right one column
Moves cursor to the beginning of the next word.
Moves cursor to the beginning of previous word.
Moves cursor to start of line
Moves cursor to end of line
Moves cursor up one row
Moves cursor down one row
Moves text window up one page
Moves text window down one page
Moves cursor to top of file
Moves cursor to bottom of file

Basic editing operations
Any keyboard char Insert/Overwrite character into file
Insert tab character
Start new line, adds pair to file.
Deletes character to left of cursor
Deletes character under cursor (to right)
Undo recent operation/Overwritten
Toggle between Insert/Overwrite mode (Ins/Ovr)
Delete to end of line
Delete current line
Restore deleted line (up to 255 characters)

Block Operations
drop/raise Anchor. Block is between anchor and
Copy block to clipboard buffer
Delete block to clipboard buffer
Paste from clipboard buffer
Print block.

Search for string
Find next occurrence of string
Search and Translate

File Operations
Quit edit: no-save exit (will ask for confirmation)
eXit and save: same as Quit if file name is unknown
Change output file name. Supply name if not given.
Write the current buffer into its file (if
filename known)


Scroll window horizontally to the left
Scroll window horizontally to the right
Scroll window up
Scroll window down

Entering Special Characters
Enter the [NUL] character
Enter the [SOH] character
... All ctrl characters can be inserted this way
... Special control characters are described below
Enter the [ETX] character (DOS abort is disabled)
... ...
Enter the [BS] character
Enter the [TAB] character
Enter the [LF] character
... ...
Enter the [CR] character
... ...
Enter the [SUB] character (No CP/M style EOF)
Enter the [ESC] character
Enter the [ESC] character
Enter the [FS] character
Enter the [GS] character
Enter the [RS] character
Enter the [US] character
Enter the [DEL] character

o Horizontal scrolling will not move the cursor position, so by
pressing and you can scroll to the right or to
the left but only to the extent which will leave the current
cursor position visible. For example when the cursor is in the
left most column, no horizontal scrolling is possible. There
are no plans for modifying this behavior as the author feels
that it is very reasonable. Strong users pressure may change

o will only restore the last character erased by
. Future plan is to push deleted characters (by
, and overwritten characters) to a stack. The
stack will have limited depth, and as characters are pushed
in, old characters stored deeply in the stack disappear. The
will pop characters from the stack and insert/append

o Editing can get extremely slow if lines are excessively long.
Lines longer than 20,000 characters will cause a noticeable
delay after every editing operation on this line.

o There is a small misalignment of the help screen when and ANSI
console driver is installed.

 December 24, 2017  Add comments

Leave a Reply