The CHIP SHOP,  BBC Radio 4, 1984

BASICODE 2

Chapter One

INTRODUCTION 

first page(s) missing   !  !  !  !  !  !  !  !  !  !  !  !  !  !  !  !  !

starting with page 6:  

At that time four brands of computer were popular: Apple, Exidy Sorcerer, PET and Tandy TRS-80. Each computer therefore had its own week in the month when machine-readable data could be transmitted. But this led to problems for the broadcasters. Two of the computers used a very slow baud rate which meant that intelligent programs took up far too much airtime on a national radio network. Up to eight minutes of objectionable noises was too much even for the enthusiasts! Added to this, the cassette systems proved to be rather unreliable on two of the four computers. Only a very small group of the Dutch computing public was being reached at any one time.
Klaas Robers, who is a well-known inventive radio amateur in The Netherlands, then came up with an interesting proposal. This involved the creation of a type of Computer Esperanto which could be read and written by various home computers. A group of computing hobbyists got together and BASICODE was the result of many months of research. Later, when the limitations of the first BASICODE were recognised. Klaas Robers, together with Jochem Herrmann, developed the improved BASICODE-2. This has now been in regular on-air use since January 1st 1983.
It was soon discovered that the Dutch medium wave signal was reaching utside the Dutch borders. Letters came from computer enthusiasts in England, Germany, Belgium, France and Denmark asking for more information. Further international interest was created when the Dutch external service, which broadcasts worldwide on short wave, took an interest in BASICODE. The Thursday English language programme Media Network ran a feature on the code. They also tried a series of popular experiments with a slowed down version of BASICODE running at 300 Baud. The data went out on short wave and listeners within 1,200 miles of the transmitters reported success.
The weekly Hobbyscoop programme is in Dutch, naturally, but it can be received in some parts of the UK. It can be heard on Sundays at 1810 GMT in winter, 1710 GMT in the summer months, on medium wave 747 kHz, or 401 metres. Because listeners in Denmark, Belgium, Southern Britain and West Germany can load BASICODE programs from medium wave without problems the computer segment of the programme (around 1840 or 1740 GMT), now includes short explanations in English. If you are in range of the medium wave broadcasts, tune in and see if you can receive them.
Apart from the people named above who have been involved with the success of BASICODE, many individuals in The Netherlands have helped us in the production of translation programs and, in some cases, hardware designs. We thank them.

Chapter Two

HOW TO USE BASICODE-2 

BASICODE-2 was developed because different micro-computers not only speak different dialects of BASIC, but also record or save the programs onto cassette in different ways. All micro-computers that use cassettes record their programs as a series of bleeps but different machines use different frequencies and various methods of coding. BASICODE-2 is an audio encoding standard that can be used to store and retrieve software and can be used with a large number of micro-computers. Once a microcomputer has been taught BASICODE-2 it can then run programs written on different makes of micro-computer. The only problem that remains is the differences in BASIC dialect but BASICODE-2 again gives us the solution. Our Computer Esperanto interprets the program instructions so that they will work on all the micro-computers listed in Chapter One. This does mean that if you want to write programs for BASICODE-2 you should write them according to some simple rules. You will find these in the chapter written specifically for your micro.
How to load BASICODE-2
On the first side of the tape you will find a number of different versions of BASICODE-2. They are each preceded by an introduction, so find the one for your micro-computer and load it in the normal way. There will be some special points to bear in mind for your particular computer so refer to the relevant chapter for full details.
Once you have loaded BASICODE-2 you are ready to try out some BASICODE-2 programs. On the second side of the tape you will find some demonstration programs. To load one of these programs you should follow the instructions on the screen and also, for some micros, refer to the instructions in the relevant chapter. When the program starts loading you will see the program being listed on the screen. You will be able to check the program for errors and make corrections before running it.
Now that BASICODE-2 is running on your micro here's how you can use the Chip Shop programs.
Chip Shop Takeaway
The Takeaway service allows you to get software from your radio. The BBC is broadcasting software late at night on Radio 4. Check in the Radio Times for details of transmission times. The software being transmitted is written in BASICODE-2, so, armed with the translation tape, you will be able to run the programs on your micro.
To make sure that the programs run properly you need to make a good recording. Here are some tips:
1.	If possible record off VHF, because it's a higher quality signal and less susceptible to interference. If that's not possible then use long wave or medium wave. For frequencies see the Radio Times.
2.	Use a direct connection between your tape recorder and the radio. If you use a microphone someone's bound to burst into the room at the crucial moment!
3.	Set the recording level before the software is transmitted. Don't over-record as this may distort the signal and the program might not work.
4.	Use a short tape if possible: C15 or C30. These are less likely to stretch and it can be frustrating looking for programs on very long tapes.
Once you have successfully recorded the program on the tape you can load it as you did with the demonstration programs.
One final point. When the Dutch started broadcasting software on medium wave, they received reports of near perfect recordings from Germany, Belgium. France, UK and Denmark. We hope that the Takeaway service will be as widely received as possible, inside and outside the UK.
Writing BASICODE-2 programs
Having run some programs in BASICODE-2 you might like to write some programs. These will then run on any micro using the translation program. Because of the different BASIC dialects, you will need to write the programs according to a set of rules. BASICODE-2 ensures that certain operations (like clearing the screen or moving the cursor) will always work, no matter what make of computer you use. Details of how this is achieved can be found in Chapter Three. The programming rules for your particular micro can be found in the relevant chapter. Some micros have smaller memories than others, so you may find that very large programs don't run on all the machines.

