General Information and Tips about Assembly, Executable Files (EXE, COM)
-EXE Header Block size is at least 512 Bytes and this block written by Linker before file block.
-COM program has only one segment block (Code Segment) and its size at least 64K and its content PSP (Program Segment Prefix) whereas block size 256 Bytes.
-COM program hasn't Data, Stack segment compared with EXE program.
-Program Segment Prefix (PSP) size is 100 Bytes and placed in memory before EXE execution.
-OS perform all registers with (PSP) address when load COM program in memory.
-Every segment divided into more than one offset.
«How OS Manage EXE Program Execution»
1. Locate and access *.exe file from hard disk.
2. Build initial space in memory called (PSP) Program Segment Prefix from 0x00H to 0x100H.
3. Load (*.exe) file after 0x100H directly.
4. Load DS (Data Segment) and ES (Extra Segment) with address of PSP.
5. Load CS (Code Segment) with code segment address and Initial IP (Instruction Pointer).
6. Load SC (Stack Segment) address in SP (Stack Pointer).
7. Give handle to exe file execution.
«How to Convert (*.exe) to (*.com) »
1. Compile (*.asm) File to (*.obj) File with TASM.
C:\TASM\BIN>TASM C:\ [File (*.asm)], C:\,C:\,C:\
2. Link (*.obj) File to (*.exe) File with TLINK.
C:\TASM\BIN>TLINK C:\ [File (*.obj)]
3. Get exe2bin tool.
C:\X2B C:\ [File (*.exe)]

