RTR logo

R. T. RUSSELL

BBC BASIC (86) Manual



Resident Star Commands

*BYE

Return to the calling program (usually the MS-DOS (PC DOS) operating system or Microsoft WindowsTM).

*CHDIR

*CD

Change the current working directory to a different path. The syntax is similar to the MS-DOS CHDIR command. The notes below are a brief summary of the command. You should refer to your MS-DOS (PC DOS) User's Guide for an explanation of directory paths, etc.

*CHDIR [d:][\][pth]
*CD [d:][\][pth]
The *CD command followed by a drive name (optional) and a path will change the current directory of the specified (or current) drive to the path specified.
*CHDIR BBCBASIC\DOC
*CD A:\LETTERS\RATES
The *CD command followed only by a backslash will change the current working directory on the specified drive to the root directory for that drive. This is a quick way of getting to the top level directory on a drive.
*CHDIR \
*CD A:\
*CD on its own will display the current working directory.

*CD followed by a drive name (only) will display the current working directory of that drive.

*DELETE

*DEL

Delete the specified disk file. The syntax is similar to the MS-DOS (PC DOS) DEL command except that the extension defaults to .BBC if it is omitted.

*DEL ufsp

*DEL GAME1.DTA
This command will delete only one file at a time; wild cards are not permitted in the file specifier. If you wish to include wild-cards in the file specifier in order to delete more than one file, you should use the **DEL command.

OSCLI may also be used to delete files.

OSCLI "DEL "+<str>

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

*DIR

*.

List the disk directory. The syntax is similar to the MS-DOS (PC DOS) DIR command except that the extension defaults to .BBC if it is omitted.
*DIR [afsp]
*DIRList all .BBC files on the disk.
*DIR B:*.* List all files on disk B.
*.*.*List all the files in the current directory.

*DRIVE

*DR.

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

*DRIVE A:

*EDIT

*E.

Enter the screen editor with the argument as the first line displayed on the screen.
*EDIT line_number

*EDIT 120
This command will clear the screen, display the program on the screen starting with the specified line and enter the screen editing mode. Pressing the <Esc> key will exit the screen editing mode, clear the screen and return you to your original display mode.

Whilst in the screen editing mode, the control keys have the following effect:

 Screen Editing Keys
Up Move up to the previous screen line
Down Move down to the following screen line
Left Move the cursor left one character
Right Move the cursor right one character
Ctrl/Left Move the cursor to the start of the program line
Ctrl/Right Move the cursor to the end of the program line
Enter Move the cursor to the start of the next program line
BackSpace   Backspace and delete
Delete Delete the character at the cursor
Insert Toggle between the insert and overwrite modes. In the
insert mode the cursor is an underline; in the overwrite
mode it fills the character cell
Tab Insert a line immediately following the current line
Ctrl/U Clear the current line. The line number is not deleted
Ctrl/Enter Delete the entire line including the line number
PageUp Display the previous 12 program lines and move the
cursor to the start of the first line displayed
PageDn Display the next 12 lines and move the cursor to the
start of the first line displayed
Home Move the cursor to the start of the program
End Move the cursor to the end of the program
Esc Exit the screen editing mode
If you are at the top of the screen, pressing the cursor up key will cause the display to scroll back one line. The cursor will remain at the top of the screen on this newly displayed line. Similarly, if you are at the bottom of the screen, pressing the cursor down key will cause the display to scroll forward one line.

Editing takes place as you type; there is no opportunity to abort the edit as there is with the single line editor. The <Esc> key ends the edit; it does not abort it. Any changes you have made will remain. Also, unlike the single line editor, it is not possible to edit the line numbers. Consequently, the line editor may be more useful for making changes to individual program lines. See the keyword EDIT for more details.

*EGA

Map modes 0 to 7 on to modes 8 to 15.
*EGA [ON|OFF]
If an EGA or VGA is fitted, the *EGA command will automatically map modes 0 to 7 to the equivalent EGA modes 0 to 15.

