翻译:EXECUTABLE FILES .COM AND .EXE (1) 上海 孙逊 1994-03-25 A .COM file must contain only one segment, it means that the program consists of a CODE segment only, and it must be less than 64KB in length. In this kind of file, all jump and subroutine-call instructions're the NEAR type. The process of loading .COM files can be expressed as follows: 1.It is transferred directly from the disk to the memory which is immediately after the PSP. 2.All segment registers're set to point to the beginning of the PSP. 3.The SP register is set up so that the stack is located at the end of the segment. 4.The IP register is set to 100H becaue the first instruction to be executed will always be at offset 100H with in the segment. (英汉对照) 可执行文件__.COM和.EXE DOS支持二类可执行文件__.COM和.EXT。 一个.COM文件只许包含一个段,这意味着程序只由代码段组成,而且其长度须小于64KB。在此类文件中,所有的跳转指令和子程序调用指令都采用NEAR类型。 装入.COM文件的过程如下: 1.把文件从磁盘直接装入到紧接着PSP之后的内存中。 2.所有的段寄存器均指向PSP起始处。 3.确定SP寄存器之值,使堆栈被设置在程序段的底部。 4.IP寄存器的值设定为100H,因为要执行的第一条指令总是位于其段内偏移100H处。