vorige:
VPB50 MSX notebook - revisited
MCCW nummer 93, juni-december 2000
Terug naar inhoud
volgende:
[en] Tunez 2 - Asterix edition
Dit artikel is helaas alleen beschikbaar in het Engels.
beyond normal MSX-DOS 2
MSX-DOS 2 version 2.40

After ASCII Corporation stopped with MSX I did not expect a new MSX-DOS 2 version. However, there now is an update available, from an entirely unexpected direction!

 
Alex Wulms
 
Directory
Installation
Changes
Aliases
Internal variables and functions
Memory
More possibilities and conclusion
New command line editor
Length of command line
New commands
Disappeared commands
New environment variables
New default values of environment variables
Added internal variables
Added Internal Variable Functions
Miscellaneous changes
Changed memory usage



Note from the translator
This article is quite old, and therefore might contain some outdated remarks. Out of respect for the author, I have not changed anything, but when necessary I will give comments in italics. In this first comment I would like to start with mentioning that in the meantime there have been some bug fixes and the current version is v2.41. Also, it is not really a new MSX-DOS version, but rather an update of the command-interpreter, COMMAND2.COM.


Ordering information
MSX-DOS 2.41 used to cost about EUR 10, but has become freeware in 2003. You can download it here. The sources are available here. A special version for FAT16 (by Okei) can be found here.


For the people who read MCCM 77 thoroughly, the news about MSX-DOS version is not really a surprise. In the article about the Multi Mente utilities this new version was already mentioned in a letter of its creator, Fokke Post. Fokke followed MCCM’s advise and released the new version as a patch.

Installation
The new MSX-DOS 2 consists out of a new version of the command interpreter COMMAND2.COM, and of a new series of (English) help files with in it extensive explanations about all old, changed and new MSX-DOS commands. Thee disk contains an install-program, two data files, a PMA-archive with in it all new help files, a text file with an overview of all modifications and a set of external commands which from now on belong to MSX-DOS 2 by default. With the install-program and one of the two data files the old version of MSX-DOS 2 can be patched to the new version. It is possible to patch MSX-DOS 2 version 2.20 as well as version 2.31, since one of the data files is used for patching version 2.20 and the other datafile belongs to version 2.31. The latest MSX-DOS 2 can easily be installed by copying the correct datafile to a disk with COMMAND2.COM and then launching the install-program. It is wise though to save an old COMMAND2.COM version separately, in case something goes wrong.

     Apart from a new version of the command interpreter you will also get three new external commands. Those are the latest versions of TO.COM, TREE.COM and RRAMDISK.COM. Those three programs are already available for some time in the public domain circuit. It is nice though to have them for free with this new MSX-DOS 2 version. Especially for the people who did not have those utilities yet.

     Furthermore, there are yet two handy batch files on the disk. It is highly likely there will be more and/or other batch files on the final version because Fokke is still working on MSX-DOS 2.4. One of the batch files is mainly meant to demonstrate the new possibilities and the other sets up several handy aliases for you. The use of aliases is one of the new features of this MSX-DOS. The people who already know this term from other operating systems, like UNIX, from which ASCII Corporation already got a lot of inspiration for MSX-DOS functions, will now probably jump in excitement. For the other MSX-freaks an explanation about this oh-so-useful option will follow below.

Changes
MSX-DOS 2 version 2.40 has got a lot of new possibilities compared to the previous versions of MSX-DOS 2. I myself find the progress in user-friendliness from version 2.31 to version 2.40 almost as large as the progress from MSX-DOS 1 to MSX-DOS 2. An overview of the new possibilities can be found in a separate box. Of all those changes I am most pleased with the possibility to use aliases and with the new type of batch files in which commands like GOTO can be used. In addition, I find it very useful to be able to access the internal variables and functions of MSX-DOS 2; there clearly is a programmer speaking here. However, the disappearance of some key-combinations like CTRL-U for clearing the line are less useful. (Note: the line can also be cleared by pressing ESC.)

Aliases
An alias can best be compared with a batch file which consists only out of one line. However, by using the new command-separation mark (^) several commands can be put in one alias. The big advantage to batch files however, is that aliases are directly in the computer’s ram. That means that they do not have to be loaded from disk first. So in fact you compare an alias with an internal command which is directly executed, without any delay. In this new MSX-DOS 2 an alias can be defined with the new ALIAS command. An example of an alias is the following:
ALIAS DW = DIR @1 /W
If you would now type
DW A: MSX-DOS 2 will execute the command
DIR A: /W.

     Another advantage of the aliases is that they can be linked to extensions. An example is the following:
ALIAS .TXT = A:\UTILS\TED
If you have a file named REVIEW.TXT in the current directory, you can start TED with REVIEW.TXT as a parameter by simply typing REVIEW. Unless TED cannot be found in the given path of course. And if the file REVIEW.TXT is somewhere else in the search path, A:\UTILS\TED is executed with the complete path of REVIEW.TXT.

Internal variables and functions
Internal variables and functions can be used in the same way environment variables can be used in MSX-DOS version 2.31, with %NAME% in which NAME indicates the variable or function. A number of useful variables is:

_BG and _FGscreen colours
_CWD current directory
_CPU current processor mode
_DATE current date

A number of useful functions is:

@ATTRIBrequest a given file its attribute bits
@DISKFREEamount of free space on a disk
@MIDcomparable with MID$ in the Basic environment

     By combining those internal variables and functions with the new IFF THEN ELSE ENDIFF constructions, it is possible to create highly advanced batch files which execute very complex tasks.

Memory
Next to the numerous advantages, the new MSX-DOS also has a small disadvantage: the usage of aliases takes 16 kB of additional memory and the new batch file-format also takes up an extra 16 kB at the moment such a batch file is executed. This is especially a disadvantage for the people who have only 128 kB of memory. Then there is hardly any free memory left for a RAMdisk, MemMan 2.x or other programs which use additional memory. In computer land, memory is often the price you have to pay for the extra possibilities which ease your life. Take a look at the pc, for example, where nowadays even 4 MB is not enough to run modern programs. In that respect MSX still remains a quite cheap computer.

More possibilities and conclusion
Although this update of MSX-DOS 2 already is a huge improvement, I myself see enough space for more possibilities. Especially the batch-language could be greatly enhanced with useful programming constructions like WHILE, FOR and CASE. In this respect Fokke is open to all new ideas, so who knows what will come next if ultimately everybody uses this version of MSX-DOS 2 and passes all ideas they come up with through to Fokke.

     Hence my conclusion is that actually everybody using MSX-DOS 2 should buy this new version. The improvements are well worth the money.

    

Note of the editor: in the MCCM 78 in which the above article was published, there is also an article that shows all differences between MSX-DOS 2.40 and MSX-DOS 2.31. For completeness I will include the English version of that article here too.

New command line editor

  • Command history buffer is now 1024 bytes.
  • File name completion with TAB.
  • CTRL-DEL clears the buffer.
  • CTRL-INS puts the current line in buffer without executing it.
  • CTRL-LEFT/RIGHT goes to begin/end of line.
  • SHIFT-LEFT/RIGHT goes to previous/next word.
  • SHIFT-DEL deletes the rest of the line after the cursor.
  • CTRL-RETURN executes the command without putting it in the buffer.
  • The normal control keys — like ^U: delete line, ^G: beep — have disappeared.

Length of command line

  • You can enter 127 characters at most.
  • After expanding aliases a maximum of 255 characters.
  • After splitting into commands 127 characters maximum.

New commands

  • FREE [d:] Shows the amount of free space on drive d.
  • BEEP Sounds a beep.
  • ALIAS [name] [separator] [value] Sets an alias for a command.
  • RESET Resets computer.
  • COLOR forclr [bakclr [brdclr]] Sets the screen colours.
  • INPUT [string] %%envname Reads a line to an environment variable from keyboard.
  • INKEY [string] %%envname Reads a key press to an environment variable
  • CPU [n] Sets or shows CPU mode.
  • CDPATH [[+|-] [d:]path [[d:]path [[d:]path...]]] Changes search path that is used for commands like CD.
  • CDD [d:][path] Changes to another drive and directory.
  • PUSHD [d:][path] Pushes current dir to directory stack and changes to new directory specified with path.
  • POPD Pops the directory at the top of the directory stack from the stack and make it the current directory.
  • IFF, THEN, ELSE and ENDIFF Execute a command conditionally. IFF is nestable in 16 levels.
  • HISTORY Shows the contents of the command history buffer.
  • DSKCHK Sets or shows the current disk check status.
  • MEMORY Shows memory usage.

Disappeared commands

  • The commands ERA, ERASE and RENAME have been removed.

New environment variables

  • The following environment variables have been added: ALIAS, SEPAR, EXPAND, CDPATH and LOWER.

New default values of environment variables

  • TIME is now on 24 by default.
  • EXPERT is now on ON by default.
  • PROMPT is now on %_CWD%> by default.

