next_inactive up previous


MSX-DOS version 2

(typed by ag0ny@ag0ny.com from Roderik Muit's ASCII originals)


ÌÜ14¡


1. Command specification

This chapter describes the user interface and commands provided by MSX-DOS 2 version 2.20.

1.1 Introduction

MSX-DOS 2, like its predecessor MSX-DOS 1, is provided in a cartridge and in some disk files. The disk files are MSXDOS2.SYS, COMMAND2.COM, help files and transient commands.

MSXDOS2.SYS has the ability to load and execute programs in an enhanced CP/M-compatible environment. COMMAND2.COM is a special program which, when loaded and executed, provides the user with many sophisticated commands and features generally compatible with and in many cases better than those found in MS-DOS and MSX-DOS 1, such as extended memory management.

It also has the ability to load and execute specially written MSX-DOS 1 programs and most standard CP/M programs, and can execute batch files with parameter substitution and other features similar to those found in MS-DOS.

An APPEND facility is provided to increase the ease of use of directories with CP/M programs which were not written to handle them.

Throughout the rest of this manual the term MSX-DOS is used to mean MSX-DOS version 2.xx unless otherwise stated.


1.2 Editing command lines

When typing in a command line to MSX-DOS, a simple editing facility is available for correction of mistakes or the re-entering and editing of previous commands.

Typing ordinary characters at the keyboard cause the characters to appear on the screen as would be expected. Typing most control characters cause them to be represented by a '^' symbol followed by the control letter. Exceptions are carriage return (RET or CTRL-M), back space (BS or CTRL-H), tab (TAB or CTRL-I), insert (INS or CTRL-R), escape (ESC or CTRL-[), home (HOME or CTRL-K), CTRL-C, CTRL-J, CTRL-N, CTRL-P, CTRL-S, CTRL-U and CTRL-X (SELECT). These perform the following functions:

CTRL-C
This acts as a 'break' key. A more drastic and preferred 'break' key is CTRL-STOP.
CTRL-J
Line feed; nothing happens if this was given in the command line.
CTRL-K
Home cursor (HOME).
CTRL-N
This turns the printer off after being turned on by CTRL-P.
CTRL-P
This turns the printer on. When on, all characters printed on the screen are also printed on the printer.
CTRL-S
This suspends all character output until another key is pressed.
CTRL-U
This erases the line currently being entered.
CTRL-X
This erases the line currently being entered (SELECT).
The line is entered when the 'ENTER' key is pressed.

At any point whilst typing in a command line, the backspace key (marked BS or BACKSPACE on most MSX machines) can be used to delete the character immediately to the left of the cursor in the normal way.

The cursor left and right keys will move the cursor left and right along the line. Typing a character at this point will overwrite the character currently underneath the cursor.

Pressing the insert key (marked INS on most MSX machines) will toggle to 'insert mode', and the cursor will change to an underline cursor to indicate this. Instead of the characters being typed overwriting the characters under the cursor, they will instead be inserted before the cursor character, the remaining characters to the end of the line being moved one position to the right.

The delete key (marked DEL on most MSX machines) will delete the character under the cursor and move the remaining characters to the end of the line one position to the left.

The home key (marked 'HOME' on most MSX machines) will move the cursor to the start of the line.

Pressing ESC, CTRL-U or CTRL-X will clear the line to allow a new one to be entered.

The command editor also keeps a list of previous commands entered, up to a limit of 256 characters. Pressing the cursor up key will move up the list and display the previous command line entered, allowing this old command line to be edited and re-entered. Pressing the cursor down key will similarly move to the next old command line that was entered.

If a previous command line is changed, then it will be used as the new command line and added to the bottom of the list. If it was not changed, then it will not be added to the list and the current command line will be the next one which was originally entered. This allows a whole sequence of previous commands to be entered easily.

The list of previous commands is in fact circular and moving off the top or bottom will move to the last or first command in the list respectively. The previous command can be called to be re-entered or edited from this command history list.

The features described here are in fact available to many programs that MSX-DOS can execute. In any program that does 'line inputs', each line can be edited as described above. Previous lines can be recalled for re-entering and editing, although the list of previous lines will of course include previous commands.


1.3 Notation

The syntax of the commands available from MSX-DOS are described in section 1.4 using the following notation:

The following is a list of items which can appear on a command line:

1.3.1 d:

This indicates that a drive name is required (A:, B: etc.).

If d: is shown as optional and is not specified, then the currently logged-on drive, as indicated by the command prompt, is assumed.

1.3.2 path

This indicates that a directory path is required, the syntax of which is similar to MS-DOS. Each directory in the path is separated by a backslash '\'. A backslash at the start of the path indicates that the path starts at the root directory, otherwise the path starts at the current directory as indicated by the CHDIR command. Frequently a filename follows a path, in which case the two must be separated by a backslash.

Two consecutive dots '..' signify the immediate parent directory in the path. A single dot '.' signifies the current directory in the path and therefore usually has no value in a path specification.

On non-English MSX machines, the backslash character '\' may be replaced by some other character. In particular, on Japanese MSX machines the Yen character is used.

If a path is shown as optional and is not specified, then the current directory as indicated by the CHDIR command is assumed.

The syntax of the directory names that make up a path name follows that for filenames given below.

1.3.3 filename

This indicates that the name of a file is required, the syntax of which is similar to MS-DOS and MSX-DOS 1. An ambiguous filename is one that contains '*' and '?' characters and may match more that one file on disk, whilst one that does not contain these is an unambiguous filename.

A filename has the following syntax:

mainname[.suf] 
where mainname is a sequence of up to 8 characters and suf is a sequence of up to 3 characters inclusive. Any characters beyond these fields are ignored. A '*' in the main name or suffix is equivalent to filling from that character position to the end of the field with '?'. If the suffix is given then it must be separated from the main part of the filename by a single dot '.'.

The following characters cannot be used in filenames:

All characters are converted to upper case where appropriate and therefore lower and upper case characters have the same meaning. Note that extended two-character Japanese characters (SHIFT-JIS code) are allowed.

If a filename is shown as optional and is not specified, then a filename of *.* is assumed.

1.3.4 filespec

This is used to identify a file or several files in the same directory on a disk. It's syntax is:

[d:][path][filename]
where at least one of the three optional items must be given. Where this is used to specify existing files, /H may be given to allow hidden files to be found.

Generally, d: if not given defaults to the currently logged on drive, path if not given defaults to the current directory of that drive and filename if not given defaults to a filename of *.*.

1.3.5 compound-filespec

This is used in many commands to specify the files or directories to which the command is applied. It's syntax is:

filespec [+ filespec [+ filespec ...]]
Thus several filespecs (see above) can be given, separated by '+' symbols, with spaces etc. allowed either side of the +. The effect of this in commands is exactly the same as if all the matched files could have been matched by a single filespec.

Where a compound-filespec is used to specify existing files, /H may be given after each filespec (see above), in which case it will take effect only for the files matched by that single filespec. If a /H is given before the compound-filespec, then it will apply over all the filespecs.

1.3.6 volname

This indicates that a volume name is required. A volume name is a sequence of up to 11 characters, which can include the characters not valid for filenames with the exception of control codes and '/', although leading spaces will be deleted.

1.3.7 device

This indicates one of the five standard MSX-DOS devices is required. These and their meaning are:

CON - screen/keyboard I/O  
NUL - 'null' device, does nothing  
AUX - auxiliary I/O (eg. RS232 serial)  
LST - printer output  
PRN - printer output
Unlike on some other systems, a colon is not required after the device name.

Device names can generally be used wherever filenames can be used. For example, the command COPY MYFILE PRN will read the file MYFILE and write it to the printer.

When using the CON device as an input filename, lines can be typed in and edited in the same way as command lines (see section 1.2on Editing Command Lines). To end the operation, CTRL-Z (^Z) must be typed at the start of a line. For example, a small text file called MYFILE can be created with the command COPY CON MYFILE:

A>COPY CON MYFILE  
All work and no play makes Jack a dull boy.  
Can you hear me?  
^Z  
A>
Lines of text can then be typed in, and they will be written to the file MYFILE. The command will then complete when a line containing a single CTRL-Z is entered.

If the NUL device is written to by the command COPY CON NUL, then the characters written are simply ignored. If read from, then an end-of-file condition is returned straight away (which is equivalent to typing the CTRL-Z in the example above).

For most commands, it is not sensible to specify a device (the CON device cannot be deleted using the ERASE command, for example). The commands that devices are likely to be used with are those that read and write data from and to files, such as CONCAT, COPY and TYPE.

1.3.8 number

This indicates that a number is required. This may be in the range 0 to 255 or 0 to 65535 depending on the command.


1.4 Commands

This chapter describes in detail all the commands available from the MSX-DOS CLI1.1. Each command is described using the notation described in section 1.3. Where two or more parameters are described using this notation, they must be separated by separators. Separators consist of zero or more leading spaces, a separator character, and zero or more trailing spaces. Valid separator characters are:

Option letters introduced by '/' characters are an exception to this and need not be preceded by a separator.

A transient MSX-DOS or CP/M-80 program can be loaded and executed by typing the main name of the filename plus an optional extension of .COM. Batch files can similarly be executed except that the extension is .BAT. Where COM and BAT files exist in the same directory and with the same name, the COM file is found and executed in preference to the BAT file. The exact location on disk of the command can be specified by including its drive and/or path with its name.

When looking for a COM or BAT file, the specified directory of the specified drive is searched. If not found and a drive or path was given with the command, then an 'unrecognized command' error results.

If just the filename and optional extension were given, the current directory is searched first. If not found, then a list of directories is searched. This list can be specified and changed using the PATH command. If still not found then an 'unrecognized command' error again results.

No CP/M program will be able to specify directories or path names since these do not exist in CP/M, only the current directory of the appropriate drive being accessible from these programs. An APPEND environment item is available which increases the usability of these programs by allowing an alternative directory to be searched by the program as well as the current one (see section 1.7 on Environment Items).

Many commands and programs perform input or output using the 'standard input' and 'standard output'. The standard input normally refers to the keyboard, and the standard output normally refers to the screen. These can be changed, however, to refer to other devices or to disk files for the duration of the command by including the redirection symbols <, > and >> on the command line, followed by a device or file name. The standard output of one command can also be sent to the standard input of the next command by including the piping symbol | on the command line between the two commands. See section 1.5 on Redirection and Piping for more details of these facilities.

When a transient command is executed, that command may overwrite some of the memory that COMMAND2.COM was using. Thus when the command terminates, COMMAND2.COM may need to re-load itself from disk into memory from the COMMAND2.COM file that it was originally loaded from. This file is located by looking at the SHELL environment item (see section 1.7 on Environment Items), or the root directory of the boot drive if it is not found there. If it is still not found, then a prompt is issued. For example, if MSX-DOS was booted from drive A:, then the prompt will be:

Insert COMMAND2.COM disk in drive A:  
Press any key to continue...
After inserting into drive A: a disk containing COMMAND2.COM in the root directory and pressing a key, COMMAND2.COM will be re-loaded and the system will continue as normal.

Although not a command as such, the currently logged on drive can be changed by giving the command:

d:
which causes the drive d: to become the current drive. This should be shown by the prompt letter.

In the command examples that follow, underlined text is an example response to a command, and the other text consists of the example command given by the user. In most examples a single space is shown as the parameter separator, although other separator characters can be used as specified above.

1.4.1 ASSIGN

1.4.2 ATDIR

1.4.3 ATTRIB

1.4.4 BASIC

1.4.5 BUFFERS

1.4.6 CD

1.4.7 CHDIR

1.4.8 CHKDSK

1.4.9 CLS

1.4.10 COMMAND2

1.4.11 CONCAT

1.4.12 COPY

1.4.13 DATE

1.4.14 DEL

1.4.15 DIR

1.4.16 DISKCOPY

1.4.17 ECHO

1.4.18 ERA

1.4.19 ERASE


1.4.20 EXIT

1.4.21 FIXDISK

1.4.22 FORMAT

1.4.23 HELP

1.4.24 MD

1.4.25 MKDIR

1.4.26 MODE

1.4.27 MOVE

1.4.28 MVDIR

1.4.29 PATH

1.4.30 PAUSE

1.4.31 RAMDISK

1.4.32 RD

1.4.33 REM

1.4.34 REN

1.4.35 RENAME

1.4.36 RMDIR

1.4.37 RNDIR

1.4.38 SET

1.4.39 TIME

1.4.40 TYPE

1.4.41 UNDEL

1.4.42 VER

1.4.43 VERIFY

1.4.44 VOL

1.4.45 XCOPY

1.4.46 XDIR