Chapter Three

BASICODE- THE SPECIFICATIONS 

Tone Modulation
Two tones are used to record data onto cassette tape, the frequencies are 1200 and 2400 Hz. 
A  "0" is defined as one full cycle of 1200 Hz.

A  "1" is defined as two full cycles of 2400 Hz.

Sequence code
The speed of BASICODE is 1200 Baud. A byte comprises the following sequence:
1	startbit (logic 0)
8 databits (the least significant first)
2	stopbits (logic 1)

For example: 

BASIC information
The BASIC program is coded either in the form in which it has been typed in, or as it is displayed on the screen when the command LIST is given. In most cases, however, this is not the form in which it is retained in the computer's memory.
All letters and ciphers are presented in American Standard Code for Information Interchange (ASCII), and each BASIC line is closed with CR (Hex 8D). Each ASCII byte in the program receives an eighth bit  1.

The tone sequence
The cassette tape recording of a BASICODE program will consist of
	Leader: 5 seconds of stopbit( =2400 Hz) 		ASCII Start Text (Hex 82)				BASIC Information in ASCII 			Checksum					Trailer: 5 seconds of stopbit(= 2400 Hz) 

Checksum
A note about the checksum. This is a simple code used to check that the program has been read from the tape successfully. If an error is indicated by the checksum then BASICODE-2 will tell you and you should list the program and correct the error. Then you can SAVE the program in the usual way
Technical note: the checksum is a number stored as an 8 bit computer word. It is calculated by performing an exclusive - or on all the previous bytes in the block. Unlike all the other transmitted ASCII characters, the checksum's eighth bit is not set to "1" but may be "1" or "0".

