RTR logo


BBC BASIC (Z80) Manual


Before You Start

This is a reference manual, it is not intended to teach you BASIC. It gives a summary of the BBC BASIC commands and functions plus some hints and tips on their use. A general knowledge of BASIC has been assumed.

File handling with BBC BASIC (Z80) is different in approach to most other versions of BASIC. Because of this, BBC BASIC (Z80) file handling has been covered in some detail.

BBC BASIC (Z80) has been designed to be as compatible as possible with the 6502 BBC BASIC resident in the BBC Microcomputer. The language syntax is not always completely identical to that of the 6502 version, but in most cases the Z80 version is more tolerant.

System Requirements

BBC BASIC (Z80) requires a Z80 processor. It is assumed that all the Z80 registers are available for use; BBC BASIC will not run on a system which reserves the alternate registers (AF', BC', DE', HL') for the use of interrupts.

The CP/M version of BBC BASIC (Z80) requires CP/M-80 version 2.2 or later; about 15 Kbytes of code space and about 1 Kbyte of data space are used by the interpreter. The remainder of the TPA is available for the user's program, data (heap) and stack.


Few CP/M systems offer colour graphics and sound of the quality provided on the BBC Microcomputer, therefore the generic CP/M version of BBC BASIC (Z80) does not support these features. Versions of BBC BASIC specifically configured for the Amstrad CPC6128 Colour Computer, the Tatung Einstein and the Torch Second Processor are available which support graphics and sound to the extent that they are provided by the host machine.

Many CP/M systems do, however, support cursor addressing (TAB(X,Y)), clearing the screen (CLS), an elapsed-time clock (TIME) and the ability to read the keyboard with a maximum waiting time (INKEY). Because these features do not, in general, use a standardised software interface BBC BASIC (Z80) cannot come preconfigured to make use of them. Therefore the source code of a small patch program (BBCDIST.MAC) is supplied, which can be edited and assembled to make these facilities available. The patch resides at address 100H and must not exceed 256 bytes in length.

BBC BASIC (Z80) supports line-editing using the cursor-control and other keys on the keyboard. However the codes generated by these keys are not standardised. The last 12 bytes of the patch area (1F4H to 1FFH) contain the width of the screen (in characters) followed by the control codes corresponding to the editing keys. As supplied, these are set to the codes generated by an ADM3a terminal.

Running BBC BASIC (Z80)

In the following examples, the system prompts and responses are shown in normal type and your entries are shown in bold type. The examples also assume that BBC BASIC (Z80) has been installed on drive C:.

To run BBC BASIC (Z80), bring up CP/M and type

(<Enter> means 'press the Enter key')

The system will reply:

BBC BASIC (Z80) Version 3.00
(C) Copyright R.T.Russell 1987
To exit BBC BASIC (Z80) type



Best viewed with Any Browser Valid HTML 3.2!
© Doug Mounter and Richard Russell 2009