Descriptions of several file formats and types

What are .PMA/.BIN/.BAS/.ROM/.COM... files and how to run them?

Some MSX emulator users ask that question quite often and I am really tired of reading the same messages over and over again, so here you should find answers on most common questions about file formats on MSX. Stop filling comp.sys.msx with these questions!


What are the [.BAS] files?

The [.BAS] and [.LDR] files are MSX-BASIC files. These are not ASCII files! See below!

How do I run them?

They can be started by writing following (when you are in MSX-BASIC):

(Example file: EXAMPLE.BAS)
from MSX-DOS it can be also done by typing at the command line:
<ENTER> = PUSH Return/Enter key.

To run those files in an emulator, most of the time you have to put them on a disk image. For more info about that, see below at DSK files.

I tried to load a [.BAS] file in my text editor but I got only some garbage!?

That's because normally, a BASIC program is saved in a special format. This is called `tokenized' BASIC. It means every BASIC-command has it's own special byte or byte-combination. These files seem pretty binary if you don't know that it's BASIC. But of course you can also save a BASIC program in ASCII format.

To save a [.BAS] file in ASCII format try:

(Example file: EXAMPLE.BAS)



Now it is possible to open the file in a text editor. It's possible to write the BASIC program in a text editor too, but who does that? :-)

Note: When a [.BAS] file has been saved with [,A] option it will take longer to load it in MSX-BASIC (especially when the program is on tape!). This is way the described method of tokens is used. It's a way of compressing the BASIC files.

What's the purpose of [.LDR]-basic files?

Some MSX-BASIC files have a .LDR extension. LDR is short for "loader". This usually means that this particular basic program loads a machine-language-binary (often called .BIN file, see below) program in the computer's memory. It's often seen with games.


What are the [.BIN] files?

The [.BIN] files are binary files and contain machine language. On disk, the structure is like this:
First 7 bytes of file-header:

byte 0  : ID byte #FE
byte 1+2: start-address
byte 3+4: end-address
byte 5+6: execution-address
Then follows the machine-language. Note that this is only true for BIN files on disk, because cassette-files have a separate header with the address-information in it. The structure is as follows:
First a long header with binary 1s,
10 bytes #D0 (which indicates the file type, here binary),
6 bytes for the filename,
(a short silence),
short header with binary 1s,
2 byte start-address,
2 byte end-address,
2 byte execution-address,
then follows the machine-language.
The computer recognizes the baud rate by the long header with the binary 1's. So actually, you can save in a lot of speeds, limited by the cassette-quality (about 4600 Baud is really the maximum for good cassettes).

How do I run them?

They can be started by typing the following (when you are in MSX-BASIC):

(Example file: EXAMPLE.BIN)


