Can You Read
Without the Manual?

Jim Neil

Think Registers, Write TERSE

One real test of a language's usefulness is its readability. Here you will be given the opportunity to test your skills at reading some TERSE examples. Although TERSE is not an assembler, you still "think" at the register level when you use it. Its real strength comes from its intuitive, descriptive notation. For example the TERSE statements:

eax = ebx; bx + dog; cat - 14; cx & 0Fh; dx - 123?

generate the following assembly code:

Mov eax,ebx Add bx,dog Sub cat,14 And cx,0Fh Cmp dx,123

What could be simpler? Since TERSE, like it's name implies, is a very concise representation of assembly language, it is ideal for communicating low-level concepts to other programmers as well to the "machine." It also features what I call structured flow control giving your programs a clean, structured look and there is never the need to invert another conditional or invent yet another meaningful label. Copy and paste all day long and never have a label conflict!

Here are two trivial examples:

eax - 10 ? =={ eax = 1; },{ eax = 0; };

This is an if-then-else. It sets eax to one if eax was ten, otherwise it sets it to zero. It does this with a Cmp, a Jnz, a Mov, a Jmp Short, and a final Mov.

dx = 1000; { dx-; }<>;

This one's a while statement. It initializes dx to 1000 and then goes into a delay loop, decrementing dx and looping back to the top of the loop while dx is non-zero. The code generated for this one is a Mov, a Dec, and a Jnz.

Of course TERSE is a free-format language so you have total freedom to format your code on the screen however you like. The whole idea behind TERSE is to make machine level code both easy to write and easy to read. With TERSE, maintenance is a breeze. TERSE uses all the familiar operators (+,-,*,/,&,|, etc.) to represent the instructions in the x86 instruction set and supports compound statements to eliminate redundant information, for example:

es = ax = 0A000h; \ Mov ax,0A000h; Mov es,ax; ax + bx - cx & dx; \ Add ax,bx; Sub ax,cx; And ax,dx;

Notice that chained assignments are performed right to left and computations are performed left to right. Pushing, Popping, Calling, etc., have all been made much simpler to both write and read! TERSE also allows you to intermix standard assembly right along with your TERSE statements allowing you to use either syntax, whichever is more to your liking. This "intermixing" feature also guarantees you access to any new instructions that may be added to the processor's repertoire in the future without the need to upgrade your compiler. If your assembler supports it, so does TERSE! There is so much more that TERSE has to offer like built-in pointer advancing (al=[bx+];), etc., I can't possibly describe it all in one web page! If you would like to see some more complex examples, please send me an E-Mail and I'll be happy to send you some. For now, let me tell you a bit about how TERSE works.

How Does TERSE Work?

TERSE generates .ASM files as its output. I did this to assure you compatibility with whatever development tools you may be using. You continue to use the same operand syntax you are already familiar with.

There are several philosophical differences between all the different assemblers being used out there. There is "the standard" MASM, there is TASM with its "ideal mode", there's A86 with its "no red tape" way of doing things. Not to mention NASM, etc., the list goes on. Since TERSE doesn't generate anything without being "told to," the language "configures" itself to conform to the assembler you choose to use as the common code generator (CCG) "back end" to the compiler. TERSE will work with any assembler that accepts standard Intel mnemonics.

The compiler is totally debugged, tiny (a trim 23,917 bytes) and very fast. It comes with a beautiful 220 page manual packed with tips and examples, written in a clear style that explains the reasoning and logic behind the selection of each operator. These explanations help you form a mental image for each operator making learning and remembering the TERSE syntax as simple as:

2 = 1 + 1;

There is also a TERSE Memory Jogger tear-out reference card in the back of the manual. Of course there is a complete table of contents, comprehensive index, the complete language BNF, conversion tables, and several sample programs with their source files included on the diskette. For more information on everything you get, check out the Risk FREE Special Money Back TERSE Offer. You have nothing to lose but a whole lot of MOVes!

* * * *

[Next Page]
[Previous Page]
[Return to Table of Contents]
[Order My Copy of TERSE]

* * * *

Copyright © Jim Neil. All Rights Reserved.
The word OPTOMIZED, the name TERSE, and the TERSE logo are Trademarks of Jim Neil.