README.TXT      13-Feb-2006

                              X P L 0

XPL0 is a programming language similar to Pascal. This 16-bit version
runs on an IBM PC-XT (8088), and of course on everything up through
Pentiums and Athlons. For these newer processors you might prefer the
32-bit version of XPL0, but this is the version to use when first
learning the language.

Here are the major features of XPL0: block structure; recursion; 16-bit
integers and 80-bit floating point; supports 387 math coprocessor;
hexadecimal and ASCII constants; boolean and shift operators; code and
data larger than 64K; unlimited-dimensional arrays; generalized device
I/O for console, printer, files, RS-232, etc.; include files; separately
compiled modules; external and in-line assembly language; built-in
graphic routines with high-speed line draw; built-in trig and log
functions; peek and poke; port I/O; extensive compile and run-time error
checking; cross-reference generator.

This distribution package contains three XPL0 compilers: interpreted,
native, and optimizing. The interpreted version is compact, compiles
quickly, and doesn't require an assembler or linker. The native version
generates fast 8088 assembly language code. The optimizing version uses
many techniques to generate code that is about twice as fast and half the
size as the native version.



REQUIREMENTS

IBM PC-XT or compatible, 256K RAM, 1 floppy drive, and DOS 3.3 or higher.
The native version requires 640K RAM, hard drive, and Microsoft MASM 5.10
or Borland TASM 2.51 (or newer versions).



GETTING STARTED

If you have a hard drive, make a directory called "CXPL" on your C:
partition and copy all the files into it. The batch file XN.BAT is set up
to find NATIVE.OBJ in this directory. Also many of the example programs
expect to find the "include" file CODESI.XPL here.

If you have Microsoft's assembler MASM version 5.10 (or later), you
should be able to compile and run the first example program, GUESS.XPL,
like this:

       C:\CXPL>XN GUESS
       C:\CXPL>GUESS

To work on files outside the CXPL directory, you will want to add the
following lines to your AUTOEXEC.BAT file. The first is:

        SET INCLUDE=C:\CXPL

This tells MASM what directory to look in for "include" files (such
as RUNTIME.ASM), if they are not in the current directory.

You will probably also want to modify your "path" command:

        path C:\CXPL;c:\dos;c:\

This line shows the added information in UPPERCASE letters. This lets you
run the compilers from any directory.

If you use Borland's Turbo assembler, you must change XN.BAT to reflect
this. Change "MASM" to "TASM" and "LINK" to "TLINK". TASM does not have
the INCLUDE feature so RUNTIME.ASM must be in the same directory as the
program you are compiling.

If you don't have a hard drive or one of these assemblers, you can still
run the interpreted version of XPL0. Do it like this:

       A>X GUESS
       A>GUESS


XPL0 programs must be written using a text editor that produces files in
plain ASCII format. Many word processors produce special file formats that
cannot be used by the compilers. WordPerfect has an option to export a
document in DOS ASCII format, but what you really want is an editor
designed for programming. The editor that comes with DOS 6, called EDIT,
is a good choice.



FILES

You should have these files:

       XPLIQ.EXE       Compiler that produces interpreted (.I2L) code
       I2L.COM         Interpreter and loader for .I2L code
       XLINK.EXE       Linker for combining multiple .I2L and assembly files
       X.BAT           Batch file to compile and load interpreted programs

       XPLNQ.EXE       Compiler that produces native (assembly) code
       NATIVE.OBJ      Run-time code (intrinsics, math routines, etc.)
       NATIVE7.OBJ     Run-time code using 387 math coprocessor
       NAT.OBJ         Small run-time code: no floating point, no fast lines
       RUNTIME.ASM     More run-time code (interface to .OBJ module)
       CODESI.XPL      Intrinsic code definitions
       XN.BAT          Batch file to compile, assemble, and link native code

       XPLX.EXE        Compiler that produces optimized native code
       NATIVEX.OBJ     Run-time code for XPLX
       NATIVE7X.OBJ    Run-time code using 387 math coprocessor
       NATX.OBJ        Small run-time code: no floating point, no fast lines
       XX.BAT          Compiles, assembles, and links optimized code
       XJSB.BAT        Same as above but with /J/S/B options (MASM 6 req.)

       MANUAL.TXT      Tutorial and reference manual
       ADDENDUM.TXT    Changes since version 2.3
       VER25.TXT       Changes since the previous release (version 2.4.6)
       LICENSE.TXT     GNU General Public License
       XREF.EXE        Utility for making cross-reference listings
       STDLIB.XPL      Collection of standard routines
       STDDEF.XPL      Standard definitions to be 'included' in your programs

       GUESS.XPL       Number guessing game example from the manual
       SIEVE.XPL       Classic benchmark program that finds prime numbers
       HANOID.XPL      Towers of Hanoi (try 3 disks; 0 exits)
       CHAOS.XPL       The Chaos Game; requires mouse driver and VGA
       MINESWPR.XPL    Minesweeper (like in Windows) requires mouse and VGA
       XREF.XPL        Source code for the cross-reference program



PRINTING THE MANUAL

Use a printer that can print the extended IBM (OEM) character set, such
as the block characters. For example, you should see a box here: Ŀ
(Windows is famous for messing this up.)                         

If you have an HP-compatible laser printer, the DPR utility (available on
the XPL0 webpage) does a nice job.



REASONS TO USE XPL0

You're looking for something more powerful than BASIC and easier to use
than C or Pascal.

XPL0 has a clean, simple syntax. For example, in XPL0 "*" always means
multiply; it does not mean a pointer to something, as it does in C.

XPL0 syntax is more like Pascal than C, but it is simpler. It does not
protect you from yourself; you get the total control enjoyed by C
programmers.

XPL0 is easier to learn and use than C or Pascal because it doesn't have
as many features. A feature you don't use just adds to your confusion.

The interpreted version produces compact code. A large program can run on
a small computer, like an IBM-XT (or an embedded controller).

The complete source code is available. You can modify XPL0 to solve your
particular problem.

XPL0 is more modular than C. In XPL0 procedures can be nested up to eight
levels. C only allows two levels of nesting.



REASONS TO NOT USE XPL0

You want to stick with a standard, widely used and supported language.

Your program must have the Microsoft Windows user interface.

You need structures (or records).

Some optimizing C compilers can produce slightly faster code.

You want an integrated development environment with a symbolic debugger.



LICENSE

This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 as published by
the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.

You should have received a copy of the GNU General Public License along with
this program (in the file LICENSE.TXT); if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.



I am always interested in hearing about people's experiences with XPL0.
If you have any comments, or suggestions, or especially bug reports,
please send me an email at: loren_blaney@idcomm.com

Updates can be downloaded from:
http://www.idcomm.com/personal/lorenblaney/

Thanks for your interest in XPL0.

-Loren Blaney
