RTR logo


BBC BASIC (Z80) Manual

Operating System Interface


As with the BBC micro computer, the star (*) commands provide access to the operating system. Since the BBC operating system is completely different to CP/M-80 there are a number of differences in the star commands.

File Specifiers

File specifiers must comply with the standard CP/M-80 conventions.
drive: The single letter name (A to P) of the drive where the file will be found. The colon is mandatory. If the drive name is omitted, the currently logged-on drive is assumed.
filename The name of the file. The length of the name must not exceed 8 characters.
extension The optional extension of the file. If an extension is used it must be separated from the filename by a full-stop. If the extension is omitted, .BBC is assumed.
Drives A: to P: are accepted in file specifications. Filenames in star commands may optionally be enclosed in quotes; unmatched quotes will cause a 'Bad string' error. The standard CP/M-80 'wild-cards' may be used when an ambiguous file specifier is acceptable.
?         Allow any single character in this position. If this is used as the last character in the name, a null character will be accepted.
* Allow any character (including a null) from the position of the '*' to the end of the name or extension.


The following symbols and abbreviations are used as part of the explanation of the operating system commands.

{} The enclosed items may be repeated 0 or more times.
[] The items enclosed are optional, they may occur zero or one time.
num A numeric constant.
str A string constant.
<num>    A numeric variable.
<str> A string variable.
afsp An ambiguous file specifier.
ufsp An unambiguous file specifier.
d: A disk drive name.
dir A directory name.

Accessing Star Commands

The star commands may be accessed directly or via the OSCLI statement. The two examples below both access the BYE command.



A star command must be the last (or only) command on a program line and its argument may not be a variable. If you need to use one of these commands with a variable as the argument, use the OSCLI statement. Examples of the use of the OSCLI statement are given below in the Resident Star Commands sub-section.

Case Conversion

Star commands and their associated qualifiers are converted from lower-case to upper-case if necessary. For example, *era wombat is converted to *ERA WOMBAT. This is in keeping with the general CP/M-80 philosophy and the BBC Micro's machine operating system (MOS).

Special Characters

Control characters, lower-case characters, DEL and quotation marks may be incorporated in filenames by using the 'escape' character '|'.
|A  gives ^A.
|agives lower-case A.
|?gives Del.
|"gives the quote marks ".
||gives the escape character |.
|!sets bit 7 of the following character.



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