Board index » delphi » EXE making COM

EXE making COM

I was using a ANSI editor and when I went to save it it gave me the
option of saving as a COM file so I did so and when I ran it it worked
How did they do this...Let say I make a program that has a menu with
demo routines and if the user clicks on one of the demos it makes a COM
file with the routine...

 

Re:EXE making COM


FazeX, after due consideration, uttered

Quote
>I was using a ANSI editor and when I went to save it it gave me the
>option of saving as a COM file so I did so and when I ran it it worked
>How did they do this...

I very much doubt it *actually* turned the .EXE file into a .COM file.
You can only convert from .EXE to .COM in a very specific set of
circumstances.

Pewrhaps it only saved the file with a .COM extension ? You can check
this with any program that will read the first few bytes of the program.
If the first two chars in the prog are MZ, it is an .EXE file not a .COM
file.

DOS does not look at the extension to decide whether or not it is a .EXE
or .COM file but looks for these two letters at the start of the file to
differentiate between the two executeable formats.

--
Pedt Scragg                    <postmas...@pedt.demon.co.uk>

Never curse the Crocodile's mother before crossing the river

Re:EXE making COM


Quote
Pedt Scragg wrote:

> FazeX, after due consideration, uttered
> >I was using a ANSI editor and when I went to save it it gave me the
> >option of saving as a COM file so I did so and when I ran it it worked
> >How did they do this...

> I very much doubt it *actually* turned the .EXE file into a .COM file.
> You can only convert from .EXE to .COM in a very specific set of
> circumstances.

> Pewrhaps it only saved the file with a .COM extension ? You can check
> this with any program that will read the first few bytes of the program.
> If the first two chars in the prog are MZ, it is an .EXE file not a .COM
> file.

> DOS does not look at the extension to decide whether or not it is a .EXE
> or .COM file but looks for these two letters at the start of the file to
> differentiate between the two executeable formats.

> --
> Pedt Scragg                    <postmas...@pedt.demon.co.uk>

> Never curse the Crocodile's mother before crossing the river

That what I ment it saved the art as a COM file so you can run and see
it..I wanted to know how to make it so i can do that with graphics
you know like PCX2COM or BMP2COM

Re:EXE making COM


FazeX, after receiving a reply, uttered

Quote
>Pedt Scragg wrote:

>> FazeX, after due consideration, uttered
>> >I was using a ANSI editor and when I went to save it it gave me the
>> >option of saving as a COM file so I did so and when I ran it it worked
>> >How did they do this...

>> I very much doubt it *actually* turned the .EXE file into a .COM file.
>> You can only convert from .EXE to .COM in a very specific set of
>> circumstances.

>That what I ment it saved the art as a COM file so you can run and see
>it..I wanted to know how to make it so i can do that with graphics
>you know like PCX2COM or BMP2COM

Ahah! - your subject header confused me.

What you need to do is

1. Write an assembler program that will read data added to the end of
the *actual* program (and loaded into memory at the same time) and
display it on one screen.

2. Hard code the length of the .COM program.

3. Make sure that you make the data fit into the segment, as simple .COM
files can only have one 64K segment.

4. Write your program to write to disk the exact image of the .COM
program you created earlier (either getting the prog as data info from a
file or storing it as a constant within the program).

5. Then write the data to the end of the .COM file to display the info.

--
Pedt Scragg                    <postmas...@pedt.demon.co.uk>

Never curse the Crocodile's mother before crossing the river

Other Threads