Added internal variables
Internal variables can be queried the same way as environment variables, so using %name%. However, they cannot be changed with the SET command. The following internal variables are defined:

  • _BG Current background colour.
  • _BOOT Boot drive letter, without the colon.
  • _COLUMN Current cursor column, starting at 1.
  • _COLUMNS Number of screen columns.
  • _CPU Current CPU type, Z80 or R800.
  • _CWD Current directory, format d:\directoryname.
  • _CWDS Current directory, format d:\directoryname\.
  • _CWP Current directory, format \directoryname.
  • _CWPS Current directory, format \directoryname\.
  • _DATE Current date, format dd-mm-yy.
  • _DATEF Current date, format dd-mm-yyyy.
  • _DIRBUFFER The directory you were previously and will return to with the commands CD - and CDD -.
  • _DISK Current disk drive, without colon.
  • _DOSVER Current version of COMMAND2.
  • _DOW Current day of the week (‘Monday’, ‘Tuesday’, etc).
  • _FG Current foreground colour.
  • _MSXVER MSX version, MSX-2, MSX-2+ or Turbo-R.
  • _ROW Current cursor row, starting at 1.
  • _ROWS Number of screen rows.
  • _TIME Current system time in the format hh:mm:ss

Added Internal Variable Functions
Internal Variable Functions are similar to Internal Variables. The difference is that they need one or more parameters. They can be used like this: %name[parameters]%. The following internal variable functions are defined:

  • @ALIAS[aliasname]
  • @ASCII[character]
  • @ATTRIB[filename, attributes]
  • @CHAR[ASCII value]
  • @DISKFREE[d:, b|k|m]
  • @DISKTOTAL[d:, b|k|m]
  • @DISKUSED[d:, b|k|m]
  • @EXT[filename]
  • @FILE[filename]
  • @FILEATTR[filename]
  • @FILEDATE[filename]
  • @FILESIZE[filename]
  • @FILETIME[filename]
  • @HEX[number]
  • @INSTR[number, string1, string2]
  • @LABEL[d:]
  • @LEFT[string, n]
  • @LEN[string]
  • @LOWER[string]
  • @MID[string, start, length]
  • @NAME[filename]
  • @NEWFILE[filename1, filename2]
  • @PARSE[filename]
  • @PATH[filename]
  • @RIGHT[string, n]
  • @UPPER[string]

Miscellaneous changes

  • The DATE command shows the full name of the day.
  • It is possible to set another drive when reloading COMMAND2.COM.
  • Extra spaces are being printed between the name and the contents of a environment variable when using the command SET.
  • The command DEL *.* now asks ‘Delete all files’ instead of ‘Erase...’.
  • There can be more than one command on a line by using the separation character ^.
  • Directories can be changed to without using the CD command by just typing in the directory name and adding a \ at the end.
  • The command CD - changes to the previous directory.
  • You can use the so called aliases in the command line.
  • When a directory is not found when using CD, all paths that are in the environment variable CDPATH will be searched.
  • The number of parameters for batch files has been increased. Now a maximum of 255 parameters can be passed using %n, instead of only 9.
  • In stead of parameters, (internal) variables and functions can be used. Example: %@DISKFREE[%_BOOT%:]%. Functions are nestable, as long as the command line is not too long.
  • Using the alias mechanism, it is possible to link commands to file extensions. This mechanism is called ‘Executable Extensions’.
  • The prompt can be any text. It can be set with the command SET PROMPT and can also contain %name%. The default prompt is %_CWD%>. Note that the ‘greater than’ symbol (>) needs to be double quoted when using it in a SET command, or else MSX-DOS2 will process it as if it were a redirection symbol.
  • An external command (file) can also contain wild cards. In that case, the first matching file will be executed.
  • The /P option is now also available for the commands ALIAS and SET.
  • The MODE command can now also set the screen height.
  • In a batch file one can now also use %n& which means ‘all parameters starting at parameter n’. The default value for n is 1, so %& is the same as %1&.
  • Passing parameters when using aliases is done using @n. Similar to batch files, & can be added to a parameter of an alias: @n&. In a batch file both %n as well as @n parameters can be passed to an alias.
  • When using IF(F), apart from == one can also make use of the operators EQ (equivalent), LT (less than) and GT (greater than) and the logical operators AND, OR and XOR.
  • When using DIR you can get two-column output by adding the /2 option.
  • There is a new type of batch file with the .btm extension. It can be as big as 16 kB and is loaded to memory in one go. It can contain commands like GOTO. The batch language is slowly becoming a real programming language, like this!

Changed memory usage
16 kB of extra memory is used to store the aliases and another 16 kB extra memory is used when a .btm file is loaded. So, in total, 32 kB of extra memory is needed on top of the 32 kB that is used by MSX-DOS2 for internal buffers and things like that.

vorige:
VPB50 MSX notebook - revisited
MSX Computer & Club Webmagazine
nummer 93, juni-december 2000
volgende:
[en] Tunez 2 - Asterix edition