Normal operation may be restored with the command

*EGA OFF
Graphics operations in the EGA modes are significantly slower than in the CGA modes. If you don't need the extra EGA capabilities (16 colours, for example) you are recommended to use the CGA modes.

*ERASE

*ERA

This command is synonymous with *DEL.

*ESC

Disable and enable the abort action of the ESCape key.
*ESC [ON|OFF]
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 ufsp

*EXEC STARTUP.CMD

*FX

With the exception of *FX 15, all the *FX commands are trapped and ignored. You can locate the lines containing *FX commands by using LIST IF *FX. See the keyword LIST IF in the Statements and Functions section for more details.

*FX 15 flushes the keyboard buffer.

*FX 15

*HELP

Display the name and version number of BBCBASIC(86).
*HELP
If anything is entered following the '*HELP' the command is passed to the operating system for execution. This provides access to an online HELP utility, for example that supplied with later versions of MS-DOS.
*HELP COPY

*KEY

Redefine a function or cursor key to return the specified string.
*KEY num [str]
The key number 'num' is from 0 to 23 as follows:
NoKey NoKey
0Ctrl/2 12Left
1f1 13Right
2f2 14Down
3f3 15Up
4f4 16Ctrl/Left
5f5 17Ctrl/Right
6f6 18Home
7f7 19End
8f8 20PgUp
9f9 21PgDn
10f10 22Ins
11   Shift/Tab    23   Del
The string may contain the 'escape' symbol '|' in order to include non-printing characters. For example, |M indicates CR (carriage-return), |? indicates DEL, || indicates the escape character itself and |! causes bit 7 of the following character to be set. If the string is enclosed in quotes (which is optional), |" allows the character " to be included in the string.

If there is insufficient room for the string, a 'Bad string' error will occur and the key will be loaded with as much of the string as would fit.

*KEY num without a string will empty the specified key and return it to its normal code (see the BBCBASIC(86) keyword GET.)

*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
If the load address is given as more than four hexadecimal digits, the four least significant digits are interpreted as the offset value and the remaining digits as the segment value. For example,
*LOAD SCREEN B8000000
will load a file called SCREEN.BBC into the CGA graphics screen RAM. This will not work for the EGA or VGA modes.

Remember that the command *LOAD 00001234 loads into a different memory from the command *LOAD 1234. The latter loads into BBCBASIC(86)'s data segment.

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)

*LOCK

Set the specified file to 'read-only' status. If the extension is omitted, .BBC is assumed.
*LOCK ufsp

*LOCK WOMBAT

*MKDIR

*MD

Create a new directory with the given name. The syntax is similar to the MS-DOS (PC DOS) MKDIR command. You should refer to your MS-DOS (PC DOS) User's Guide for a full explanation.
*MKDIR [d:][\][pth]

*MD [d:][\][pth]

*MKDIR \BBCBASIC\TRIALS

*MD D:DATA

*OPT

*O.