The improved BASICODE-2
The idea of the first BASICODE was to be able to transmit machine-readable programs over the air. For the most part this worked extremely well. A program from microcomputer X could be read by computer Y, simply by using the BASICODE translation code tape in between. The regular transmission of BASICODE programs since 1979 by the Dutch domestic service (NOS) showed that BASICODE was extremely reliable, often better than the computer's own cassette interface standard. Radio amateurs in the Netherlands soon obtained permission from the Dutch PTT to experiment with computer data transfer using BASICODE. and excellent results have been reported using VHF links.
However, the regular broadcasts also highlighted some of the limitations of the original BASICODE. mostly as a result of the various BASIC dialects. The rules of the original protocol did not work in all cases.
So, based on experience, improvements were made to the standard to create BASICODE-2. The working of various BASIC instructions was examined in the various dialects. In doing so, many differences were discovered. However, there was common ground amongst the computers taking part in the BASICODE working group.
All computers worked in Microsoft-BASIC, or had the possibility of doing so. A subset of standard BASIC instructions has now been drawn up, which has the same meaning in all the various BASIC dialects. These are dealt with in more detail in the next chapter. There are also a number of very important functions which are brought into action using different commands on different computers. These include the clearing of the screen and the commands to a printer.
The solution in this case is in the form of subroutines on agreed fixed BASIC line numbers. The subroutines are of course different for each brand of computer, but they all work in much the same way. The subroutines are called when a particular function is required.
This means a new discipline in programming and the adjustment of existing programs to meet the new standard. However, the effort appears to be worth the trouble, since BASICODE-2 programs now work on many brands of computer without having to be adjusted by the user before they will run.
The subroutines are contained in the BASICODE-2 translation programs on Side 1 as part of the loading sequence and therefore do not have to be part of BASICODE-2 programs you exchange with other users. The cassette with this handbook contains the translation programs you will need. In most cases it is possible to choose whether or not the subroutines are read or recorded with the main BASICODE program.
BASICODE-2 is now the fruit of some years of experiments and is a practical medium of data transfer. It is a simple solution in cases where programs have to be distributed to a number of computer brands.

Chapter Four

NOS BASICODE-2 PROTOCOL

We have already explained the Esperanto concept of NOS-BASICODE, and the idea of writing one program that can be of use to a number of different computers. What follows now is a detailed description of the standard, designed for programmers who wish to use BASICODE-2.

1.	BASICODE 2: The ground rules
There are four basic rules in the BASICODE-2 protocol:
a.	We only use BASIC statements that are understood by all brands of computers. A list of these can be found in section 5 of this chapter.
b.	Since rule a. leads to a lot of practical problems, such as the inability to clear the screen in a standard way, line numbers below 1000 are reserved for subroutines. These perform the extra functions needed in most programs that cannot be achieved using the standard BASIC statements.
The precise function of these subroutines is described in section 3. GOSUB 100, for example, is used to clear the screen, GOSUB 110 puts the cursor at a specific point on the screen, and so on. These routines are of course specific to each computer brand and therefore they are not part of the main program in BASICODE-2 standard. They are therefore included in the translation programs for each brand of computer. When combined with the BASICODE-2 data, the whole program is then complete.
c.	We have to standardise the video display screen as consisting of 24 lines, each of 40 characters. If you are programming in BASICODE-2 then it is important that you bear the screen size in mind! Unfortunately the rule is not quite as simple as this. There are computers in the group with only 16 lines on the screen (e.g. TRS-60) and some that can only accommodate 22 characters per line (e.g. VIC-20). So unless it is really necessary, do not use more than 16 lines on the screen, and do not make lines longer than need
be. Better still, use a subroutine which adjusts the lines to the size of the screen. This is possible using BASICODE-2.
d.	A line should not be longer than 60 characters including the spaces and the line number.

2.	The program construction
The following line number scheme is used to build up a BASICODE-2 program:
0 - 999: Standard routines (see section 3). These routines are different for each computer and are therefore contained in the translation program.
1000: first line of the BASICODE-2 program. It must be in the following form: 1000 A=(value): GOTO 20: REM program name, (value) is the maximum number of characters that can be used by all strings together. Line 20 is used to reserve memory space for the strings in those computers which need it.
1010-32767: the main program. There are no restrictions on this section, except that line numbers above 32767 are forbidden.
Although it is not compulsory, it is a good idea to build up your BASICODE-2 program systematically. Other users can then quickly understand your method of working, and it is then easier to adapt if necessary. We suggest that you use the following scheme:
1000 - 19999: the main program.
20000 - 24999: subroutines which you need for your program, but which contain statements which are not allowed in BASICODE-2.
25000 - 29999: lines with DATA statements.
30000 - 32767: lines with REM statements. You can use this space for any background details about the program, references or your name and address.
It is worth noting at this point the use of the subroutine lines 20000-24999. Try to avoid the use of statements that are not allowed in BASICODE-2. In some cases, of course, this is unavoidable, for example, the storage of variables on tape or disk. This is when you use the lines 20000-24999. It is extremely important that you indicate exactly what these routines are intended to do, or other brand users will not be able to follow your logic. It is also good practice to use line numbers in steps of 10, thus leaving plenty of room to insert lines at a later stage.