If the file will not start then there may be several reasons:

  1. There's not enough free memory. Free more RAM by holding [CTRL] key down during the boot until a BEEP is heard (this makes the MSX reserve memory for only one disk-drive instead of two, so you have some kilobytes more free in BASIC).
  2. This file is either buggy or is a part of a whole program. Try to find the loader (*.BAS/*.LDR file) and try with
    (please also check the section on BAS files, above!)
  3. The file hasn't got a run address. Find the loader (*.LDR/*.BAS) if possible.

[.001], [.002], ... , [.00n]

What are the these files and what to do with them?

These files are actually binary files, like the [.BIN] files. But they're just called different. They're called this way, because apparently the machine-language program consists of more than one binary file. Try to find the [.BAS] or [.LDR] (loader, in BASIC) file and run it.


What are the [.COM] files?

The [.COM] files are MSX-DOS V1.x/V2.x executable. To execute them you must boot MSX-DOS V1.x/V2.x, and type EXAMPLE after the prompt, to run the program EXAMPLE.COM, just like MS-DOS.

How can I make an MSX-DOS V1.x disk?

Can MSX run CP/M V2.20 software under MSX-DOS V1.x?

Yes. With MSX-DOS V1.x you should be able to run most of CP/M V2.20 software.

Where can I find the list of MSX-DOS V1.x commands?

The commands of MSX-DOS V1.x are equal to MS-DOS's (except CD/MD/RD/MOVE - directory manipulation). Just read an MS-DOS manual/guide!

Here are the three basic ones:

[ ] = optional

I can't boot the MSX-DOS, my MSX (emulator) locks up!?

If you try to boot the MSX-DOS V1.x from a disk formatted in MS-DOS on a PC, then the MSX will lock up, because the boot sector is different. A disk formatted on PC will contain PC code in the boot sector, just as a disk formatted on a MSX will contain MSX code. So it is important that the boot sector is MSX's and not PC's!

Where can I get the MSX-DOS V1.x or MSX-DOS V2.x files?

[MSXDOS.SYS+COMMAND.COM]: [msxdos1.lzh] MSX-DOS V1.x system files.

[ksave105.lzh ] MSX-DOS(2) kernel saver V1.05 by K.Tsujikawa.

Use it to extract the ROM from your DOS2 cartridge on real MSX2. Then it (can) - (I assume that your emulator can emulate DOS2) be used with the MSX emulator. Consult the manual of your MSX emulator if in doubt. Some emulator sites provide the MSX DOS 2 ROM file too.


What is a [.PMA] file?

The [.PMA] file is a compressed archive created by PMARC2.COM. PMARC2.COM was the most used archiving tool on the MSX platform. To extract [.PMA] files use PMEXT.COM. An [.PMA] extractor/packer for PC is available too, and it is recommended to use it if you have a PC compatible machine.

Where can I get a [.PMA] file extractor for MS-DOS, (L)UNIX or my MSX (emulator)?

[pmext4pc.arj] and PMEXT-PC.ZIP]: PMEXT.COM for MS-DOS.

[pmarc-pc.arj]: PMARC.COM for MS-DOS.

[pmarc.pma]: PMARC.COM for MSX-DOS(2)/CP/M V2.20.

[]: PMEXT.COM for MSX-DOS(2)/CP/M V2.20.

[]- LHA/LZH extractor adapted to make it also work with PMA files, by Maarten ter Huurne. Source compilable for (L)UNIX systems (updated in 2011 by Ricardo Jurczyk Pinheiro). For Win32 users there is also a binary available.

The [.PMA] extractor for MS-DOS is the same as on MSX, but it runs under 22NICE - CP/M V2.20 emulator [22nice.lzh]. When you have once executed 22NICE then you can run PMARC/PMEXT as many times as you want. It is not recommended to extract archives by using MSX-emulator due to the low speed. Use the 22NICE and PMEXT in MS-DOS instead.

How to extract [.PMA] files on a MacIntosh computer?
(Taken over from the (personal) site of The Red Devil.)

There is no simple way to do it, so no special program to extract [.PMA] is available on Mac computers. So, to extract those archives you will need a CP/M emulator for Mac and the program (extractor): PMEXT.COM. There are two different versions of PMEXT.COM. First one is CP/M native and the 2nd one is patched so it is compatible with MSX-DOS1/2. The patched version will break down the emulator since it uses some MSX-DOS calls. The unpatched version is fully CP/M native so it works fine.

So you need the following:

Extracting goes as follows:
  1. Drop "PMEXT.COM" to folder named "Drive A".
  2. Drop the [.PMA] files to folder named "Drive A".
  3. Double click on the CP/M emulator icon.
  4. Choose folder "Drive A" as your A: drive.
  5. Type after A>: PMEXT FILE.PMA B:
  6. The CP/M emulator will ask you to choose drive B:
  7. Choose folder named "Drive B" as drive B:
  8. The files will be unpacked to folder named "Drive B"
  9. To check which PMA files are in the folder named "Drive A", type behind the CP/M prompt (A>): DIR *.PMA

Can I decompress [.LZH] and Amiga [.LHA] files on MSX (emulator)?

The PMEXT.COM should also be able to decompress [.LZH] and Amiga [.LHA] files. But there's also a program called LHEXT.COM, see below.

Are there any [.LZH] (un)packers for MSX (emulator)?

The [.LZH] files can be extracted by using above mentioned utility (PMEXT.COM), in MSX-DOS. There are more though:


What's an [.AR] file?

It is a compressed archive (as ZIP, LZH etc.). The file is created by an MSX-DOS or MSX-DOS2 utility PR.COM by Egor Voznessenski (SOLID soft). This compressing format is especially made on/for MSX. It is the fastest compressor on MSX, but the compression is less good than PMA / LZH. Extractor is only available for MSX-DOS(2).

Where can I get the extractor/packer for my MSX?

[pr170.lzh]: [.AR] archive packer/unpacker V1.70 for MSX-DOS. By SOLiD soft.

[pr200.lzh]: [.AR] archive packer/unpacker V2.00 for MSX-DOS2(1). By SOLiD soft 1997.


What is an [.XSA] file?

[.XSA] is a special disk image format developed by Xelasoft (Alex Wulms). An [.XSA] file contains usually a compressed MSX floppy disk. It is useful if you want to put one or more disk images on a disk. (An uncompressed disk image file does of course not fit on a disk of the same size, since the disk needs some space for the FAT and directory information.)

How can I restore/make an [.XSA] file on my PC or MSX?

[d2ff2d.lzh]: [.XSA] disk compress/decompress for MS-DOS & MSX-DOS(2) by XelaSoft.

How can I convert an [.XSA] file to [.DSK] file or [.DSK] file to [.XSA] file on my MSX, PC or Unix station?

[xscxsdmx.pma]: [.DSK] to [.XSA] and [.XSA] to [.DSK] converter for MSX-DOS by Xelasoft.

[xscxsdpc.arj]: [.DSK] to [.XSA] and [.XSA] to [.DSK] converter for MS-DOS by Xelasoft.

[xsc_xsd.sun.tar.gz]: disk compress/decompress for SunOS V4.x by Xelasoft.

[xsc_xsd.hp.tar.gz]: disk compress/decompress for HP-UX V9.x by Xelasoft.

[xsc_xsd.linux.tar.gz]: disk compress/decompress for LINUX V1.2.x by Xelasoft.

More general info about this can be found on The XelaSoft XSA Format page.

The program imgtool (included with MESS) can also decompress [.XSA] files.


What is a [.MIF] file?

MIF is a new MSX image standard (similar to PCs GIF). It supports MSX2/2+/GFX9000 screen modes and uses compression to obtain smaller files.

To kill any doubts, MIF Tools package is not a Public Domain product (except MIF2BMP.EXE for PC and the viewers (and source code of the viewers) for MSX). The converter program offers keyboard/joystick or mouse controlled GUI with a lot of options which make it easy to operate on graphic files. This program runs in MSX-DOS.

The file types recognized by MIF converter are:

The benefits: You will get also a PC program which is able to import BMP files directly as MIF files. It has built in auto dithering, scaling etc. which makes it possible to achieve really high quality images on your MSX2. This BMPtoMIF converter is for PC (MS-DOS).

As said, it is not PD, order it at:

Laurent Halter
4, Eigenthal


What is a [.DSK] file?

The most important and most widely used uncompressed disk-image file.

Which utility creates a [.DSK] floppy-disk image on my PC?

Can I also convert [.DSK] files to/from a real disk on a Unix/Linux computer?

Sure, it's very easy! Just make sure you have a correctly formatted floppy-disk in the disk-drive. Then type: cat example.dsk > /dev/fd0, if your disk-drive has the device-name fd0. That's it! To make a disk image of your real disk, use the same procedure, but then the other way round: cat /dev/fd0 > example.dsk . (This is why I love Unix!)

For single sided disks, you may have to create a special device node first (you can do that in your home directory, e.g.): mknod ~/fd0u360 b 2 12 and then transfer the disk like this: cat example.dsk > ~/fd0u360.

How can I put a MSX [.DSK] image back to a floppy disk on a MacIntosh computer?

OK, this is a rather complicated one. I'll describe it here, it is taken over from the (personal) site of The Red Devil.

This procedure only works for 720kB floppies. At first you need the following software (System 7.0.1 at least):

Ok, now the steps:
  1. Doubleclick on the ShrinkWrap icon
  2. Choose the preferences (under edit) and make the following configuration:
    1. Destination:
      • Use: (Choose desktop folder)
    2. Automatically decode and expand files:
      • all off
    3. Automatically compress image files:
      • all off
    4. Save disk images as:
      1. Floppy: (Choose - MS-DOS Image file)
      2. Set on "Mount images unlocked by default"
      3. Make sure the rest is in this column is off
  3. Open the PC-exchange panel in your control panels folder
  4. Click on "add.. " button
  5. Type in the "Dos-type" filed: "DSK"
  6. Now find in the directory window the "ShrinkWrap" program
  7. Then choose in the "Macintosh-type" window: icon "hdrv"
  8. Click OK
  9. Exit the control panel
  10. Now, there is still a problem, since ShrinkWrap will not recognize the DSK file as a valid PC-disk image. It has a non-matching creator string. The string must be "hdrv". Since TRD and I do not know how to change this string, the following trick must be used:
    1. Format a 1.44MB disk as a PC disk and put it in the drive of the Mac
    2. Drag the disk icon onto the ShrinkWrap(TM) icon, so that a disk image of 1.44 MB will be created on the desktop
    3. Mount it, by doubleclicking on the disk image
    4. Rename it to e.g. "EmptyPCdisk"
    5. Now drag and drop the disk-image you want to use to "EmptyPCdisk". It is then copied to "EmptyPCdisk" and will automatically get the creator type "hdrv", so it will now be usable for ShrinkWrap!
  11. Now double click on ShrinkWrap and choose "Write image back to disk" (Image menu)
  12. Choose your disk image from "EmptyPCdisk" and it will be read
  13. Now put a 720kB floppy in the drive and you will have a real MSX floppy disk which works on your real MSX computer
OK, that was the procedure... Final remarks/hints:

I have a multiple [.DSK] file. Can I split it into [720kB] [.DSK] files on my PC?

[]: Splits multiple [.DSK] images into several 720kB [.DSK] files. For MS-DOS. By Meuse Soft.

[multidsk.c]: C source of a program that can add and extract [.DSK] disk images to/from multiple [.DSK] files. Compile it yourself on your favourite platform. Written by Sean Young. For Win32 users there is a binary available.

I have 720kB [.DSK] files. How can I make a multi disk image of it (to use with fMSX-DOS or with FDD emulator)?

This is quite clearly explained in the manual of fMSX. But to make this FAQ more complete, I'll repeat the explanation here.

Multi disk images are supported from fMSX-DOS version 1.6b1. To create one, simply copy several disks to 1 image like this: COPY /B DISK1.DSK+DISK2.DSK MULTI.DSK, start the emulator with the resulting disk image as disk A, and press RIGHT CTRL+1..0 when the game asks you to insert a new diskette. Please note that this only works for double sided disk images (720kB ones). An alternative:

[multidsk.c]: C source of a program that can add and extract [.DSK] disk images to/from multiple [.DSK] files. Compile it yourself on your favourite platform. Written by Sean Young. For Win32 users there is a binary available.

If you like to do this job on MSX (on a harddisk), tye the following in MSX-DOS 2: concat /b disk1.dsk+disk2.dsk multi.dsk. This is useful if you want to run a multiple disk game with a so-called floppy disk emulator on MSX, which enables you to play floppy disk software from hard disk with disk images.

Can I move files to/from the [.DSK] images on my PC/Unix system?

[]: rddsk.exe/wrdsk.exe: utilities used to move files out of/into [.DSK] images. For MS-DOS, by Arnold Metselaar
Note: the sources of wrdsk/rddsk can be found in the fMSX package by Marat Fayzullin. Use them to compile your own Unix version.

Can I move files to/from the [.DSK] images on my MSX?

[]/[] Utilities used to move files out of/into [.DSK] images. For MSX-DOS, by Arnold Metselaar.

For clarity: these utilities enable you to put BAS, BIN or other files on a disk image, so some emulators, like fMSX, can work with these BAS or BIN files, or whatever. So to run these files, just put them on a disk image and start fMSX with the disk image (see manual). After booting the (virtual) MSX, you can see with the MSX-disk-BASIC command FILES if the files are really present on the disk image. If they are, just run them. See the corresponding suffix-section for details.

Can I create/restore [.DSK] files on my real MSX?

[fdload11.lzh]: File to Sector convert tool V1.10 by K. Tsujikawa. Use this utility to write [.DSK] images to a floppy disk on real MSX. For MSX-DOS(2).

[fdsave11.lzh]: Sector to File convert tool V1.10 by K. Tsujikawa. Use this utility to convert a floppy disk to [.DSK] image on real MSX. For MSX-DOS(2).

Can I run diskimages on my real MSX (from harddisk)?

Of course you can. There are a number of programs that can emulate the diskdrive and run the diskimage from your harddisk. I will list them here:


What is a [.MSX] file?

This is a disk image created by a Korean programme called "updownc".

I have a [.MSX] disk-image file. Can I convert it to [.DSK] - MSX emulator compatible disk-image?

[]: MSX2DSK.EXE converts [.MSX] disk images to [.DSK] images. For MS-DOS.

[UPV25.LZH]: Converts [.MSX] disk image to a floppy disk.

[msx2dsk.c]: C-source code of a [.MSX] to [.DSK] converter, download and compile it yourself on your favourite platform (thanks to Sean Young). For Win32 users there is also a binary available.

The program imgtool (included with MESS) can also convert [.MSX] files.

Can I write it to a real 3.5" disk?

Yes, therefore you need the program "updownc" [updownc.lzh] for MS-DOS.


What is a [.DDI] file?

It's a disk-image file created by the programme Diskdupe [diskdupe.lzh], I guess. It seems to be a [.DSK] file with a 4608 byte header. The programme is for MS-DOS.

Can I convert it to [.DSK] - MSX emulator compatible disk-image?

[ ] Converts [.DDI] disk images to [.DSK] for MS-DOS.

[ddi2dsk.c] C-source code of a [.DDI] to [.DSK] converter, download and compile it yourself on your favourite platform (thanks to Sean Young). For Win32 users there is also a binary available.

The program imgtool (included with MESS) can also convert [.DDI] files.


What is a [.TD0] file?

This is a disk image file created by a Brazilian program called Teledisk [td0todsk.lzh]. This program has to be used to write it to a real disk and is for MS-DOS.


What is a [.CP2] file?

These files are disk images created by the program Snatchit/Copy2PC [cp2todsk.lzh]... This/these programmes are needed to convert the files to a real disk and work under MS-DOS.


What is a [.IMG] file?

This is also a disk image-file. It's the same as a .DSK file, except for the first byte, which is a header-byte. If you delete it, it's exactly a .DSK file. On Unix this is easy, e.g. use VI or VIM in binary mode and press [DEL] once and save it. You can also use img2dsk by Patrick Lina. The file contains a compiled version for DOS and a very short manual.

[img2dsk.c] A C-source code of a [.IMG] to [.DSK] converter, download and compile it yourself on your favourite platform (this one is by Sean Young). For Win32 users there is also a binary available.

The program imgtool (included with MESS) can also convert [.IMG] files.


What is a [.CAS] file?

CAS files are tape recordings made on fMSX. fMSX catches the BIOS calls, and then writes/reads the actual bytes from a regular file (the .CAS file). Headers are stored as the 8 byte sequences: 0x1F,0xA6,0xDE,0xBA,0xCC,0x13,0x7D,0x74.

How can I read a [.CAS] file on a real MSX?

In order to read .CAS files on a real MSX, you first need to convert it to the original sound. imgtool (included with MESS) can do that. Type on the commandline: imgtool getall fmsx_cas cassette.cas. Now you have a .wav file. Next connect the white (load) cable of your MSX to the sound output connector of your PC. Give the approriate command on the MSX (eg. "BLOAD "CAS:",R"), and play the .wav file. An alternative is to use the castools package, which can be found on Vincent van Dam's web site.


What is a [.TAP] file?

.TAP files are created by Virtual MSX. No other emulator supports them. A .tap file can contain multiple .CAS files. The format is rather complex; but you can extract the .CAS files from a .TAP file using imgtool, which is included with MESS. It is a commandline tool, type imgtool getall vmsx_tap vmsx.tap to extract all .CAS files.


What are the [.ROM] files and can I use them with my MSX-emulator or real MSX?

The [.ROM] files are images of ROM cartridges available for real MSX machines. Those files were meant to be used with MSX emulators but since we have v1.0 by TRUNKS they can be used on real MSX machines too! There is also the possibility to run ROM files on a real MSX if you have a Brazillian MegaRAM cartridge (with the program ExecROM) or an ESE SCC cartridge. ROM files have size of 16kB, 32kB, 128kB, 256kB, 384kB or even 512kB (or bigger, there exist 8 Megabit ROMs, i.e. 1MB!). [.ROM] files which are available in FTP archives are ready to run, no conversion is needed. When using CJS MSX2 emulator then the files must be chopped in smaller blocks (16kB). Read the manual of CJS' MSX2 emulator. I've read somewhere that there is a bug in the ROM splitter from CJS so please don't use it unless there is another one.

The usage of ROM files with an emulator is emulator dependent. Of course it will be explained in the emulator's manual. Read that manual!

Note that a real cartridge with a ROM file also contains circuitry (a memory mapper mechanism) so that the right parts of the code are on the right positions in the address space of the Z80 CPU. This circuitry is not in the ROM files, which means that emulators have to know (or possibly detect) the mechanism themselves and thus have to emulate those.

Where can I get the [.ROM] file loaders for real MSX2 machines?

To load [.ROM] files on real MSX, use the LOADROM.COM V1.0 by TRUNKS (see previous question)! But if you have a MegaRAM cartridge (that's a cartridge with a whole lot of RAM in it, similar to the structure of the ROM in a cartridge) you can also use ExecROM. There are also some other options. A list:

Where can I find the [.ROM] files?

Check out the MSX FTP sites. Links can be found in the links database of The MSX Resource Center (and here).

Back to the FAQ's index!