![]() |
The following sample programs and tapes are provided:
In addition this page provides some notes about the tape formats used by the simulator and details of how to recover programs from cassette tapes.
Note: Where indicated (using a cassette image) some of these sample programs and tapes are recovered from original software. I do not own the copyrights for these recovered programs and so I sincerely hope no one will mind them being included in this package. If any of the original copyright owners object, please contact me at the email address at the bottom of the page and I will gladly remove anything that should not be here.
Source Code | samples/basic/hello1.basic |
This is a very simple "hello world" BASIC program. This program is used in the quick start guide.
This should be loaded as a BASIC program by typing the LOAD
command in BASIC and playing the tape.
Press the SPACE bar when the program has loaded to regain control of
the keyboard then type RUN
.
Source Code | samples/basic/charset.basic |
This is the program from page 38 of the manual which can be used to display most of the character set of the machine. It is not quite the same as the listing in the manual, as that listing actually contains a couple of bugs and also needed some changes to work correctly with the New Monitor.
This should be loaded as a BASIC program by typing the LOAD
command in BASIC and playing the tape.
Press the SPACE bar when the program has loaded to regain control of
the keyboard then type RUN
.
![]() |
|
This should be loaded as a BASIC program by typing the LOAD
command in BASIC and playing the tape.
Press the SPACE bar when the program has loaded to regain control of
the keyboard then type RUN
.
You should set the keyboard to game mode
to play the game.
![]() |
|
This should be loaded as a BASIC program by typing the LOAD
command in BASIC and playing the tape.
Press the SPACE bar when the program has loaded to regain control of
the keyboard then type RUN
.
You should set the keyboard to game mode
to play the game.
Source Code | samples/basic/blackbox.basic |
This is game kindly sent to me by Chic McGregor. It was first published in the July 1980 issue of Personal Computer World and is provided here exactly as originally published.
There's an interesting history to this particular program as it was almost
certainly the first user written
BASIC program for the UK101.
How can we know this? Chic tells me that the very first shipment of UK101
machines were sent out without any BASIC ROMs because the ROMs were not ready
due to some issues in the factory in Scotland that was producing them.
As it happened Chic (who bought one of those very first machines) was also
a young engineer working in that very factory - so not surprisingly managed
to get hold of a set of ROMs ahead of anyone else.
![]() |
|
This should be loaded as a BASIC program by typing the LOAD
command in BASIC and playing the tape.
Press the SPACE bar when the program has loaded to regain control of
the keyboard then type RUN
.
The program should give some instructions on how to use it.
You should set the keyboard to game mode
to play the game.
![]() |
|
Details of the extended monitor can be found on its instruction sheet.
The extended monitor is a machine code program and needs to be loaded through the Monitor, not as a BASIC program. To do this first reset the machine then select M to enter the monitor, press the L key to begin loading and play the tape. The extended monitor first loads a short checksum loader routine then loads the rest of itself in checksum format.
![]() |
|
Invaders is a machine code program and needs to be loaded through the Monitor, not as a BASIC program. To do this first reset the machine then select M to enter the monitor, press the L key to begin loading and play the tape. Once the game is loaded you can reset the machine and perform a warm start to restart it at any time.
The game was intended to be played on a standard 1Mhz processor, if you have over-clocked the processor (see system configuration) it may run too fast. Some old notes I have suggest that location $0F69 defines the game speed with the default value being 20 - on a 2MHz machine this might be best changed to 40, it says.
To move the laser the CTRL is used to go left and the left-SHIFT key is used to go right. On a real UK101 the CTRL-key is above the SHIFT-key so CTRL-for-left and SHIFT-for-right makes sense. Unfortunately these keys are the other way up on a PC keyboard so this is not ideal! I once knew some locations to patch to change these keys, but I can no longer find those notes - sorry! You should set the keyboard to game mode to play the game.
![]() |
|
This games is a mix of machine code and BASIC, to load it restart
the machine with a cold start into
BASIC, type LOAD
then play the tape.
The machine code will be loaded first followed by the BASIC program
and the program will then start to run and display its instructions.
If you do a warm start you can restart it just by typing RUN
.
This game rather cleverly hooked into the ACIA timing signals to ensure it always ran at the correct speed, even if the CPU was over-clocked to 2MHz - my thanks to Craig for explaining to me how this worked so I could ensure the emulator handled it correctly! It would also produce some simple sound effects if you hooked up a speaker or earphone to the ACIA output - this is not implemented in the simulation yet but I hope to add it soon.
To move the laser the left-SHIFT key is used to go left and the Z key is used to go right. The right-SHIFT key is used to fire, but note there are some problems when trying to use both shift keys independently on Windows (something to do with the way Java reports the key events), so you should use an alternative to the right-SHIFT if you can. When the keyboard is set to game mode either the right-CTRL or the Windows-Menu key (both normally directly beneath the right-SHIFT) can be used as alternatives for the right-SHIFT key.
![]() |
|
Asteroids is actually a BASIC program with a large section of
additional machine code.
To load it, restart the machine with a
cold start into BASIC and type
LOAD
, then play the tape.
The BASIC section will load and automatically run then it will continue
to load the machine that follows on the tape.
Once that has loaded the game will start.
If you do a warm start you can restart it just by typing RUN
.
To rotate the laser press the left-SHIFT to rotate anti-clockwise or press the right-SHIFT to rotate clockwise. Press the SPACE bar to fire. The laser does seem to rotate rather fast - I'm not sure if it always did this or if it is related to the simulation! You should set the keyboard to game mode to play the game.
When the UK101 wrote data to a cassette tape it was written as a series of bytes. Although most of the bytes that were written were standard ASCII characters, the tapes would include some control characters, some padding NUL (0x00) characters and possibly some bytes whose values were outside the range of the standard character set. If these tapes are saved as PC files, the resulting file is not guaranteed to be viewable on the PC and can probably not be successfully edited using standard PC editors without some data corruption.
To help overcome these problems the simulator allows tapes to be stored in one of three formats:
All the sample machine code programs are in binary format
and have a file extension of .tape
.
The conversion leaves any standard ASCII character unchanged,
it detects line ends and stores them as standard PC style
line ends and any other unrecognised byte is converted to an
escaped form \nn
where nn
is a pair of hexadecimal digits.
All the sample BASIC programs are in ASCII format and
have a file extension of .basic
.
The simulator will correctly recognise and load tapes any of the three formats and can save in any selected format. If you are saving a BASIC program it would make sense to save in ASCII format (which is the default) as the resulting program can then be viewed and edited on the PC. If you are saving a tape to potentially load back onto a real UK101 you will need to ensure it is in binary or maybe audio format.
The utility programs Tape Reader and Tape Writer can be used to quickly convert between the various formats.
If you have original UK101 programs on old cassette tapes it is usually possible to recover them on a PC so they can be loaded and used with the simulator, provided the tapes are still playable and provided you still have something to play them with. The first steps are to record the cassette as an audio WAV file on the PC:
If the recording is good quality and the original tape was in reasonably good condtion it should be possible to load the resulting WAV file directly into the simulator by playing it with the cassette player.
If the recording is poor quality or the original tape was in poor condition (which is quite likely) further processing might be needed to recover the data. This is done using an excellent piece of software written by Martin Ward that can examine and process the WAV file in great detail to recover the original data bytes. The process is something like this:
Tim Baldwin January 2014 tjb101@tinymail.co.uk |
Return to index
© Tim Baldwin 2010,2014 |