3. Operation of the BASICODE-2 standard routines
These are written specifically for each computer brand and form part of the translation program. They look different in the various BASIC dialects but in fact they do exactly the same in each case.

GOSUB 100:
This subroutine is used to clear the screen and set the cursor at position 0,0 (i.e. the top left-hand corner of the screen.)

GOSUB 110:
This places the cursor at a specific point on the screen. The exact point can be chosen by specifying the variables HO and VE. HO is the position on a line (0 is the furthest position to the left), and VE is the number of the line. The top line on the screen is considered to be number 0. Remember that in BASICODE-2, the maximum screen size is 24 lines, each of 40 characters. For this reason HO must not be larger than 39, and VE cannot be greater than 23. The variables HO & VE are not changed in value on calling the subroutine.

GOSUB 120:
This gives the position of the cursor on the screen and sets the variables HO and VE. HO=0 is the first position on any line, and VE=0 implies the top line on the screen. By using this subroutine, and GOSUB 110, you can move the cursor about the screen.
GOSUB 200:
This checks if a key has been depressed, and if so, puts the character in the variable IN$. If no key was pressed then IN$ is an empty string. In principle it is possible to put any character on the keyboard into IN$, including control characters. But be careful. Not all control characters have the same function on different brands of computers. So it is best to avoid control characters. The RETURN (or ENTER, NEWLINE, etc) key, though, does have ASCII code 13 on all computers.

GOSUB 210:
This subroutine waits until a key has been depressed and then sets the character in the variable IN$. It differs from GOSUB 200 in that this subroutine waits until a key has been pressed, whilst GOSUB 200 only checks whether a key has been depressed.

GOSUB 250:
This is used to activate the beep on most computers with this facility. Note that the pitch and length of the tone is not specified in this routine, and therefore it is not suitable for making music.

GOSUB 260:
This gives a random number in the variable RV. The number is always smaller than 1 and larger than, or equal to, 0. It is a useful routine in statistical programs or in games.

GOSUB 270:
This tidies up the variable space and reports how much memory space is still available. The variables are not erased!! The number of free bytes over is placed in the variable FR.

GOSUB 300:
This creates a string SR$ using the value of the variable SR. This string has no spaces at either the beginning or the end of the number, in contrast to the BASIC statement STR$( ). In some BASIC dialects it does contain spaces, so the statement STR$( ) is thus forbidden in BASICODE-2.

GOSUB 310:
This routine creates a string SR$ which is determined by the variables CT, CN, and SR. SR$ is equivalent in value to the variable SR and is always in fixed-point notation. The total length of SR$ is thus CT characters, of which CN characters come after the decimal point. If the number does not fit into the given form, then SR$ will consist of CT asterisks. If necessary, SR will be rounded off. The variables CT, CN, and SR are not changed by calling this routine. Here are a few examples:
CT=7: CN=3: SR=2/3: GOSUB 310 gives SR$ as "0.667" 
CT=8: CN=5: SR= -1.1E-3: GOSUB 310 gives SR$ as "0.00110" 
CT=3: CN=0: SR =23.6: GOSUB 310 gives SR$ as "24" 
CT=3: CN=1: SR=100: GOSUB 310 gives SR$ as "***"
GOSUB 350:
Prints SR$ on the printer, but does not close that particular line. Thus you can print more than once per line using this particular subroutine. But remember that not all users have a printer and so try to include a choice in your program between using the printer or the screen display.

GOSUB 360:
Closes the line on the printer and begins with a new line. 