Select the destination 'output stream' for console output. The default is OPT 0.
*OPT 0 VDU Emulator. The output is sent to the VDU Emulator. Control characters are filtered and action taken as described in the VDU Emulator section.
*OPT 1 Auxiliary Output. The output is sent to the auxiliary output (COM 1).
*OPT 2 Printer Output. The output is sent to the printer (PRN or LPT 1).
*OPT 3 Standard Output. The output is sent to the currently selected 'standard output'. This is usually the screen, but it may be redirected. See your MS-DOS (PC DOS) User's guide for further details on output redirection.
*OPT 4 Error Output. The output is sent to the 'error output'.
All characters sent to the console are vectored with *OPT. There is no filtering of graphics commands etc. For example, COLOUR 3 in a program will cause the bytes 17 and 3 to be sent to the device selected by *OPT.
10 *OPT 2
20 PRINT "THIS WILL APPEAR ON THE PRINTER"
30 *OPT 0
40 PRINT "THIS WILL APPEAR ON THE SCREEN"
Because MS-DOS (PC DOS) treats all input and output devices as if they were files, you can also send output to the standard MS-DOS (PC DOS) devices by using PRINT#. The standard devices are listed below along with their file handles (file or channel numbers). It's not good practice to send normal output to the screen in this way because BBCBASIC(86) cannot keep track of the cursor position (and hence POS, VPOS and COUNT). It is, however, a reasonable way to write to the printer or the auxiliary (serial) device. It is also useful to be able to send messages to the screen via, for example, STDERR whilst sending the console output to a printer with *OPT 2. Don't forget, however, that output is sent as if to a file. Strings are terminated with a CR only and you will need to write the LF to the device yourself. Numbers would normally be sent in internal format and they will need to be converted to ASCII strings first using the STR$ function. (See also the Opening Files sub-section of the BBCBASIC(86) Disk Files section.)
Handle  Device PurposeRemarks
0STDIN Standard InputCan't be accessed directly.
1STDOUT Standard Output 
2STDERR Standard Error 
3STDAUX   Serial device or modem 
4STDPRN Printer 

*QUIT

This command is synonymous with *BYE.

*RMDIR

*RD

Remove (delete) the directory with the given name. The syntax is similar to the MS-DOS (PC DOS) RMDIR command. You should refer to your MS-DOS (PC DOS) User's Guide for a full explanation.

*RMDIR [d:][\][pth]
*RD [d:][\][pth]

*RMDIR \BBCBASIC\TRIALS
*RD D:DATA
You can only remove an empty directory. If the directory contains any files you will get an 'Access denied' error (error code 189).

*RENAME

*REN

Rename a disk file. Both MS-DOS (PC DOS) and CP/M formats are accepted. The syntax is similar to the MS-DOS (PC DOS) or CP/M REN commands except that the extension defaults to .BBC if it is omitted. OSCLI can also be used to rename a file.

*RENAME ufspold ufspnew
*REN ufspold ufspnew
*RENAME ufspnew=ufspold
*REN ufspnew=ufspold
OSCLI "REN "+<str>+" "+<str>

*REN OLDFILE NEWFILE
*REN NEWFILE=OLDFILE

OSCLI "REN "+file_name$+".BBC "+filename$+".BAK
OSCLI "REN "file_name$+".BAK="+filename$+".BBC"
If an ambiguous filename is used, a 'Bad directory' error (error code 206) will occur. If a file already exists with the new name, a 'File exists' error (error code 196) will occur.

*RUN

*/

Execute the specified command file and return to BBCBASIC(86).

This command causes a .EXE or a .COM file to be loaded and run.

For this to work, BBCBASIC(86) must have access to COMMAND.COM and there must be sufficient RAM to load the required program whilst BBCBASIC(86) remains in memory.

*SAVE

*S.

Save an area of memory in BBCBASIC(86)'s data segment to a disk 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
If the save address is given as more than four hexadecimal digits, the four least significant digits are interpreted as the offset value and the remaining digits as the segment value. For example,
*SAVE SCREEN B8000000 +4000
will save the contents of the CGA graphics screen ram to a file called SCREEN.BBC. This will not work for EGA or VGA modes.

Remember that the command *SAVE 00001234 +200 saves a different area of memory from the command *SAVE 1234 +200. The latter saves from BBCBASIC(86)'s data segment.

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 ufsp
*SPOOL

*SPOOL LISTING

*SPOOLON

Copy all subsequent console output to the end of the specified file. If the file does not exist, the 'File not found' error will occur. If the extension is omitted, .BBC is assumed.
*SPOOLON ufsp

*SPOOLON LISTING
You can use this command to add text to the end of a previously used spool file.

*TV

The *TV command is trapped and ignored. You can locate the lines containing a *TV command by using LIST IF *TV. See the keyword LIST IF in the Statements and Functions section for more details.

*TYPE

*T.

