SVI Disk BASIC
This page was last modified 15:47, 4 July 2022 by Mars2000you. Based on work by NYYRIKKI.

Contents

Description

SVI Disk BASIC is an extension of SVI-BASIC for SVI-318/328 computers. A RAM expansion is required on SVI-318.

It is very close to version 1 of Disk BASIC for the MSX system.

Contrary to MSX, this extension is not included in a Disk ROM, but is provided on a floppy disk named the BASIC MASTER DISK. You need to insert this disk (or a copy) in the drive before booting the SVI-318/328 computer.

Please note: The Disk BASIC version must match the disk drive physical properties. Using a Disk BASIC version designed for another type of drive may corrupt the disk data structure.

We will here mainly give info about the differences, so you can adapt SVI-3x8 programs for the MSX system.

Name of the drives

In SVI Disk BASIC, the drives are named with a number, 1: or 2:

When converting a program for MSX, you need to replace 1: by A:, and 2: by B:

Besides, the characters " and : are often not required in SVI Disk BASIC, but you need to add them in the conversion.

Instructions that work differently

COPY

The SVI COPY instruction specifies the destination before the source - some examples:

  • COPY 2 FROM 1 to copy all sectors from disk in drive 1 to disk in drive 2
  • COPY 2 FROM "1:test" to copy the "test'" file from disk in drive 1 to disk in drive 2
  • COPY 2;(10,10) FROM 1;(30,2)-(30,8) to copy specified track and sectors from disk in drive 1 to a specified track and sector in drive 2

The corresponding MSX COPY instruction indicates the source before the destination. You also need to change the name of the drives.

The third example requires to write a routine.

DSKI$() and DSKO$

The SVI DSKI$() function and DSKO$ instruction are a bit similar to their MSX versions (see DSKI$() and DSKO$), but they have a extra parameter related to track:

  • DSKI$(<drive>,<track>,<sector>)
  • DSKO$ <drive>,<track>,<sector>

The conversion requires to replace physical track & sector by the corresponding logical sector on MSX. You also need to understand that:

  • The logical disk format on SVI is different than on MSX
  • Sector size on SVI is 128 bytes (track 0) or 256 bytes (rest of the disk) while MSX always uses 512 bytes sectors
  • The DSKI$ function on SVI returns the content as string while MSX always returns null string
  • Passing data to DSKO$ on SVI is usually done through FIELD definition on device 0. On MSX this will result to "File not open"-error and therefore MSX needs extra tricks to use FIELD in this unusual scenario. (See example on DSKI$())

FORMAT

On SVI-318/328, FORMAT is not an instruction or a command, but a BASIC program that provides only logical formatting. On MSX physical and logical formatting are always done together (see CALL FORMAT) and the file system is also completely different.

Before using FORMAT on SVI-318/328, you must first physically format the disk under CP/M with the SVFRMT utility. Some later Disk BASIC versions provided also BLOAD-able version of this program for BASIC. If you want to create a bootable disk, you also need to copy the Disk BASIC using the provided SYSGEN.BAS program.

These mentioned tools may differ a bit depending of Disk BASIC version used. There exists known SVI Disk BASIC versions at least for:

  • 168kB - Single Sided, 40-track disks
  • 338kB - Double Sided, 40-track disks
  • 338kB - Single Sided, 80-track disks

Typically SVI-318/328 used 5.25" disks, but users have upgraded to 3.5" drives as well. BIOS boot routines are designed to be also 8" drive compatible, but by default BASIC requires a drive that is MFM encoding capable.

Specific instructions

ATTR$()

The ATTR$() function returns a string with the attributes of a drive or a file on this drive.

For details about the attributes, see the SET instruction below.

On MSX, ATTR$() is only a reserved word, very rarely used.

FPOS()

The FPOS() function returns the number of the physical sector where an opened file is located.

On MSX, FPOS() is only a reserved word, very rarely used.

IPL

The IPL instruction allows to directly launch a specified program after booting.

Its syntax to launch a BASIC program can be

  • IPL "RUN" + CHR$(34) + "1:<filename>
  • IPL "LOAD" + CHR$(34) + "1:<filename> + CHR$(34) +",R"

On MSX, IPL is only a reserved word, rarely used. You need to replace the SVI IPL instruction by creating an AUTOEXEC.BAS file.

SET

The SET instruction determines the attributes of a drive or a file on this drive.

Only 3 attributes are possible:

  • E (EBCDIC code)
  • P (Write protect - Read only)
  • R (Force verify - Read after write)

On MSX, SET is only a reserved word, never used alone. However, it is used in specific MSX2/MSX2+ instructions, but it has nothing to do with the SVI using.

SWITCH (STOP)

This instruction allows 2 programs to be simultaneously stored in RAM. It is available only when SVI Disk BASIC is used with the 64kB RAM expansion cartridge.

You can switch between banks 02 and 22. The STOP option will choose the program in bank 22 to be executed.

It can't be used on MSX.

How to transfer BASIC programs to MSX

(Editor note: WIP and in wrong place)

MSX-BASIC and SVI-BASIC use a little bit different way to tokenize BASIC listings, so first of all I recommend transferring the programs in ASCII format.

The best way to transfer files is by using the SVI-707 disk drive. This is meant to be used with SVI-728 computers, but it works also on selected other MSX computers if you have the SVI-213 adapter. The MSX-DOS disk that comes with the drive includes a program to copy files between SVI and MSX, but it works only with this drive.

If this is not an option the second best is by using an RS-232C interface and a cable for SVI-3x8. This allows you to save the program as text to COM-port.

If this is not an option either then there exists a program to load SVI BASIC files from cassette to MSX (citation needed)

There is also an experimental project that allows to transfer SVI disks to PC using joystick port and few dollar adapter (by NYYRIKKI). This allows you to solve the problem when using the openMSX emulator.

Technically the major problem accessing the SVI disks is the fact that MSX can not read SVI formatted track 0 (top side) at all due to used FM-encoding that is not implemented on any MSX disk adapter AFAIK. Luckily this track contains only part of SVI Disk BASIC, so the content is not really important while transferring files. SVI has no such technical limitations and can read/write everything on MSX disks as long as the software is right.

SVI Disk BASIC can actually even read/write MSX/PC disks out of the box (except for track 0, top side as it expects it to be FM formatted), but it does not know the disk structure at all, so you really need to know what you are doing if you use this feature:

  • The first issue is the 512 byte sector size that comes as a surprise to SVI and by default over size sector causes system variables to be overwritten. This can be prevented by using MAXFILES to lower the starting point in memory.
  • After this security measure, DSKI$ and DSKO$ can be used. You may notice that DSKI$ and DSKO$ don't have side/head-parameter, so in case of double sided disks the tracks 0-39 represent top side of the disk and tracks 40-79 represent bottom side of the disk.

Links

Note: The Swedish manual is more accurate and complete than the English and Spanish manuals.