4. Variables
There are a few restrictions governing the use of variables in BASICODE-2 programming. This is necessary to make the exchange between different brands as simple as possible.
a.	Numeric variables are real and single precision. Do not count on precision greater than 6 places of decimal.
b.	Names for variables should be a maximum of two characters long. The first character must be a letter, the second character (if used) can be either a letter or a number. The names of the variables should be written using BLOCK CAPITALS. Small letters are not allowed. In the case of string variables, the name is always followed by a $. All other characters, such as !, #, or % are forbidden.
c.	Logic variables are those which are "true" or "false". You are not allowed to use the numerical value of the logic variables. This is because in some cases the "true' is interpreted as +1, in other computers as -1. The result can only be used in an IF...THEN construction (i.e. A=3* (B=1) is not allowed).
d.	Before a variable is used, it must be given a value. Do not assume that a variable is automatically given a zero value at the start of the program.
e.	The maximum string variable length is 255 characters.
f.	Names of variables may not begin with the letter O. These are reserved for use within the BASICODE-2 standard routines.
g.	The following variables are excluded: AS; AT; FN; GR; IF; PI; ST; Tl; Tl$; TO.
h.	For communication with the BASICODE-2 subroutines use is made of the following variables: HO; VE; FR; SR; CN; CT; RV; INS; SR$.

5. BASIC statements and operators
	ABS	INPUT	RESTORE	   
	AND	INT	RETURN	   
	ASC	LEFT$	RIGHT$	   
	ATN	LEN	RUN	   
	CHR$	LET	SGN	   
	COS	LOG	SIN	   
	DATA	MID$	SQR	   
	DIM	NEXT	STEP	   
	END	NOT	STOP	   
	EXP	ON	TAB	   
	FOR	OR	TAN	   
	GOSUB	PRINT	THEN	   
	GOTO	READ	TO	   
	IF	REM	VAL	   

	+   	^	<>
	-	=	<=	   
	*	<	>=		
	/	>		 

Above we have listed the BASIC commands and operators, most of which can be used without any problems in BASICODE-2 programs. We have no intention at this point to examine in full each of the commands and operators. Many books have already been written on the subject. However we have decided to give a short summary since there are a few restrictions on certain BASIC commands in BASICODE-2.

BASIC commands and their meaning

ABS	Gives the absolute value of the stated variable. For example:
A=10 :B=ABS(A) 	B is now =10
A=-20 :B=ABS(A) 	B is now =20 
A=-1 :B=ABS(A-5)     	B is now =-6
AND	Logic AND, can only be used for logic variables. The result is a logical result. 	Use brackets to show clearly the order in which the work is to be done. 	Examples:
IF(A = 5) AND (B=0) THEN.... 
Q=(A-5) AND (B = 0): IF Q THEN..
ASC	This gives the ASCII value of the first character of the given string. Examples:
A$="A" :B=ASC(A$)		B is now 65
A$="BEER" :B=ASC(AS)     	B is now 66
ATN	Gives the arctangent in radians of the given variable. For
example:
PRINT ATN(1)      	0.735398 
PRINT ATN(-1) 		-0.785398
CHR$	This gives a character with the same ASCII value as the given variable. The 	variable can be anywhere between 32 up to and including 127. Be very  	careful with values less than 32, since control characters on different brands 	of computers vary. Only the RETURN key always has the same value, ASCII  	code 13. In addition not all computers recognise lower case letters. So be 	careful with ASCII codes larger than 96. For example:
AS=CHR$(66)     	AS now contains the letter B
COS	This gives the cosine of the given angle in radians. For example:
PRINT COS(1) 		.540302
DATA	After this term will follow numbers and/or strings until the end of the line, 	which can be read using READ. On a DATA line there should be no other 	statements, such as REM.
	The elements should be separated by a comma. String variables must be 	placed between quotation marks. For example:
	DATA 100, 200, "HELLO", "BASICODE", 4.6, 89
DIM	This statement is used to dimension arrays. An array can only be 	dimensioned once in a program, and before it is used. The maximum number 	of dimensions is two, whilst the maximum number of elements is limited by 	the size of the memory. One DIM statement can be used for more than one 	array. But there are two points to note:
	1. In some computers arrays up to 10 elements do not have to be 	dimensioned. In BASICODE-2 programs, an array mustatonays be 	dimensioned.
	2. The element with number 0 is also allowed, so A(0) and AD$(0,0) do exist. 	For example:
	DIM A$(12), HD(100, 100), MP(1000)
END	Used to indicate the end of a program. Do not just let a program stop. Always 	finish with an END statement.
EXP	Raises the number e (=2.71828..) to a specified power. For example:
	PRINT EXP(2) 		7.38906
