have too much RAM and Disk storage."
Ancient American proverb, ca. 1980
(As quoted by the QEDIT manual.)
| TERSE Version 1.4 |
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 it.
No disk, be it hard or floppy, is too full to include it.
TERSE is free (but copyrighted) to private users. If you are a private
user who uses TERSE "for pleasure", you are not required to register.
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 buys you a personalized version, and grant your
institution a site license. Yes, this is correct, the whole site such as
a university with all its PCs, need only register once. For an additional
payment of only $5, you get the source code of TERSE.
o Very small: fits in 4096 bytes = 4 clusters on 5.25"/3.5" floppies.
o Minimal free memory requirements: 137KB.
o Uses current screen size, including the most common 80x25 screen
dimensions but also unusual sizes such as 40x16, 40x25, 40x40,
40x50, 132x25, 132x43, 96x33, 80x30, 80x33, etc.
o Fully DESQview (version 2.0 and above) aware.
o Edit binary files. TERSE is ideal for a quick and dirty job
of editing and patching strings in small programs.
o Supports editing of UNIX style files (lines terminated with '\n').
o Supports both '/' and '\' as directory separator.
o Edit lines of unlimited length (limited only by file size).
o Automatic unlimited horizontal scrolling.
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: confirm exits when text is not saved.
o Edit files whose name contains spaces and other weird names.
o Extended version (the SLIM editor) of size ~5k with many more
features, including support (via external filters) for word count,
sorting, charcter codes translations, quoting, tab expansion and
unexapnsion, and other complex editing tasks.
o Status line indicating: current column, current line, horizontal
scrolling, total number of lines, file name, modified status,
insert/overwrite status, the current offset in file and total file size
in bytes are dispalyed in the status line. The extended version
also displays the HeX value of the current char.
o PC-DOS/MS-DOS version 2.0 or higher
o 137KB free memory
o 64KB free disk space
This program is 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 still be 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 disclaimed.
Problems, Questions, Suggestions?
Please do not hesitate to communicate all your thoughts and comments.
I answer all my E-mail usually in less than 24 hours. If you do not get
a response within a reasonable time, it is probably because I didn't
get your message, or because I wasn't able to reply. Kindly try sending
again using another route, and include more alternate return paths.
TERSE uses only pure 8088 instructions and assumes the bare minimum
of the underlying operating system. It should run on your good
old original 4Mhz IBM-PC running under DOS 2.0 as well as on a fast
80486 50Mhz machines running DR DOS 6.0 + 4DOS 4.0, or OS/2 in DOS
compatibility mode. More than once during the development, I had a
chance to save a few bytes by using a more advanced instruction, or
by assuming a more advanced operating system version. 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
could prevent TERSE from running on some DOS-like environments and
simulators, although I don't know of any concrete example.
UNIX style files
TERSE edits UNIX style files directly. That is, TERSE uses
both '\n' (aka LF, aka Line-Feed) and a '\r\n' (aka CRLF, aka
Carriage-return + Line-feed) combo for line ends. Hitting ENTER
puts '\r\n' into the file, and Ctrl-ENTER puts '\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. To aid in this task, the
status line displays the file size in bytes and the current offset
in bytes in the file. The status line of the SLIM editor displays
the hexadecimal value of the current char. (This feature may be
added in the future, space permitting to TERSE.) A difficulty in
editing binary files is that the following characters: space (ASCII 32),
Null (ASCII 0), and Meta-Del (ASCII 255) all look the same. If you have
an EGA or VGA screen you may want to use the font loaders WITHFONT or
LOADFONT together with the binary editing font and circumvent
The configuration utilities 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 minor restrictions). In addition, you can eliminate the snow
check done automatically on CGA screens, and you get better support
(as described above) for editing binary files on EGA/VGA screens.
The main constraint in adding features to TERSE is that its total
size must be exactly 4096 bytes. All additions are dependent on my
ability to squeeze the current code further. I usually work several
hours, and sometimes days, for each byte squeezed. And this task is
getting harder and harder all the time. (A few versions had a slack
of very few bytes. In these versions, a few dummy bytes were appended
to the program to keep its size 4096 bytes exactly.)
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, about what you
think of these ideas.
The TERSE library is an object code library which could be invoked
from a C program. The members of the TERSE family are:
LEAN A 3K file viewer. This is basically TERSE without the
editing code. Naturally, LEAN could never compete with the
excellent LIST utility of Vernon D. Buerg, and other
fine tiny file-listers.
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 Go to line.
o Word wrap, margin setting and word-wrap on/off.
o Backward search.
o Edit next file in command line.
TERSE is distributed in two forms: the full distribution and an
abridged version. The full distribution consists of the following
files: (files marked with * are missing in the abridged version.)
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 also prints MID-EAST.MBX if you created it.
_DESC.BTM A 4dos batch file for creating file name description
for the above files.
MID-EAST.R13* (rotate 13 encrypted file).
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.MBX
PRTIP.BAT Batch file to send MID-EAST.MBX to the printer
L.COM* A pre-release of the LEAN file lister.
S.COM* A pre-release of the SLIM editor, an extended version of
H.COM* A pre-release of SLIM built especially for the HP 95lx
palmtop computer. You can use the configuration
utilities to limit the file size to 32KB, thus reducing
the memory requirements. The help screen is minimized to
16x40 chars. The program has special code for detecting
the HP9LX, and if one is detected, only the top left
16x40 part of the virtual screen is used.
TCONFIG.COM* Configuration program for T.COM.
SCONFIG.COM* Configuration program for S.COM.
LCONFIG.COM* Configuration program for L.COM.
HCONFIG.COM* Configuration program for H.COM.
TKEYS.COM* Keyboard configuration program for T.COM.
SKEYS.COM* Keyboard configuration program for S.COM.
SKEYS.COM* Keyboard configuration program for H.COM.
MXIFY.COM* A pre-release of a program which gives TERSE and its
partners an EMACS style. Usage is:
MXIFY T filename
BIGC.COM* A program to set a big cursor (Useful on PALMTOPS.)
LITC.COM* A program to set a little cursor (Useful on PALMTOPS.)
ESC.COM* A program to send ESCAPE characters. Examples of usage
ESC 0 > prn
ROT13.COM* A "rotate 13" filter.
LF.COM* Filter. DOS to UNIX text file translation program.
Run 'lf -h' to see a manual page.
CRLF.COM* Filter. UNIX to DOS text file translation program.
Run 'crlf -h' to see a manual page.
CAT.COM* Filter. Concatenate files. Like UNIX cat.
QUOTE.COM* Filter. Quote text by prepending '> ' to lines
WC.COM* Filter. Count lines, words, chars. Like UNIX wc.
UUDECODE.COM* Filter. A program to convert uudecoded files back
to binary. Like UNIX uuedecode
EXPAND.COM* UNIX-like filter. Expand tabs into spaces.
Run 'expand -h' to see a manual page.
UNEXPAND.COM* UNIX-like filter. Compress spaces into tabs
Run 'unexpand -h' to see a manual page.
FOLD.COM* UNIX-like filter. Fold long lines for finite width
output device. Run 'fold -h' to see a manual page.
TT.BAT* Call terse on multiple files/wildecards
TTALIAS.BTM* Demo: make 4DOS aliases for terse
NFMT.ZIP* UNIX fmt-like formatter. NFMT is a simple text
formatter, which is very similar to the BSD program
fmt(1). However NFMT uses a best-fit line breaking
algorithm, by a simple version of "Breaking Paragraphs
into Lines", Donald E. Knuth and Michael F. Plass,
"Software--Practice and Experience" 11 (1981)
1119-1184. Author: Ross Paterson
porting to Turbo-C by Yossi Gil
This archive includes the following files:
NFMT.EXE The NFMT filter
NFMT.DOC UNIX manual page for NFMT.EXE
NFMT.1 UNIX manual page for NFMT.EXE
(nroff -man source)
NFMT.C Main C source file of NFMT.EXE
CONFIG.H Machine dependent parameters for NFMT.C
OPTIONS.H Source for NFMT.EXE command line
SAMPLE.INP Sample input file for NFMT.EXE
SAMPLE.OUT Correct output of NFMT sample.inp
README Readme file for the NFMT distribution
MAKEFILE Makefile for the NFMT distribution
How to obtain TERSE
TERSE is available from Simtel, Garbo, Wustl, their mirrors and from
other fine ftp archive sites. Some of these sites have mail-servers
for those who do not have access to ftp. Some of these sites carry
only the abridged distribution.
In addition, the latest version of TERSE is regularly deposited in
Where XXX denotes the three digit version number. For example,
the full distribution of version 1.41 would be in a file named
If you are experiencing problems downloading these files (cs.ubc.ca is
picky for no real reason sometimes), or if you don't have FTP access,
please drop me a line and I will e-mail to you whichever distribution
you are interested in. The full distribution is sent out in 4 parts of
about 1000 uuencoded lines each. The abridged distribution (basically
just the TERSE editor and the manual) goes in one part of about 600
uuencoded lines. You can use the UUDECODE.COM program enclosed with
this archive to decode this mail.
License (copying policy)
The following policy is intended to promote free private use and
distribution, and to collect money from those who can afford to pay
for this software. In particular, those institutions which make money
from private users are requested to pass on part of their income to
whoever is responsible for generating it.
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 should be changed.
Thus if you are a private user, you can *use* TERSE freely, and you
are under no obligation to register. (The only restriction is on its
Registration (Private users)
If you find TERSE a 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.
TERSE, the configuration utilities and, if you wish, a per-
sonalized version, and the author will do his best to update
them as soon as a new version comes out.
Please, do register if you can afford it, and if you 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 about its role, 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 then print this file is to:
1) Run the enclosed UNROT13.BAT batch file. Doing so produces
MID-EAST.MBX, a clean version of MID-EAST.R13, then display
the MID-EAST.MBX file with LEAN.
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
that you will feel that you have applied some conscious effort
to read it. Another reason is that those who do not wish to
read this file can easily refrain from doing so.
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 can show your support for the quality
and the concept of TERSE, if you cannot afford to register, by
Side comment: Being outside of home for some time, I have
learned that many things about the Middle-East are reflected
in a very distorted manner in the media. The file MID-EAST.MBX
is 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).
MID-EAST.MBX is expected to give you, the reader, a more
informed perspective on events in the Middle East and on the
This version of MID-EAST.MBX has facts and papers about the
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.
NON-PRIVATE DISTRIBUTION (Shareware distributors): 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 to your users free of any
E-mail: (try addresses in this order)
firstname.lastname@example.org (University of British Columbia, Vancouver,
British Columbia, Canada),
[email protected] (University of Maryland, Maryland, USA)
[email protected] (Technion -- Israel's institute of technology,
[email protected] (Hebrew University, Jerusalem, Israel),
North America mailing address (until October 1st 1992):
1418 Park Drive, Vancouver, B.C. V6P 2K7, Canada.
Permanent mailing address is:
P.O. Box 3148,
Hebrew mailing address (you cannot read the following unless your
screen adapter can display Hebrew characters):
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 the 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,
space optimization of the code, and on added functionality. Some of
the newly added features include the help screen, unlimited line length,
status line, smooth horizontal scrolling, previous and next word,
UNIX files editing, search and replace, safety features and support
for insertion of all 256 characters of the IBM-PC extended ASCII set
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 concerning TED. TED, TEDPLUS and TED2 are
available from SIMTEL20:
TERSE is not related in any way to TED3.
To invoke TERSE, just type "T" from the DOS command line, optionally
followed by a filename.
TERSE opens and reads a file whose name (and path, if required) is
initially supplied on the command line. If no file name is provided,
TERSE opens 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 may include a path name.
TERSE can also edit files whose names contain spaces. These names
are legal, although most DOS commands cannot manipulate them.
Upon save, the original of the modified file is saved with the
extension .BAK. If an exit is attempted without a save, TERSE prompts
for confirmation. If the file has the Read-Only attribute set, TERSE
opens the file to allow browsing, but does not allow any edit changes.
A help screen is available upon pressing
screen is displayed, pressing any key returns you to the text.
In TERSE, the cursor movement keys (Left, Right, Up, Down, PgUp,
PgDn, etc.) allow you to move around in the text. Text is entered
in insert mode by default. Text can be deleted using the
mode. The Insert/Overwrite state is displayed by an 'Ins' or 'Ovr'
in the status line.
Text can be deleted using the
key or overwritten while in the Overwrite mode. The
only restores the last character deleted with the
TERSE text buffer is limited to 65535 characters. An attempt to extend
the buffer beyond that results in a short beep.
Lines may be of any length. TERSE recognizes both the UNIX and DOS
conventions for line termination, i.e., both the
moving the cursor toward them. Lines may be broken by pressing
any point, in either Insert or Overstrike mode. Lines may be joined
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
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, note
that the blocked area is shown in reverse video. The
toggle key, so hitting it again raises the anchor dropped at the
block end, and thus cancel the blocking operation.
paste buffer; this operation is known as "Cut". The
the block to the paste buffer without removing it from the text; this
operation is known as "Copy". The