README.TXT	30-Jul-2026

Greetings!

It's assumed here that you have some experience with XPL0. XPLW is still
being developed, but it has reached a usable state. Currently, there is
no manual describing it, but the manuals for the Raspberry Pi and MS-DOS
versions describe over 95% of its features.

The main appeal of XPLW is that it works directly under 64-bit Windows,
which is what most people use these days. This makes XPL0 programs more
accessible than before. The required assembler, ml64.exe, is available in
a free download of Microsoft's Visual Studio, and GoLink is freely
redistributable and included here. The required DLL files are
automatically provided by Windows.

Programs compiled with XPLW run substantially faster than anywhere else.
The Sieve benchmark runs ten times faster than on the Raspberry Pi4,
twenty times faster than under DOSBox, and a hundred times faster than
with EXPL.

An appealing feature of XPL0 is its built-in graphics capability. Video
games are the ideal way to show this. Poker and Minesweeper are provided
to get you started. Cubic, Fountain, Boxes and ABall are some additional
graphic demos.

Most existing, non-graphic text-only XPL0 programs compile and run
without any problems. Some programs require an adjustment for the
increased size of integers. They often have "IntSize = 4", which must be
changed to 8, for 8 bytes in an integer.

Once you have obtained ml64.exe, XPL files can be compiled, assembled,
and linked into EXE files by running the included batch file. For
example, xx hello creates hello.exe, which can be run from a Command
Prompt window. Running it from File Manager works except that its
temporary window closes so fast that you probably won't see it.

XPLW defaults to terminating text strings with a zero byte. All other
versions of XPL default to terminating strings by setting the most
significant bit of the last character. If this difference prevents a
program from working, add "string 1;" near its beginning to switch back
to MSB termination.

A new feature added to all versions of XPL0 is the constant byte array.
This is the same as the traditional constant array except the elements
are restricted to byte values in the range -128 to 255. Braces are used
instead of brackets to indicate bytes. For example, Array:= {123, $FF,
-23, ^A}; Byte arrays are limited to a single dimension. They're useful
for porting arrays between the 16-, 32- and 64-bit versions of XPL0.

Windows' Defender can automatically delete some EXE files without any
warning. The 2048.exe program is particularly susceptible. Prevent this
by setting Windows Defender folder exclusions (as explained on the
Internet).

I'll be glad to help anyone trying to get any version of XPL0 working.

Happy computing!
Loren
loren.blaney@gmail.com


MISCELLANEOUS DIFFERENCES (BUGS?)

XPLW currently lacks some features of other versions of XPL0.

The printer devices (2 and 5) are not implemented. Output from a program
can be redirected (on the command line, e.g: > temp.txt) to a file and
that file can be printed by another program, such as Notepad.

Two separate text cursor positions are maintained for devices 0 and 6
when in text (not graphic) modes.

Unlike EXPL, device 0 does not support attribute colors. Only device 6
provides characters in colors other than white on black, which is the
MS-DOS standard.

Attribute colors in text modes don't use the palette colors (set by
SetPalette); they use the default Windows colors instead.

SetVid(1) does not display a 40-character-wide screen. Text in 320x200
graphic modes displays wide characters like always.

The multitasking intrinsics of the RPi, such as process:= Fork(processes)
(105) are missing. The Allsorts.xpl program requires these intrinsics.

The required file, code.xpl, is simply stored in the current directory
(not in the original c:\cxpl).

In text mode, clipped windows wrap, instead of clip, from right to left;
but they do clip at the bottom.

Rosetta Code's fixedrec.xpl fails. An output file was opened and written.
It was not closed because it used the small buffer. Attempting to open it
a second time failed. This works on the RPi.

Rosetta Code's airmass.xpl gives Cos overflow error 7 when run on Intel
i7 and AMD Duron computers. However, it works on Raspberry Pi. The Intel
Manual says something about it being the programmer's responsibility to
keep the argument under 2^63.

Rosetta Code's avgloop.xpl fails for very large random numbers. Replacing
-1>>1 with $7FFF_FFFF makes it work.

Rosetta Code's extfp.xpl and extreme.xpl don't display -Inf, etc.

Recurse.xpl shows for RPi: 1,047,552 vs. Win: 128,000.

Calling Line when in a text mode causes a fatal memory access violation
(AV error). Always set a graphic mode before drawing graphics. TTT.XPL
gives an AV error because it attempts to draw lines in text mode 1. Under
DOSBox this doesn't show the lines, but it doesn't blow up. Changing
SetVid(1) to SetVid($13) partially works, but Move Y is not large enough.

The Paint intrinsic does not implement the IW0 windowing feature.

It might be nice to have a 'sizeof(X)' command since there are 2, 4, and
now 8 bytes in an integer. This would make going between versions
(especially 32- and 64-bit) automatic. However, the new xpllib routine
SizeOfInt pretty much makes sizeof(X) obsolete.

Clicking on [X] aborts ED.exe without the chance to save its file.

The code: A:= N; B:= N; reloads N into the RAX register, missing a simple
optimization. (The /b /d flags were used.)

9223372036854775808 (=$8000_0000_0000_0000) is not detected as out of
range. Note that the negative value -9223372036854775808 is accepted as
in range.

Increase Random number intrinsic (Ran) from 31 bits to 63 bits.

Divide-by-zero simply aborts without displaying an error message. It
aborts the program with errorlevel = C0000094 (displayed in decimal).
There's no way to hook an interrupt vector (0, in this case). There may
be a way to use .try and .except.

Bug:
cond false;
Text(0 "^"true^" ..."
cond true;

How much stack space is available? ChatTest5 recurses 2,000,000 times.

A null program cannot be made. NULL.XPL does not declare PROGRAM as
PUBLIC. This same issue exists for xpx and xx under MS-DOS (so it's
probably not worth worrying about). However, x does work, and so does
EXPL.


DROPPED

These features are not implemented and probably will never be:
 Serial device 4.
 'extern' 'eproc', 'efunc' (These might work but aren't used on RPi.)
These intrinsics in the DOS version were never supported in the RPi version:
 ExtCal, Irq, Equip, Shrink, ExtCal, ExtJmp, IntRet, PIn, POut, Peek, Poke
 Blit, GetReg, SoftInt, Read and Write.
