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.
source share