Type the specified file on the VDU screen. This command is similar in action to the MS-DOS (PC DOS) TYPE command except that the extension .BBC is assumed if it is omitted.

*TYPE ufsp

*TYPE ADDRESS.LST

*UNLOCK

Set the specified file to 'read/write' status. If the extension is omitted, .BBC is assumed.
*UNLOCK ufsp

*UNLOCK ADDRESS.DTA

*|

This is a comment line. Anything following the '|' is ignored.


BBC Micro Star Commands

Apart from the resident star commands already described, most of the BBC Micro's star commands either have an MS-DOS counter part or they are irrelevant in the MS-DOS environment.

Apart from *TV, the following BBC Micro commands are not trapped by BBCBASIC(86) and, as previously described, they will be passed to MS-DOS for action. Since this is most probably not what is intended, you should ensure that these commands do not occur in programs which have been transferred from the BBC Micro.

You can locate any of these (or other) commands with the LIST IF statement. For example,

LIST IF *COPY
will list all the lines of a program which include the *COPY command.

Where applicable, the appropriate resident star or MS-DOS command is indicated alongside the BBC Micro's star command.

*ACCESS

Set file attributes.

Resident Star Command/MS-DOS Equivalent

*LOCK, *UNLOCK

ATTRIB            (Access with *ATTRIB)

*BACKUP

Copy an entire disk.

Resident Star Command/MS-DOS Equivalent

DISKCOPY          (Access with *DISKCOPY)

*BUILD

Create a file from the keyboard.

Resident Star Command/MS-DOS Equivalent

COPY CON <ufsp>   (Access with *COPY CON <ufsp>)
or word-processor/editor.

*CODE

Execute user's machine code.

Resident Star Command/MS-DOS Equivalent

Not applicable.

*COMPACT

Compact the contents of a disk.

Resident Star Command/MS-DOS Equivalent

DEFRAG            {Access with *DEFRAG)

*COPY

Copy a file.

Resident Star Command/MS-DOS Equivalent

COPY              (Access with *COPY)

*DESTROY

Delete files.

Resident Star Command/MS-DOS Equivalent

DEL               (Access with **DEL)

*DIR

Set (change) current directory.

Resident Star Command/MS-DOS Equivalent

*CHDIR

*DISK

Select the disk filing system.

Resident Star Command/MS-DOS Equivalent

Not applicable.

*DUMP

Display a file in HEX/ASCII format.

Resident Star Command/MS-DOS Equivalent

Use the DUMP utility supplied on the BBCBASIC(86) distribution disk (access with *DUMP).

*ENABLE

Enable subsequent operations.

Resident Star Command/MS-DOS Equivalent

Not applicable.

*INFO

Display information about files.

Resident Star Command/MS-DOS Equivalent

DIR               (Access with **DIR)

*KEYS

List the contents of the user defined keys.

Resident Star Command/MS-DOS Equivalent

Not applicable.

*LIB

Select current library.

Resident Star Command/MS-DOS Equivalent

PATH is similar .

*LINE

Execute user's machine code.

Resident Star Command/MS-DOS Equivalent

Not applicable.

*LIST

Display an ASCII file with line numbers.

Resident Star Command/MS-DOS Equivalent

Not applicable.

*MOTOR

Control the cassette recorder's motor.

Resident Star Command/MS-DOS Equivalent

Not applicable.

*ROM

Select a ROM.

Resident Star Command/MS-DOS Equivalent

Not applicable.

*TAPE

Select the cassette filing system.

Resident Star Command/MS-DOS Equivalent

Not applicable.

*TITLE

Assign a disk title.

Resident Star Command/MS-DOS Equivalent

LABEL             (Access with *LABEL)

*TV

Control the display interlace and vertical screen position. This command is trapped and ignored.

Resident Star Command/MS-DOS Equivalent

Not applicable.

*WIPE

Delete all files.

Resident Star Command/MS-DOS Equivalent

See DELETE

Left CONTENTS

CONTINUE Right


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