Assembly code vs Machine code vs Object code?

后端 未结 10 1976
执笔经年
执笔经年 2020-11-27 09:11

What is the difference between object code, machine code and assembly code?

Can you give a visual example of their difference?

10条回答
  •  自闭症患者
    2020-11-27 09:37

    The source files of your programs are compiled into object files, and then the linker links those object files together, producing an executable file including your architecture's machine codes.

    Both object file and executable file involves architecture's machine code in the form of printable and non-printable characters when it's opened by a text editor.

    Nonetheless, the dichotomy between the files is that the object file(s) may contain unresolved external references (such as printf, for instance). So, it may need to be linked against other object files.. That is to say, the unresolved external references are needed to be resolved in order to get the decent runnable executable file by linking with other object files such as C/C++ runtime library's.

提交回复
热议问题