By enribar

Paragon (1076)

enribar's picture

03-10-2008, 09:40

Hi to all, I need a help:

what are the differences between BIN, COM and ROM files? I find utilities to convert BIN->COM and BIN->ROM, but nothing for the reverse COM -> BIN.

Another question: is it possible to obtain a BIN or ROM compiled file in MSX-Pad? Does the TP cross-compiler allow to this operation and how?

Thankyou in advance for you help.

Login or register to post comments

By enribar

Paragon (1076)

enribar's picture

03-10-2008, 10:07

According to this page , to obtain a BIN from a COM I have to change only the first byte to #FE. Is it true?

By sjoerd

Hero (594)

sjoerd's picture

03-10-2008, 13:56

Well, not only the file format is different, but the whole operating system. COM files expect a dos environment; BIN files probably expect the bios and basic roms switched in. Converting those files to other formats sounds unnecessary to me. A ROM file is just a memory dump of an msx cartridge.

A bin file has a header, starting with FE followed by start, end and execute addresses. COM files don’t need a header because they always start at 100h. Just changing the first byte is not enough. You have to put a complete header in front of the file, and change all addresses in the file.

I do not know how to make bin or rom files with tp. What is wrong with com files anyway? Smile

By enribar

Paragon (1076)

enribar's picture

03-10-2008, 14:43

Hi sjoerd, thankyou for the answer.
The main reason to make bin files and not com files is that there are many people developing software in Turbo Pascal.
But it seems that TP creates only com files. If we can compile in BIN format we can convert files in ROM, and then... More MSX software on carts! :-)

By Sd-Snatcher

Hero (582)

Sd-Snatcher's picture

05-10-2008, 00:23

This only can work if these programs never use DOS functions.

By Yukio

Paragon (1540)

Yukio's picture

05-10-2008, 01:47

Maybe you could use something like this:
the Embedded Pascal

Just use something that could compile files to create Z80 BINary files.


Enlighted (6453)

ARTRAG's picture

05-10-2008, 17:16

Enrico, you cannot convert a COM to BIN or ROM, sorry.
COM files relies on msxdos (or on CPM in case of TP) while BIN and ROM files relies on the BIOS or directly on the HW.

Not only, it is also a matter of size and memory organization:
COM files start at 100h in RAM, thus can use about 55K or ram.
They can allocate variables where they like inside that area.

BIN files start below 8000h and have to fit in less that 28K of ram
variables can be where they like inside that area.

ROM files work in ROM and, unless using page mapping, cannot pass 32K or 48K
variables are grouped in the area below 8000h of C000h

The sole thing you can really do is to develop in TP
a program that once compiled is organized like a BIN or a ROM file
so not a general solution, just a project that outputs a BIN or ROM files