CALL RAMDISK
This page was last modified 14:36, 31 May 2020 by Mars2000you. Based on work by Rderooy.

Contents

Effect

Creates a RAMDISK that will get the drive letter H: and optionally displays its actual size.

Only works with version 2 of Disk BASIC, as provided by the MSX-DOS 2 cartridge or the MSX Turbo R machines.

Unlike the in-memory disk created by MemoryDisk BASIC, the RAMDISK created by CALL RAMDISK uses the regular Disk BASIC instructions to manipulate files.

Notes:

  • Only one RAMDISK can be created. You will get an error message if you try to create a RAMDISK when it already exists.
  • If you use CALL SYSTEM after creation of the RAMDISK, it will remain available in the MSX-DOS 2 / Nextor environment - see the RAMDISK command.
  • Delta BASIC is compatible with this RAMDISK, but drive H: needs to be created before installing Delta BASIC and it will not be acesssible with the DFILES, LDFILES and SETDRIVE instructions.

Syntax

CALL RAMDISK (<Size>,<Variable>)

The last parameter is optional. Parameters can not end with a comma alone.

Parameters

<Size> is a number to specify in kilobytes the size of the RAMDISK you want to create. This number will be rounded up to the nearest multiple of 16kB since the RAMDISK is always a multiple of 16kB.

If the number is 0 the RAMDISK will be deleted.

<Variable> is an optional numeric variable. When specified, it will return the actual size of the created RAMDISK. This size can be different from the entered size, as the system needs to use some RAM for FAT or directories and the size of the memory mapper is taken in account to determine the actual size.

Maximum RAMDISK
Memory mapper MSX2 / MSX2+ MSX Turbo R
128 kB 32 kB Impossible
256 kB 160 kB 96 kB
512 kB 416 kB 352 kB
1024 kB 928 kB 864 kB
2048 kB 1888 kB 1888 kB
4096 kB 4064 kB 4064 kB

Examples

10 CALL RAMDISK (128,S)  'Creates a 128kB RAMDISK when the memory mapper is 512kB
20 PRINT S
128
10 CALL RAMDISK (3000,S)  'Creates a 3000kB RAMDISK when the memory mapper is 2048kB
20 PRINT S
1888
CALL RAMDISK (64)  'Creates a RAMDISK when it already exists
RAM disk already exists

Compatibility

Disk BASIC 2.0 or higher