The file with the extension com is a binary executable file; the purpose of this file is to directly execute the command of the program code. The file does not come with any supporting data and only contains executable code. The file header is the An execution instruction has no relocation information, so the code cannot have instructions that operate data across memory segments, so the code and data can only be limited to the same 64KB memory segment.
The operating environment of this tutorial: Windows 10 system, DELL G3 computer.
A file with a COM extension is a binary executable file. Its purpose is to directly execute the command of the program code. It can be used by double-clicking the left mouse button. You can open it by double-clicking with the left button or opening it with the right button.
com file refers to the binary executable file in the operating system.
There are two types of executable files: one is suffixed with .COM and the other is .EXE. .COM is generally used in DOS.
COM format file is a simple executable file. In the operating system introduced by Diguido Corporation in the 1970s, COM was used as the extension for text files containing commands supported by the operating system (similar to .cmd files in Windows systems). With the introduction of CP/M (an operating system for microcomputers), files with the COM extension were changed into executable files. The format was later carried over to MS-DOS.
The COM file does not come with any supporting data and only contains executable code. The file header is the first execution instruction. There is no relocation information, so the code cannot have instructions to operate data across memory segments (segments), so the code and data can only be limited to the same 64KB memory segment.
The format is still executable on many modern Windows NT-based platforms, but it runs in the MS-DOS emulation subsystem NTVDM and does not exist in 64-bit variants. COM files can also be executed on DOS emulators (such as DOSBox), on any platform supported by these emulators.
Extended information
The difference between com and exe files
The characteristics of files with COM extension are as follows:
The program can only set one segment and does not create a stack segment;
The length of the program must be less than 64K bytes;
The program must reserve 100H space, and the beginning is an executable instruction;
The starting label where the program is loaded must be specified by the END statement. ;
The subroutine in the program must have the process attribute (NEAR);
If the COM file is linked by several different target modules Generated, all target modules are required to have the same code segment name and category name (CLASS), and be given a public attribute (PUBLIC), while the main module should have an entry pointer of 100H and be connected first.
For more related knowledge, please visit the FAQ column!
The above is the detailed content of What is the file with extension com. For more information, please follow other related articles on the PHP Chinese website!