FOR..TO..STEP..NEXT.. Program loop construction. The loop will be used at least once. 	STEP can be left out, in which case the step is automatically 1. NEXT must 	only be followed by a single variable. For example:
	FOR X=10 TO 100 
	Program in loop 
	NEXT X
	FOR C=A TO B STEP -3 
	Program in loop 
	NEXT C
	FOR I=1 TO 10 :FOR J = 1 TO 5 
	Program in loop 
	NEXT J:
	NEXT I
	Note: don't jump out of a FOR-NEXT loop before it has ended. A way to end 	the loop is by raising the variable to exceed the end point.

GOSUB	Used to call a subroutine and indicated by the line number following the 	statement. For example:
	GOSUB 100.
	Note, though, that A = 100:GOSUB A is not allowed.
GOTO	Indicates a jump to a given line number. For example: GOTO 1500
	Note, though, that A = 1500:GOTO A is not allowed.
IF..THEN	Conditional split, for between IF and THEN will be logical variables or logical 	comparisons. If the logic is "true" then the process continues through to 	statements after THEN. If not, then the computer simply moves to the next 	line. A line number may be given after THEN, from which the program should 	continue. Note that ELSE is forbidden in BASICODE-2. For example:
	IFA=3 THEN B=0:C=5
	IF A> 3 THEN 1500
	C=(A>3):IF C THEN GOSUB 100
	Note:
	Use IF..THEN 2000 and not: IF..GOTO 2000.
	Use IF..THEN GOSUB 2000 and not: IF..GOSUB 2000.
INPUT	Asks the user to input either a number or a string variable. A string may not 	consist of either commas or colons. If commas or colons are needed, then it 	is better to make use of subroutine 210. A prompt string is not allowed, and 	neither is more than one variable after an INPUT. Most BASICS print a 	question mark on the screen to show that input is required. In some 	computers, when the RETURN key is pressed, the line from the last cursor 	point to the end of the line is erased. Examples:
	PRINT "WHAT'S YOUR NAME":INPUT NS PRINT "KEY VALUE IN": INPUT 	A: INPUT B
	But note!!
	INPUT "YOUR NAME"; AS is forbidden.
INT	Gives the largest whole number (integer) less than or equal to the given 	variable. For example:
	A=2.1: B=INT(A)   	B is now 2
	B=INT(-1.5)		B is now -2

LEFTS	Used to select a number of characters from a given string 	starting with 	the character farthest to the left. You may select a minimum of 1 character up 	to the maximum number of characters in the string. For example:
	A$ = LEFT$("BASICODE",5) A$ now consists of "BASIC".
	But note that C$=LEFT$ ("BASICODE", 0) is not allowed.

LEN	Reports the length of a given string. For example:
	A$="BASICODE": A=LEN(A$) 	A is thus 8
	A$="": A=LEN(A$)		A is thus 0
LET	The variable name left of the equal sign is assigned the value of the string or 	expression to the right of the equal sign. It is not really necessary, since LET 	A = 5 is the same as A=5.
LOG	Calculates the natural log of the given variable or expression. For example:
	PRINT LOG(1) 			0
	PRINT LOG(10) 			2.302585
MID$	Takes a number of characters from a string. MID$(A$,X,Y) gives Y characters	 from A$, beginning with the Xth character. Note that the first character is 	number 1, so X 0 or Y 0 is forbidden. For example:
	A$= "THIS IS BASICODE"
	B$-MID$(AS,9,8)
	B$ now consists of "BASICODE"
NEXT	Closing statement for a program loop (see FOR). A NEXT statement must 	always be followed by a variable. Examples are given under FOR.
NOT	Logic negation, only usable on logic variables (see also AND). For example:
	A=5:B=NOT(A=6)     		B is "true"	
	A=(5=5):B = NOT A     		B is "false"
