What does executable file actually contain?

前端 未结 5 1385
梦谈多话
梦谈多话 2020-12-08 08:01

What does executable actually contain ? .. Does it contain instructions to processor in the form of Opcode and Operands ? If so why we have different executables for differe

5条回答
  •  长情又很酷
    2020-12-08 08:47

    As unwind implied in his answer, an executable file contains calls to routines in the Operating System.

    It would be extremely inefficient for an executable file to try to implement functions already provided by the OS (for example, writing to disk, accepting input) so heavy use is made of calls to the OS functions.

    Different Operating Systems provide functions which do similar things, but the details of how to call those functions (and where they are) may be different.

    So, apart from the major differences of processor type, executables written for one OS won't work with another.

提交回复
热议问题