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.
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.
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.
To run BBC BASIC (Z80), bring up CP/M and type
(<Enter> means 'press the Enter key')C>BBCBASIC<Enter>
The system will reply:
To exit BBC BASIC (Z80) typeBBC BASIC (Z80) Version 3.00 (C) Copyright R.T.Russell 1987 >