"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
o Brief like keyboard configuration.
o Support for TABS, and configurable tab positions.
o Prevents snow when run on a CGA screen.
o CUT, COPY and PASTE
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
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
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:
FTP site Path Comments
======== ==== ========
garbo.uwasa.fi /pc/editor Finland, Europe
oak.oakland.edu /pub/msdos/editor Simtel20 mirror
wsmr-simtel20.army.mil 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
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
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
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
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
MID-EAST.MBX with TERSE.
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
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
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:
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):
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
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.
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
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
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