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

后端 未结 4 965
故里飘歌
故里飘歌 2020-11-29 15:17

I\'m confused about machine code and native code in the context of .NET languages.

What is the difference between them? Are they the same?

4条回答
  •  清歌不尽
    2020-11-29 15:43

    Native code and machine code are the same thing -- the actual bytes that the CPU executes.

    Assembly code has two meanings: one is the machine code translated into a more human-readable form (with the bytes for the instructions translated into short wordlike mnemonics like "JMP" (which "jumps" to another spot in the code). The other is the IL bytecode (instruction bytes that compilers like C# or VB generate, that will end up translated into machine code eventually, but aren't yet) that lives in a DLL or EXE.

提交回复
热议问题