Chapter Six

BBC MICRO (MODELS A & B)




You will find two translation programs for the BBC Micro on the cassette. The first is the Load program and the second allows you to Save programs that you have written in BASICODE-2. Both the programs are written in assembly language for optimum efficiency and the code occupies the memory addresses directly below the screen memory. When running BASICODE-2, HIMEM should not be changed and the micro should always be in MODE 7.

It is not necessary to load both the Load program and the Save program into memory at the same time. Normally you will be using the Load program to translate programs you have recorded from Radio 4. Once the programs are translated, you can save them as BASIC programs in the normal way and load them again without using the BASICODE-2 Load program.

The Load program

Once the Load program is in memory, type RUN. The screen will then display a reminder of what to type in order to load a BASICODE-2 program.

Remember that before you load in a new BASICODE-2 program, type NEW. To load a program, set the tape at the beginning of the leader tone and type in CALL &7A00. As the program is being loaded it will be listed on the screen. If there is a problem during the loading you will get the message 'CHECKSUM ERROR'. LIST the program to find the error and correct it. If the program loads without problems, type RUN to set the program going.

When you want to load a new BASICODE-2 program, press the ESCAPE key, type NEW and then proceed as before.

Apart from the main translator, the Load program also contains the BASICODE-2 subroutines. The loading process puts the subroutines below screen memory, following the machine code. When a BASICODE-2 program is being loaded, the subroutines are copied to PAGE and then the BASICODE-2 program is copied from the tape to follow the subroutines. Once you have successfully recorded the BASICODE-2 programs off your radio and loaded them into your micro, you should SAVE them as ordinary BASIC programs.

The Save program

This translation program is provided in case you want to write your own programs and save them in the BASICODE-2 standard. If you have followed the BASICODE-2 programming guidelines given in Chapter Four then you will be able to transfer the programs to a variety of other microcomputers. So, to save your programs in the BASICODE-2 standard, LOAD the Save program into the micro and RUN it. This will compile the code and place it below screen memory. When the prompt appears on the screen, type NEW and LOAD your BASIC program. When the program has loaded, type CALL &7A03 if you want to save the program and the subroutines or CALL &7A00 if you just want to save the program on its own. Now set the cassette recorder to record the BASICODE-2 program and press RETURN. You will see five seconds of dots on the screen as the leader tone is being recorded, and there is a further five seconds of dots after the program has been transferred, when the trailer tone is recorded.

If there are any lines longer than 60 characters the Save program will mark them with a ':' in the 61st character. After the program has been saved, the number of lines marked is displayed on the screen.

Note: The BASICODE program is generated by converting the BBC BASIC keywords into ASCII code using the LIST command. The OSWORD vector is altered to pass the interpreter

L. 1000,

if only the BASIC program is to be saved or
L.

if the BASIC program and subroutines are to be saved. In changing the OSWRCH vector the program inspects characters as they are sent to the screen by the LIST command. The relevant characters are then also sent to the cassette port.