README.TXT      3-Jan-2012

                              X P L 0

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

Major features of XPL0 include: block structure; recursion; 16-bit
integers and 80-bit floating point; support for a 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; compile and run-time error checking;
and a cross-reference generator.

This distribution package contains three 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. The optimizing version uses various techniques to
generate code that is about twice as fast and half the size as the native
version.


REQUIREMENTS

The minimum requirements are: an IBM PC-XT or compatible, 256K RAM, 1
floppy drive, and DOS 3.3 or higher. The native version requires 640K
RAM, a 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 XPL0 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,
by typing these (lowercase) commands:

       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 which 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

In addition to this README.TXT you should have these files:

       XPLIQ.EXE       Compiler that produces interpreted (.I2L) code
       I2L.COM         Interpreter and loader for .I2L code
       I2LS.COM        Small interpreter (no reals, slow line draw)
       XLINK.EXE       Linker for combining multiple .I2L and assembly files
       X.BAT           Batch file to compile and load interpreted programs
       XS.BAT          Compile and load small programs (no reals, slow lines)

       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, slow Line draw
       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, slow Line draw
       XX.BAT          Compiles, assembles, and links optimized code
       XJSB.BAT        Like XX but with NATX and /J/S/B options (MASM 6 req.)

       MANUAL.TXT      Tutorial and reference manual
       ADDENDUM.TXT    Changes since version 2.3
       VER251.TXT      Changes since the previous release (version 2.4.6)
       VER26.TXT       Changes since version 2.5.1
       VER27-9.TXT     Changes since version 2.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

Ideally 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) will print a nice manual with two pages per sheet of
paper.


REASONS TO USE XPL0

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

XPL0 has a simple, English-like 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's 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 micro controller).

The complete source code is available. You can modify XPL0 to suit your
particular needs.

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'm always glad to hear from people who use XPL0. If you have any
comments, problems, suggestions, or especially bug reports, please email
me at: loren.blaney@gmail.com

Updates can be downloaded from:
http://www.xpl0.org/

Thanks for your interest in XPL0!

-Loren Blaney
