This site provides distributions of XPL0 that run under DOS and early versions of Windows, up through 32-bit Windows 7. Recent 64-bit versions of Windows must use something like DOSBox to run these programs.
A fully Windows-compatible distribution of XPL0, called EXPL, is available here: fountainware.com/EXPL/index.htm.
Most recent activity for XPL0 has been on the Raspberry Pi, which is available here.
Snarf 2.0 is posted below. It captures images from any VESA display mode, not just the standard ones. Linear frame buffers are also supported. A timer option captures images from programs, such as games, that lock out the keyboard.
Because DOSBox breathes new life into DOS programs, the 32-bit version of XPL0 for DOS has been updated to more closely match the Windows and Raspberry Pi versions. Many XPL0 programs now port between these environments without any modifications at all. This was mostly accomplished by adding 24 intrinsic routines, and automatically including 'code' declarations in new programs.
XPL0 is essentially a cross between Pascal and C. It looks somewhat like Pascal but works more like C. It was originally created in 1976 by Peter J. R. Boyle, who designed it to run on a 6502 microprocessor as an alternative to BASIC. The story surrounding its early history is here.
Although XPL0 stands for eXperimental Programming Language level Zero, it's well beyond the experimental stage and, hopefully, is regarded as well beyond level zero. The name is kept for historical reasons. The language is based on PL/0, Niklaus Wirth's example compiler in his book "Algorithms + Data Structures = Programs." Over the years, versions of XPL0 have been ported to many different computers. The programs provided on this site are mostly for IBM-compatible PCs. They all run under DOS, and DOSBox for modern Windows computers. *
Here's an example of a complete XPL0 program. It displays the (moving) image at the right, and it runs on any 32-bit PC (such as a Pentium) under DOS or WinXP. If running under Vista or later versions of Windows (or Linux or MacOS X) you'll need something like DOSBox.
int X, Y, Z;
[SetVid($111); \640x480 65536 colors
repeat for Y:= 0 to 479 do
for X:= 0 to 639 do
Point(X, Y, (X*X + Y*Y + Z)>>5);
Z:= Z - 127; \gently move ripples
until KeyHit;
SetVid(3); \restore text display
]
More examples of simple XPL0 programs are here.
Hugi Magazine has a couple articles showing how to make demoscene programs with XPL0.
XPL0 is available under the terms of the Free Software Foundation's General Public License, Version 2. All downloads from this site include source code (are open-source) and are completely free.
If you're hooked on C, XPL0 might not appeal to you. It doesn't have all the features of other languages. Normally this is not a problem, and it makes the language easier to learn.
XPL0 is by no means crippled. It's a block-structured language that supports recursion. It has two data types: integer and double-precision floating point ('reals' - with and without a math coprocessor). Even the small 16-bit version allows both code and data spaces larger than 64K. It provides generalized device I/O for the console, printers, files, and serial ports. It allows unlimited-dimensional arrays and complex data structures using pointers. It allows up to eight levels of procedure and function nesting (compare this to C which only has two). It has conditional compile, include files, separately compiled modules, inline assembly code, built-in graphic and transcendental routines, peek, poke, and port I/O.
The intent here is not to persuade you to use XPL0, but merely to make the language available. XPL0 is a significant piece of work that continues to be useful despite many other choices for programming languages.
If you're new to programming, you may find XPL0 easier to learn than the myriad of languages called "Basic." If your interest in programming is to make money, you're probably better off with Delphi or Visual C++. The versions of XPL0 offered on this website do not support Windows applications, which are expected on today's PCs. However, if you think programming is fun and want a deep understanding of how programs and compilers work, XPL0 may be for you.
If you're familiar with C, Pascal or FreeBASIC; you might find this chart helpful to see how XPL0 compares.
These are screen shots of some of the example programs included in the zip file:
Requires:
TASMX and TLINK can be gotten from here: https://sourceforge.net/projects/guitasm8086/
or from here: http://www.jumpjet.info/Application-Software/DOS/Programming/2/compilers.htm">
The native and optimizing compilers require an assembler such as MASM or TASM. A free version of MASM can be downloaded from here: https://sourceforge.net/projects/masm611/.
The optimizing compiler generates code that is about twice as fast and half the size as the non-optimizing native compiler. This shows how the Sieve of Eratosthenes benchmark gets compiled into assembly language.
Download XPL0-31.ZIP (221k, 16-Apr-2020).
Here's the source code for the compilers and run-time support routines.
Download XSRC-31.ZIP (249k, 16-Apr-2020).
Even if you're not into programming, you might enjoy running some of these games. They're all written in XPL0, and they all include the source code. They make good examples for the more advanced programmer.
Plat is a platform game that takes advantage of new
features in 32-bit XPLPX. Use the arrow keys to move the Easter Bunny and
collect all the eggs. Hop over boiling lava and other hazards. A particular
level can be started by typing its number (0-3) on the command line.
YouTube demo. Download PLAT.ZIP (61k,
17-Apr-2020).
TeXtris is a cross between Tetris and Scrabble. The idea is
to form words from falling letter tiles. Crammed into the small exe file
are the 53,800 official Scrabble words between 3 and 7 letters long. Not
only is the source code included, but all the utilities that went into
making this game (so, for instance, you can easily make the French
version). Download TEXTRIS.ZIP (276k,
25-Jul-2011).
Challenge Matey to a game of chess - or play against
another person with Matey enforcing the rules. Move pieces with the
mouse, specify skill level, undo bad moves, view Matey's thinking. This
is more of an XPL0 programming example rather than a strong competitor.
It rates about 1100 at its level 4 (blitz). Included in the source code
is a Tic-Tac-Toe program that provides a simple example of recursive
tree search. Download MATEY.ZIP (56k,
25-Jul-2011).
Test your skill at solving peg solitaire. The challenge is to jump over
each peg (or man, like in checkers) and see how many you can clear from
the board. You win when there's a single peg left in the center.
Included is a simple version of the program and a deluxe version by Ed
DeWan, shown here. If the deluxe version is run under WinXP, it must be
started from a DOS prompt in full-screen mode (for some strange reason).
Download SOLO.ZIP (67k, 25-Jul-2011).
Thirty years ago Space Invaders took over the world. Here are two
versions of that historic game, one in QBASIC by James Eibisch and a
translation in XPL0. Both are faithful copies of the original Taito
version. You may have a problem getting the sound to work. That's
because the Sound Blaster's FM registers are used, and these have been
phased out on modern machines. Download INVADERS.ZIP (74k, 25-Jul-2011).
Yer basic shooter...with source of course. Have fun!
The code shows how to play digitized sounds
Similar to but different than Windows Solitaire.
Spoof on Windows. Make horizontal, vertical
Venerable Chinese tile game.
Arcade version of classic Star Trek game.
Solve it yourself or watch the computer do it.
9-Jan-2012: This program understands English commands such as "Put the
red block on top of the green one." It was inspired by a much more sophisticated program called SHRDLU.
Download BLKWORLD.ZIP (22k, 9-Jan-2012).
Now it's your turn. Here's a simple program to
launch your career as a computer game programmer! The complete code is
only 4.5 pages long. Match pairs of cards by clicking on them with the
mouse.
The code is purposely kept simple. You might want to convert the text
images to stunning graphics (see 8Across). You might want to add a timer
to see how fast you can match all the cards. Download CONGAME.ZIP (8.5k, 25-Jul-2011).
This will tell you how late it is while saving you lots of money
on Nixie tubes. Download NIXIECLK.ZIP
(53k, 28-Jun-2011).
These animation players are courtesy of
Mihai Ionascu of Romania. One runs FLI files and the other ANI files.
They both use 32-bit XPL0. Lots of FLI files can be downloaded from
here:
http://cd.textfiles.com/maxx/tothemaxss/FLI/, and the FLI format is
explained here:
http://www.fileformat.info/format/fli/egff.htm.
The ANI format was originally made for the Amiga computer. Examples
and further information are here: http://www.randelshofer.ch/animations/.
Watch the bee buzz and Juggette do her thing! Download ANIMPLAY.ZIP (146k, 25-Jul-2011).
Simulate basic logic circuits.
Quickly "wire-up" gates and flip-flops. Connect them to push buttons or
clock generators, and watch 'em run. Red and green signal lines show the
logic levels (0 or 1). A group of gates can be selected then dragged,
duplicated, deleted, or deMorganized. Windows-like GUI runs under DOS,
Win3.1, 95, 98, and XP (even with nVidia), but not WinNT nor 2000.
Source code included. Download LOGICLAB.ZIP
(69k, 25-Jul-2011).
Although this device can be used to draw ellipses and is called a
"Trammel of Archimedes," it's more commonly known as a "BS Grinder."
With the program you can view it from any angle while it grinds away.
The Lattice program is a version of M.C.Escher's Cubic Space Division.
It consists of 5,324 blocks which are drawn as 31,944 triangles. My
Athlon 2400 updates the screen ten times per second without hardware
acceleration.
These programs use the Z-buffer rendering technique, which solves the visible surface problem for objects of any shape. It also provides X-ray vision!
Download GRINDER.ZIP (58k, 24-Mar-2020).
Here's a selection of maze programs from simple to complex - rectangular, hexagonal, and spherical - 2D and 3D - inside and out. Perhaps one of these eight programs will strike your fancy. Download MAZEMAD.ZIP (130k, 10-Jun-2012).
As Doctor Who would be delighted to explain, block transfer computations
Here's a simple version of a raycaster like used in Wolfenstein 3-D.
Fit the 12 pentomino pieces into the box. Programs like Pents stop running after a few seconds under Windows XP unless the Idle Sensitivity lever is set all the way to the Low position. This setting is buried in a Shortcut under Properties -> Misc.
This waterwheel defies expectations by periodically
Stereo 3D plot of the Lorenz Attractor.
The Mandelbrot set is the set of points C that do not cause Z
Version 1.2 solves an incompatibility with the CP/M emulator's method of handling file names. Here's the emulator: CPMEXE12.ZIP (136k, 27-Sep-2016).
11-Jun-2012: Improved versions of the compilers and their supporting runtime code are posted. You can read about these improvements in the Addendum section in the new manual, but here's the latest:
define Jan=1,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec;
18-Apr-2008: Thanks to Ed of DX-Forth fame ( http://dxforth.mirrors.minimaltype.com/ ) an incompatibility between 32-bit XPL0 and some graphic display cards has been fixed. The problem was introduced with version 3.3.4. Only two programs were affected (XPLPX335 and BTC), and their updated versions are now posted. (Some BIOSes alter the contents of the AX register for *all* calls to interrupt 10h even though the documentation does not indicate they're returning a value in AX.)
3-Jul-2006: A recipe for turning a torus into a donut: Real-Time 3D Rendering in XPL0.
4-Aug-2005: XPL0 Runs on Homebrew Machine: John Doran, a member of our local computer club (the 6502 Group), designed and built a computer based on 7400-series TTL. How it came to run XPL0 is described here.
13-May-2005: Another bug has been found and fixed. This time it was in Sokoban. Thanks goes to James Newton who reported it. (James BTW is the force behind PIC List . His main website is at: http://www.massmind.org ) Thanks also goes to Larry Fish, coauthor of XPL0, who pointed out that the problem was a bad intrinsic call when a digitized sound was about to be played. (Larry's Compass website is at: http://fountainware.com/compass/)
3-Oct-2001: The complete source code for the Apex operating system that runs on the Amiga A1000 and A2000 computers is available here: APEX-SRC.ZIP (339k).
Apex is roughly similar to Amiga's CLI (Command Line Interpreter) and MS-DOS. In addition to the Apex kernel, there's source for an XPL0 compiler, 68000 assembler, debugger, text editor, and numerous utilities.
The code is released "as is." It will take some effort to sort it out. I'll improve the documentation if interest warrants. Start with README.TXT.
Executable images of bootable diskettes are here: APEX-BIN.ZIP (207k). You will need to devise a way to copy these images onto an Amiga floppy (starting at the very beginning: track 0, sector 1). A1000.BIN boots in place of KickStart and occupies the KickStart RAM. A2000.BIN boots in place of AmigaDOS and requires a 68020 chip.
28-Jul-2001: If you've been looking for the version of XPL0 that runs on Parallax SX (formerly Ubicom, formerly Scenix) microcontrollers, it's here: Download SXPL.ZIP (131k).
26-Jul-2001:
Lenny Boreal releases his text scroller.
This elegant program with its "jumpin'
graphics" is a mere two pages of code!
Download SCROLLER.ZIP (7.4k).
22-Jul-2001: Archaeological dig unearths ancient XPL0 programs. Many are for old computers, such as the Apple II and Amiga, and will not run on a PC without modification. OLDXPL.ZIP (1158k)
9-Jun-2001: Example of a driver for a SanDisk MultiMediaCard. This is 8088 assembly language rather than XPL code, but I didn't know where else to put it. MMC Source Code
2-Jun-2001: CueCat barcode scanner example
Last update: 8-Jan-2021