CALL CHDRV
This page was last modified 13:43, 9 November 2021 by Mars2000you. Based on work by FiXato and Rderooy.

Contents

Effect

Changes default drive.

Only works with

  • version 2 of Disk BASIC, as provided by the MSX-DOS 2 cartridge or the MSX Turbo R machines
  • version 3 of Disk BASIC, as provided by the Nextor operating system version 2.0 and higher

Notes:

  • If you start the MSX computer and boot directly in MSX-BASIC, the default drive is A:
  • If you use version 1 of Disk BASIC, there are two ways to change the default drive:
    • go to the MSX-DOS 1 command line with CALL SYSTEM, indicate there another drive (example: A>B:), then go back to BASIC with the BASIC command
    • use POKE &HF247,1 to change the master drive to B, POKE &HF247,2 to change to drive C, etc.
  • if you use Nextor, this instruction can be used in both modes of the OS: MSX-DOS 1 and MSX-DOS 2

Syntaxes

  • CALL CHDRV ("<DriveLetter>:")
  • CALL CHDRV (<DriveNumber>) only if you use Nextor

Parameters

<DriveLetter> is the letter for the new default drive. As MSX supports up to 4 disk controllers with two drives each, it means you can have drive letter A through H.

<DriveNumber> is a number for the new default drive, it can vary between 1 for A: and 8 for H:

Examples

CALL CHDRV ("B:")  'Sets the B: drive to be the default

Only if you use Nextor:

CALL CHDRV(3)  'Sets the C: drive to be the default

Related to

CALL CHDIR, CALL CURDRV, FILES

Compatibility

Disk BASIC 2.0 or higher / both modes of Nextor OS