ON..GOSUB...
ON..GOTO..     Makes a jump to either a subroutine or a program line. After ON follows an 	expression or variable. After GOSUB or GOTO follows a series of line 	numbers. The expression or variable should be a whole number and 	determines which line number is to be chosen. You can think of the line 	numbers as having numbers: if the variable is 1 then the first line number is 	chosen, if the variable is 2 then the second line number is chosen, etc. But 	the variable cannot be greater than the number of line numbers given. For 	example:
	ON K GOTO 1100, 3400, 1500 		K has to be 1, 2, or 3 
	ON (K=5)GOSUB 600, 700, 300 		K has to be 6, 7, or 8
OR	Logic OR can only be used with logic variables (see AND). For example:
	IF A=5 OR B<3 THEN...
	C=(A-5) OR (B<3) :IF C THEN...
PRINT	Prints a variable or a string on the screen beginning at the present cursor 	position. More than one variable in a PRINT statement must be separated by 	semi-colons. If it is not desired that the computer should automatically 	continue with the next line then the end of the instruction must be finished off 	with a semi-colon. Some computers print one or more spaces before and/or 	after the number(s) being printed. If you do not want this, then use subroutine 	300 or 310. For example:
	A =5: A$-"HELLO": PRINT A;A$ 				5HELLO
	PRINT "HELLO": PRINT "THERE" 			HELLO THERE
	CN=3:CT=5:SR=5:GOSUB 310:PRINT"FIVE=":SRS 	FIVE=5.000

READ	Reads the elements after the DATA statements and gives them to variable(s) 	which follow the READ statement. More than one variable after a READ 	statement should be separated by commas. After the RUN command, the 	computer will read the DATA starting with the lowest line number. All data on 	that line will be read before continuing with any other DATA lines. But note: A 	numeric variable must read only numbers, a string variable can only read 	strings. For example:
	DATA 1,"COMPUTER",3 
	READ A,A$:READ B  or 
	READ A:READ A$:READ B or 
	READ A,A$,B

REM	This is used for adding REMarks in the program to help other users 	understand what you are doing. Anything after a REM statement until the end 	of the line is ignored in BASIC by the computer. But do not use a colon after 	the REM statement as this gives problems with some computers.
RESTORE 	This statement resets READ-ing from the first DATA statement in the 	program. But note that you may not give a line number after a RESTORE 	statement.
RETURN	Is used to indicate the end of a subroutine. The computer then jumps back to 	the line after the respective GOSUB statement that started the subroutine 	sequence. A subroutine should always be closed with a RETURN statement.
RIGHTS	Gives a number of characters of a given string, ending with the last character. 	The minimum number that can be asked is 1, the maximum being the length 	of the string. For example:
	A$="BASICODE": B$=RIGHT$(A$,4) B$ now consists of "CODE".
	But note that A$="PROTOCOL": A=0:B$=RIGHT$(A$,A) is not allowed 	because A = 0.
RUN	Starts the program afresh, while all variables are erased. Note that a line 	number after RUN is not allowed. For example:
	IF (A$="J") OR (A$="j") THEN RUN 
	Note that RUN 100 is forbidden.
SIN	Gives the sine of a variable which should be given in radians.
	See COS for further details.
SGN	Is used to give the sign of a variable, i.e. -1 if the variable iS negative, 0 if the 	variable is zero, and +1 if the variable is positive. For example:
A=5:B=SGN(A)        	B is now 1 
A=-.001: B=SGN(A)   	B is now -1
SQR	Calculates the square root of a variable or expression, which cannot be 	negative. For example:
A=SQR(2*50)	A is now 10

STEP	Sets the step size in a loop. See FOR.
STOP	Stops the program, but retains the possibility of going further, keeping the 	same variables.
TAB	Is used in PRINT statements to move the cursor to a specific point on the 	screen. You can only use TAB to move the cursor further on a line, and 	depending on the computer, either spaces will be printed or whatever is on 	the line will be kept. Note that TAB(O) is not allowed. Although most 	computers start counting from 0, there are those that start at 1. So for this 	reason it is better to use subroutine 110. For example:
PRINT"A"; TAB(5); "B"; TAB(10); "C" gives: 	
A   B   C on some computers and  A B C   on others.
TAN	Calculates the tangent of a given angle in radians. See COS.
THEN	See IF.
TO	See FOR.
VAL	Gives the numeric VALue of a string. But if the string is not purely numeric, 	the result is not the same on all computers. For example:			
	A$ = "1.4E6": A=VAL(A$) 		A is now- 1.4E6				A$-"12D": A=VAL(A$) 			A is now undetermined, A=12 or
						A=0 being possible.

