The difference between .COM and .EXE

I have a collaborative article that says .COM better for a small application than .EXE files. What are .COM files? How to create a .COM file? How are they better than .EXE files? I also want to know .COM files are still widely used?

Any suggestions.

+1
source share
2 answers

Was this article released in 1985? COM files have long been dead since they are only DOS, there can only be 64 KiB and have many other problems.

They used to be a simpler format than EXE, as you could create a valid COM executable with multiple lines in debug.exe or a collector. Here I am a little nostalgic ...

+8
source

COM files are wonderful because you can convert executable files magically into text files. EXE files always have the MZ header, but COM don't. Since you can generate code dynamically in the x86 arsenal, you can generate binary opcodes using opcodes in printed characters.

Here is an example, the README.COM program:

 P5CQ5sPP[X5iK4iH4] P_1?CC5IQ5CBP_1?SX4v4pPZ5iH5i@okey Text2COM example by 谢继雷 (Lenik). $ 

In this example, bootstrapping operation codes generate a DOS INT 21H interrupt to display a line ending with '$'.

Some older compilers may have some options for supporting the .COM file, but since it is a 16-bit executable, they are not supported for many years.

0
source

Source: https://habr.com/ru/post/1344689/


All Articles