manual for version 1.28
original manual (c)
by Carlo Delhez, October 1997
this manual (c)
by Carlo Delhez, May 2006
Introduction - Program
Description - Registration - Compatibility
- Comparison - Starting
XTender - AutoLoad-n-Run - Commandline
Qualifiers - Screen Output - Keyboard
Facilities - Keyboard Compatibility
- Mouse Control - File
Management - Printer Output - High
Resolution - ZX81 64k Memory Map - ROM
and 8-16k Area - Stopping XTender - Clock
Frequency - Slowing Down - Z80
Emulation - Programs from Tape to Disk
- Screen Saver - Warranty
- About the Author - XTender
Release History & Future - Final Notes
Although the ZX80 was quite a success (50,000 sold), it has some shortcomings, e.g. it can only do integer calculations (no floating point), the screen flashes at every keepers and goes blank during execution of programs (this does increase speed but is not very 'ergonomic'). An upgraded version of the ZX80 appeared within a year. It has an 8k ROM (instead of the 4k of the ZX80), can do floating point mathematics and offers a choice between FAST operation with black screen (as on the ZX80) or SLOWer operation with normal screen. This updated version is called ZX81.
The ZX81 has a Zilog Z80A processor operating at approx. 3.2 MHz, 1k RAM (yes!, only 1024 bytes, but expandable to 48k), 32x24 text screen and 64x48 graphics resolution in black and white. Programs can be stored on tape and be retrieved at 300 baud. The first versions sold for 70 pounds (ready built) and 50 pounds (DIY kit); 50,000 ZX81s were purchased in the first 3 months after its release.
Later computers from Sinclair include the ZX Spectrum (1982, Zilog Z80 processor at 3.5 MHz, 16k ROM, up to 48k RAM, colour, sound, high resolution, a lot faster thanks to video hardware instead of -software, ASCII based character set and more expansion possibilities) and the QL ("Quantum Leap", 1984, Motorola 68008 processor at 8 MHz, 48k ROM, 128k RAM, multitasking and superb operating system Qdos).
Although the ZX Spectrum undoubtedly was (and still is) the most popular of all Sinclair machines, I think that many people using PC's nowadays may have been introduced to the world of computers by way of their (late) ZX81. I hope these people will re-enjoy working with this simple yet very fine computer again.
Run XTender and be my guest!
Test XTender during a trial period of 21 days and then delete the files if you don't like to use the program.
However, if you do like to use XTender, please express your appreciation and support my efforts by becoming a registered user. This will entitle you to the following benefits:
A registered copy of XTender, including three library volumes and the services described above is priced at US $ 20.
Orders can be placed via PayPal only. PayPal is the leading provider of world-wide secure internet transactions for eBay and many other sellers, both professional and private. Membership is fully free, and the payments you make are taken off your bank account or credit card account in your own currency. No additional fees are charged. If you want more information about PayPal, click here.
To order your registered copy of XTender instantly via PayPal, just click this button:
Once your order has been received, a registered
copy of XTender will be sent to you by email.
Apart from these exceptional applications, any
program running on the ZX81 should also run on XTender.
Two versions of XTender exist. These are named XTENDER! (with exclamation mark) and XTENDER (without exclamation mark). The former is the fastest version and should be used on slow machines (XT, AT). The latter is not speed-optimized, hence a little slower. However, this one has the possibility to slow-down emulation considerably and should be used on (very) fast machines; this slow version is supplied with registered copies of XTender only.
To start the program, simply type
XTENDER! (fast version)
or
XTENDER (slow version,
registered
copies only)
(whichever you prefer or have) at a DOS prompt or double-click in your Windows file browser. This will start XTender. First you will see a title page which displays some general information about XTender and its usage (Note: in case of registered copies, the title page is skipped, use the /t qualifier to see it, see section Commandline Qualifiers). Now press any key to start the actual ZX81 emulation. Depending on the speed of your computer, you will see some flashes and/or weird characters while the ZX81 performs a reset, but eventually the famous inverse-K cursor should appear and XTender is ready to be used.
XTender tries to determine what video card you
have installed simply by looking at the current video mode so as to make
a distinction between Hercules and non-Hercules. In Hercules, only a small
portion of the display will be used, in all other cases, the ZX81 screen
occupies almost the entire display. If you have CGA emulation on your Hercules
card and want to use it with XTender, make sure you do not start XTender
in video mode 7. Alternatively, you can force Hercules or CGA mode by the
/e
and /c qualifiers, respectively (see section Commandline
Qualifiers).
XTENDER program.p
This will start XTender as usual, but instead of showing the K-cursor after reset, it will auto-load the ZX81 program "program.p". If this is a self-running program, the program will even start running automatically after auto-load. Otherwise, you will get the K-cursor as usual (but ofcourse the program you specified is present in ZX81 memory!). If the file cannot be opened, the ZX81 will reset and start as usual (no error is reported).
AutoLoad-n-Run will work only once. After NEW or RST-0 or CTRL-ALT-ESC, the program will not be auto-loaded again.
Note that the filename supplied in the commandline must be a DOS-type filename ("8.3") without a path (unless the total size of path and filename does not exceed 12 characters: everyhing beyond the 12th character is ignored). The extension ".p" must always be typed. If you supply more than one filename, only the last one will be used. Qualifiers may be placed in front or behind the AutoLoad-n-Run filename.
If the P-file specified cannot be opened, this is reported and XTender will not start.
For DOS-type filenames, you can even AutoLoad-n-Run
ZX81 programs from your Windows file browser by linking the file-extension
".P" to the XTender-executable.
/b:nn
set background colour; this option only works
if you have an EGA/VGA video card; nn is a decimal number in the
range 0 through 15, corresponding with the 16 colours in the regular EGA
palette.
/c
force CGA screen mode; use this qualifier when
XTender tries to use Hercules although you have a CGA (or better) video
card installed.
/d:nnn
registered copies
only: set emulator delay factor; nnn is a decimal number in the
range 0 through 255; this qualifier is equivalent to the ZX81 command POKE
23,nnn after XTender has been started; for more information, see section
Slowing
Down. XTender! (with exclamation mark) cannot be slowed down (qualifier
not available).
/e
force Hercules screen mode; use this qualifier
when XTender tries to use CGA although you have a Hercules video card installed.
/f:nn
set foreground colour; this option only works
if you have an EGA/VGA video card; nn is a decimal number in the
range 0 through 15, corresponding with the 16 colours in the regular EGA
palette.
/h
display help page, briefly summarizing all qualifiers.
/i
force inverse video (e.g. white characters on
black background), which seems more comfortable for the eyes in case of
serious applications. Note that keystroke F2 or CTRL-F2 can be used
to toggle screen colour once the emulator is started (see section Keyboard
Facilities).
/k
alternative keyboard circuit. Some programs,
especially games, may fail to respond to the keyboard. If this happens,
these programs may have been designed specifically for a TS1000 (NTSC version
of ZX81); use the /k qualifier to emulate this properly (but a
cure is not guaranteed).
/m
skip ZX81 memory test; after a NEW or
reset, the ZX81 ROM performs two main actions: it tests the RAM and sets
up the display file. Each of these takes about half the reset-time. On
an emulator, the memory test is not necessary and can be omitted by this
qualifier, thus reducing the reset-time by at least 50%. Note that the
RAM is still cleared (zero-filled).
/r:nn
set default ZX81 RAM size. On the original ZX81,
the RAM size after reset is always 16k (or less if less RAM is available),
because this number is fixed in the ROM. On the emulator, you may change
this number to get any RAM size after a reset from 1k up to 48k (set nn
to a value of 1 through 48).
/s
disable screen-saver (registered
copies only).
/t
show title page of registered
copy. On registered copies, the title page is skipped by default. In
case you are a registered user and wish to see the title page (containing
a brief description of key usage and your name), use this qualifier.
/x
enable mouse controls. By default, mouse controls are disabled.
Qualifiers may be placed in front or behind the
autoload-n-run
filename.
Before XTender starts emulating, it first determines the relative speed of your computer. It does this by running a benchmark test and the resulting benchmark is used to calculate the rate of screen update. For example, if the measured benchmark is 1000 (approx. 33 MHz 386dx machine), the screen is updated at a rate of 100 Hz. Lower/higher benchmarks result in proportionally lower/higher screen update frequencies. As a result of this method, the performance of XTender is automatically optimized for any machine. I have tested XTender on an original PC (benchmark 50, screen updated at 5 Hz) and the emulator (fast version) still executed at a speed of 35% with respect to the real ZX81!
You can see the measured benchmark and resulting screen update frequency by loading the program SYSINFO.P directly after having started XTender. This will provide you with the information you need.
The timer interrupt of the PC can be set to one single frequency only. However, XTender actually needs three distinctively different frequencies:
An XTender user pointed out that (some?) screen-grabbers
seem to work fine with XTender, so if you want to make GIFs (or whatever
graphical format you prefer) of your favourite ZX81 pictures, a screen
grabber may be a useful tool to do just that!
As an example of keyboard operation, take a look at the A-key on the help screen. It contains the following symbols:
Table: Example of keyboard usage.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The K-cursor (for Keyword) always appears at the beginning of a command line and after a THEN keyword; the L-cursor (for Letter) appears elsewhere. The F and G-cursors (for Function and Graphics) can be activated by pressing Shift-Enter (or keypad-5) and Shift-9, respectively.
The default ZX81 screen colour is black characters on white background (unless you have used any one of the /i, /b or /f qualifiers, see Commandline Qualifiers). For games with a lot of graphics this may be OK, but for text handling, I find the inverse far more comfortable for the eyes. Press F2 or CTRL-F2 to change the display from black on white to white on black and vice versa. Alternatively, you may wish to use F4 and/or F5 to change the fore- and background colours (EGA and VGA only): a regular 16-colour EGA palette is available.
Some ZX81 (machine coded) programs do not allow you to stop them using Break (Space key). On XTender, programs can always be stopped using CTRL-ESC. This will actually cause a jump to an address in ROM where a RST 8 for error D is located, and hence the stack is cleared, the error message is displayed and you are back in Basic. Some programs crash the ZX81 if you try this, as they may have messed around with the system variables, Basic area, screen or even with the ROM code. If CTRL-ESC causes a ZX81 hang-up, press CTRL-ALT-ESC to recover. This restores the original ROM code and subsequently executes a RST 0. Any program can be aborted safely using CTRL-ALT-ESC. Note that the PEEK value of address 23 is preserved (or at least, it should be!).
On some computers, CTRL-ALT-ESC is already in use for system purposes; therefore, the keypress CTRL-SHIFT-ESC may be used as an alternative.
In general, CTRL-ESC should only be used when the normal Break is disabled. If you use CTRL-ESC in the normal ZX81 editor, it will lock keyboard operation. Press CTRL-ESC once more to get proper key response again. In the CBI editor, CTRL-ESC merely produces a space character, i.e. does not lock the keyboard. In all cases, avoid using CTRL-ESC when CBI Trace is active.
CTRL together with a key other than one
of the above has the effect of SHIFT pressed together with that
key. CTRL-C is hooked and has no drastic effect (it produces
Shift-C,
i.e. a question mark). CTRL-Break is more dangerous: it
immediately stops XTender and returns to the DOS prompt.
For unShifted PC-keys, XTender maps almost the entire PC keyboard to the ZX81 keyboard. Not only the 40 basic ZX81 keys, but also things like the arrow keys, backspace and the numeric pad are mapped. For example, if you press 'arrow left', XTender will convert this to Shift-5, the ZX81 equivalent. This makes editing (and sometimes also playing games) less strenuous. The central key of the numeric pad ('5') generates Shift-Enter, i.e. toggles Function mode (a special cursor mode for obtaining functions tokens, see Keyboard Facilities). More special keys: the square brackets [] are converted to regular brackets () and the single forward quote ' is converted to the ZX81 double quote ". The ESC key generates Shift-1 (Edit), i.e. brings the current cursored Basic line down into the ZX81 line-editor.
Also for Shifted keys, the emulator helps you a little bit. Pressing any one of the Shift keys will always give you the ZX81-Shifted symbol (like Shift-U for '$'). But, if you press Alt instead of Shift, you will get the PC-Shifted symbol, so you can press Alt-4 to get the Dollar $ign. Some non-trivial ALTernatives are listed below:
Finally, if CAPSLOCK is on, the effect of Shift is inverted for all keys (not only the letter keys). So, pressing B with CAPSLOCK on gives *, and Shift-B gives B. Note that this can be especially nice for some games which use the keys 5 through 8 for steering and do not allow you to press Shift (so you cannot use the PC arrow keys). With CAPSLOCK on you can use the arrow keys of the PC-keyboard!
Multiple keypresses are handled correctly, which is especially useful when playing games (e.g. move and fire at the same time).
If you wish, you can also use your PC mouse to control a few of the ZX81 keys. This is an experimental feature and therefore it needs to be enabled at start-up by the /x commandline qualifier.
When enabled, mouse movement and clicks can be used to "press" ZX81 keys, as shown in the table below:
Mouse | ZX81 key |
move left | Shift-5 |
move right | Shift-8 |
move up | Shift-7 |
move down | Shift-6 |
left-click | Shift-0 (rubout) |
right-click | Newline |
This works well for
the ZX81 BASIC program editor and for many ZX81 games. In a future
version of XTender, the ZX81 keys may become programmable. If you have suggestions on how to improve this feature, please let me know.
To SAVE or LOAD a program, just type
LOADing a non-existing program will display the proper DOS error. If you SAVE a program which already existed, it will simply be overwritten without any user confirmation. Saving a program without a name (empty quotes) results in the usual error F. Originally, QZ filenames were up to 12 characters long. In DOS, one is so unfortunate to be restricted to 8. So: only the first 8 characters of the name will be used. Do not include inverse characters in the name, since these are used internally by the ZX81 to indicate the end of the name.
Most ZX81 users will be used to typing LOAD "" for loading the first program found on tape. Since diskdrives are not designed for sequential access, LOAD "" cannot be used on the emulator. Instead, XTender will show the directory of the current drive and path (same as *DIR:, see below).
QZ file handling commands can be passed to XTender in a LOAD or SAVE statement. The first character of the SAVE/LOAD name must be an asterisk * to indicate that one or more QZ commands follow (instead of the usual filename). The available commands, a short description and examples of each command are listed below:
LOAD "*USE:D:;CD:../GAMES:;DIR:"
Only the trailing colon of a line may be omitted
(i.e. the one behind DIR in the example above). Any non-supported
command after the asterisk will display the erroneous text plus the message
ERROR
IN QZ COMMAND, and stops with Error C (syntax error).
Hi-res is detected by XTender by trapping an immediate change in value of register IX (used by the ZX81 as NMI server address). The term 'immediate' means that only the instruction LD IX,nn (DDh.21h) is trapped. You could avoid the trap by using a sequence like LD HL,nn, PUSH HL, POP IX. However, all hi-res programmes tested use the (more obvious) immediate method.
After the detection, XTender tries to emulate
the semi hi-res by looking for the characteristically shaped 6k display
file in the bottom 16k of RAM and printing it to the PC screen appropriately.
If it cannot locate this display file, normal resolution will be switched
on.
|
|
Description |
|
|
Original ZX81 8k ROM area. |
|
|
Often referred to as '8-16k area'; on the ZX81 this area can only be used when additional hardware is fitted (e.g. 64k RAM pack or EPROM card); the standard ZX81 shadows its ROM in this area. |
|
|
Up to 48k of RAM; at startup, the ZX81 allocates at most 16k of RAM to BASIC; the remaining 32k is kept free for data storage; more or less area can be allocated to BASIC by moving RAMtop (system variable at 4004h) upward or downward. |
|
|
System variables area. |
|
|
BASIC program area. |
|
|
Display file (text mode!). |
|
|
BASIC variables area. |
|
|
Workspace. |
|
|
Free memory, available for BASIC; this area is cleared by NEW; the machine code stack grows down from the top address of this area. |
|
|
Free memory that cannot be used by BASIC and that is also not influenced by NEW, hence useful for resident utilities or RAMdisk; provided [4004h] is above 7FFFh, this area is also not altered by RST 0 (reset). |
Note: [addr] is the value obtained
by PEEK(addr)+256*PEEK(addr+1), i.e. the usual
Z80 word-peek with the low byte logically in front of the high byte.
At startup, the 8-16k area contains a relocated version of the Coral Basic Interpreter (CBI version 7.0). You can start this program by typing
RAND USR 8192
This should give 0/0 in line 22 and a black cursor in line 23. CBI may be useful for people with little ZX81 experience since it has both a full-entry keyword decoder, full-screen editor and explains error messages on request. All usual ZX81 commands are available, as well as 46 new ones (including commands for PROCedures with two-way data exchange and structured loops). Naturally, CBI was written for the ZX81, but runs equally well on XTender. For details on this program, read the textfile supplied with XTender. Two useful commands to enter when the black cursor appears are
ERR MSGS ON ... explains error messages
NOSTALGIC OFF ... enables full screen
editor
Note that you have to type the letters one-by-one,
the spaces are optional. The system variables of CBI are stored at address
65400 onwards (corresponding to address 32730 in the original version).
The CBI program ends at address 13522, so the part of memory from address
13523 up to and including 16383 is available for your own use.
LOAD "*KILL-XTR:"
which will bring you back to DOS. A fast alternative is:
LOAD " STOP "
with STOP typed as a keyword (i.e. Shift-A)
instead of the separate letters.
Finally, for the very impatient: pressing CTRL-Break
will stop XTender as well!
The ZX81 runs at approximately 3.2 MHz in FAST mode and (effectively) at 0.8 MHz in SLOW mode (emulated by XTender). Supposing a program on XTender takes half the time the ZX81 would take to execute it in SLOW, the effective clock frequency is (0.8 MHz)/(0.5) = 1.6 MHz.
Another way to find the clock frequency is to use a machinecode test loop, embracing a single instruction which is executed many (e.g. 65536) times. If you then count the number of frames needed (and subtract the number of frames needed for just the empty loop) you can get an idea of the clock frequency of that specific instruction, provided you know the number of T-cycles the Z80 would normally need for that same instruction.
A very good estimate of the emulated processor
speed can be obtained by LOADing the program CLCKFREQ.
This program does some simple printing and plotting, but the final result
is a reliable measure for the average speed of XTender and the effective
(emulated) processor speed.
On fast machines the speed of XTender can be reduced by POKEing address 23. The byte at this address is used as delay counter at each Z80 instruction. Default value is 0, which gives (practically) no delay. A higher value will quickly slow-down the emulation process.
Values 1..128 yield a 'linear' slowdown: after each Z80 instruction, the emulator will be halted some time; the length of the idle period is linearly dependent on PEEK 23. When POKEing 128 into address 23, XTender will be running about 27 times as slow as when you would have POKEd value 0.
POKEing values 129..255 results in a 'quadratic' slowdown and should be used on very fast machines only; even values only slightly above 128 can result in a huge slowdown factor. Theoretically, the maximum slowdown factor is about 3500 which is obtained by POKEing 255 into address 23 (but unfortunately I didn't have enough time for spare to test it...)
Table: Example of slow-down on a 33 MHz
80386dx machine (benchmark 1000).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Please note again that the slowing down does not work with XTENDER! (with exclamation mark, supplied in the shareware package), only XTENDER (without exclamation mark, supplied in the registered package) can be slowed-down.
Once you have determined which value of PEEK
23 suits your needs best, you can start XTender with the /d:nnn
qualifier in order to set the delay factor to nnn without actually
having to poke it into the ZX81 memory (see Commandline
Qualifiers). Of course, you can still alter this initial value during
the session!
Some brief remarks for Z80 freaks:
On registered copies,
the screen-saver can be disabled by using the /s qualifier at
startup (see section Commandline Qualifiers
for more information).
In 1987, I decided to buy a Sinclair QL (during sales) and found this younger brother to be just as interesting as the ZX81. It also gave me a good excuse for learning 68000 machine code. As I saw that less and less people were actually using the ZX81, I sought a way for elongating its existence. I thought that (among other things) a ZX81 emulator for the QL would be a good way to do so, and I started writing this program (called XTricator) in the end of 1989.
At that point in time, it also became unacceptable to not have a PC - so I bought one. In order to stay loyal to the absorbing machines made by Sinclair, I decided to write a ZX81 emulator for MS/DOS as well. The 8086-family of processors is (basically) very similar to the Z80, so I did not really have to learn a new language, only a new OS. The first beta version of XTender was already available in 1991, and the first official release was in 1993.
By now, in 2006, you can
see the final and ultimate result of my efforts. Although XTender is
still a "simple" DOS program in a world ruled by "Windows" and
"clicking", I sincerely hope that
many (former) ZX81 users will take some time to use XTender to leap
back in history and
(re)enjoy the overwhelming simplicity of the 64k, 8-bit, 3.2 MHz Z80,
black
& white computer with 64x44 graphics resolution, which introduced
over
a million people world-wide (including myself) to the wonderful world
of
computing!
Table: XTender release history in reverse chronological order.
1.28 | May 2006 |
|
|
August 2001 |
|
|
December 2000 |
|
|
October 1999 |
|
1.17 | October 1997,
June 1998 |
|
|
May 1995 |
|
|
March 1994 |
|
|
January 1994 | |
|
October 1993 |
|
|
May 1993 |
|
|
March 1993 |
|
|
February 1993 |
|
|
January 1993 |
|
|
June 1992 |
|
|
Oct'91 - Feb'93 |
|
|
October 1991 |
|
attn. Carlo Delhez
Note: if you write in English,
German or French, the reply will be in English. If you write in Dutch,
the reply will be in Dutch.
Thank you for reading the manual & for using XTender !!