Summary
Now follows a short summary of the operators allowed in BASICODE-2.
+	In the case of numbers of variables this operator adds two numbers or 	variables together. In the case of strings, two are coupled to each other. For 	example:
B = 1:A = B+9			A is now =10
A$="BAS": B$="ICO": C$="DE": D$-A$+B$+C$   	D$ therefore is "BASICODE".

-		Subtracts two numbers or variables from each other. For example:
		A=10-3-4		A is now  =3

*		Multiplies two numbers or variables together. For example:
		A=5:B=3*2*A		B is now =30

/	Divides two numbers or variables. For example:
	A=5: B=100/A/2		B is now  =10

^	Raises a number or variable to a specified power. For example:
	A=2:B=16:C=A ^ B      	C is now =65536
=	Logic operator: indicates equality between the two expressions on either side 	of it. See also AND.    Or: the variable name to the left of the equal sign is 	assigned the value of the string or expression to the right of the equal sign. 	Examples:
	A=(5=6)			A is "false"
	A=4*6			A is now =24
	A$="HELLO"		A$ now contains "HELLO"
<	Compares two numbers or expressions and checks whether the one to the 	left of the operator is less in value than the one to the right. The result is 	therefore a logic variable. If strings are being compared, then the string to the 	left of the operator is checked to see if it comes earlier in alpha-numeric order 	than the string to the right. You can use this operator for alphabetical sorting. 	For example:
	A=5: B=(A< 7)				B is "true"
	A$="HO": B$="HA": A=(A$<B$) 		A is thus "false"
>	Identical to < except that the test is now "greater than" or "later" in alpha-	numeric order.

<>	Checks to see whether two variables or expressions are "un-equal". The 	result is a logical value. For example:
	A=(6<>7)				A is "true"
	AS="HO": B$="H": A=(A$<>B$) 		A is therefore "true''
	IF A<> 5 THEN....

<=	Less than or equal to. For the function of this operator see <, but substitute 	"less than or equal to" in place of "less than".
>=	Greater than or equal to. For the function of this operator see > , but 	substitute "greater than or equal to" in place of "greater than".
Note: When using the last three operators the order of the two characters is important. For example: A= >5 is wrong.
We trust the BASICODE-2 protocol is explained clearly enough, and we look forward to your program contributions. For details of how to contribute, see Chapter One.
Jochem Herrmann

###########################################################################
Here follow page 26 -(?) with descriptions of translation programs for a number of machines

Chapter Five

APPLE  II & IIe
p26, 27,28?

Chapter Six 

BBC micro (models A & B)
p29,30 ?

??

LIST OF PROGRAMS

Program 1 
---------------------------------
1.  APPLE II & IIe 
2.  BBC MODELS A OR B LOAD 
3.  BBC MODELS A OR B SAVE 
4.  COLOUR GENIE 
5.  COMMODORE 3000, 4000, & 8000 
6.  COMMODORE 64 
7.  PET 2001 
8.  VIC 20 LOAD 
9.  VIC 20 SAVE 
10. SHARP MZ80A 
11. SHARP MZ80K 
12. SINCLAIR ZX-81 
13. TRS-80 / VIDEOGENIE 

Program 2 
---------------------------------
1.  WELCOME 
2.  WORDGAME 
3.  FACTORS 
4.  TANK SHOOTING 
5.  CHORDS 
6.  YAHTZEE 
7.  WORDSEARCH 
8.  CONQUER KONG 
9.  MULTIVIBRATOR 
10. DIGITAL CLOCK 
11. MEZIRAC SQUARES 
12. DUCK HUNTING 
13. EXACT MASS 
14. BELGIAN GAME 
15. RADIOACTIVE DECAY 
16. CAR RACE 
17. TITRATIONS 
18. CHRISTIAN HOLIDAYS 

Presentation Trevor Taylor & Jonathan Marks