BBC BASIC logo

BBC BASIC (Z80) Manual



Resident Star Commands

(version 5.00 CP/M edition only, other versions may have similar commands, consult the relevant documentation)

*BYE

Return to CP/M.

*DIR

List the directory. The syntax is similar to the CP/M DIR command except that the extension defaults to .BBC if it is omitted.
*DIR [afsp]
*DIRList all .BBC files in the directory.
*DIR B:*.* List all files on drive B.
*.*.*List all the files in the current directory.

*DRIVE

Select the drive to be used as the default drive for subsequent file operations. The colon is a mandatory part of the drive name.
*DRIVE d:

*DRIVE A:

*ERA

Delete the specified file. The syntax is similar to the CP/M-80 ERA command except that the extension defaults to .BBC if it is omitted.
*ERA ufsp

*ERA GAME1.DTA
This command will delete only one file at a time; wild cards are not permitted in the file specifier.

OSCLI may also be used to delete files.

OSCLI "ERA "+<str>

OSCLI "ERA "+name$
OSCLI "ERA GAME1.DTA"

*ESC

Disable or enable the abort action of the ESCape key.
*ESC OFF
*ESC ON
After *ESC OFF the <Esc> key simply returns the ASCII code for ESCape (27). *ESC ON (or *ESC) restores the normal abort action of the <Esc> key.

*EXEC

Accept console input from the specified file instead of from the keyboard. If the extension is omitted, .BBC is assumed.
*EXEC STARTUP.CMD
OSCLI "EXEC """+cmdfile$+""""
Once the entire file has been read, keyboard input is restored.

*HELP

Display the name and version number of BBC BASIC.
*HELP
This results in the following message (or something like it) being displayed:
BBC BASIC (Z80) Version 5.00

*LOAD

Load the specified file into memory at hexadecimal address 'aaaa'. The load address MUST always be specified.
*LOAD ufsp aaaa

*LOAD A:WOMBAT 8F00
OSCLI may also be used to load a file. However, you must take care to provide the load address as a hexadecimal number in string format.
OSCLI "LOAD "+<str>+" "+STR$~<num>

OSCLI "LOAD "+file_name$+" "+STR$~(start_address)

*OPT

Select the destination 'output stream' for console output. The default is OPT 0.
*OPT 0 Console output. The output is sent to the screen.
*OPT 1 Auxiliary Output. The output is sent to the auxiliary output.
*OPT 2 Printer Output. The output is sent to the list device.
All characters sent to the console are vectored with *OPT.
10 *OPT 2
20 PRINT "THIS WILL APPEAR ON THE PRINTER"
30 *OPT 0
40 PRINT "THIS WILL APPEAR ON THE SCREEN"

*QUIT

This command is synonymous with *BYE and the QUIT statement.
*QUIT

*REN

Rename a file. The syntax is similar to the CP/M REN command except that the extension defaults to .BBC if it is omitted. OSCLI can also be used to rename a file.
*RENAME ufspnew=ufspold
*REN ufspnew=ufspold
OSCLI "REN "+<str>+"="+<str>

*REN NEWFILE=OLDFILE

OSCLI "REN "file_name$+".BAK="+filename$+".BBC"

*RESET

Reset the Filing System.

*SAVE

Save an area of memory to a file. If the extension is omitted, .BBC is assumed.

You MUST specify the start address (aaaa) and either the length of the area of memory (llll) or its end address+1 (bbbb). There is no 'load address' or 'execute address'.

*SAVE ufsp aaaa +llll
*SAVE ufsp aaaa bbbb

*SAVE "WOMBAT" 8F00 +80
*SAVE "WOMBAT" 8F00 8F80
OSCLI can also be used to save a file.
OSCLI "SAVE "+<str>+" "+STR$~(<num>)+" "+STR$(<num>)

OSCLI "SAVE "+ufn$+" "+STR$~(add)+"+"+STR$~(len)

*SPOOL

Copy all subsequent console output to the specified file. If the filename is omitted, any current spool file is closed and spooling is terminated. If the extension is omitted, .BBC is assumed.
*SPOOL LISTING.TXT
OSCLI "SPOOL """+file$+""""
*SPOOL

*TYPE

Type the specified file on the screen. This command is similar in action to the CP/M-80 TYPE command except that the extension .BBC is assumed if it is omitted.
*TYPE ufsp

*TYPE ADDRESS.LST

Left CONTENTS

CONTINUE Right


Best viewed with Any Browser Valid HTML 4.0!
© Doug Mounter and Richard Russell 2026