Difference between: Opcode, byte code, mnemonics, machine code and assembly

后端 未结 6 1487
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-12 12:35

I am quite new to this. I tried to understand the difference between the mentioned terms in a clear fashion, however, I am still confused. Here is what I have found:

6条回答
  •  伪装坚强ぢ
    2020-12-12 12:50

    OPCODE: It is a number interpreted by your machine(virtual or silicon) that represents the operation to perform

    BYTECODE: Same as machine code, except, its mostly used by a software based interpreter(like Java or CLR)

    MNEMONIC: English word MNEMONIC means "A device such as a pattern of letters, ideas, or associations that assists in remembering something.". So, its usually used by assembly language programmers to remember the "OPERATIONS" a machine can do, like "ADD" and "MUL" and "MOV" etc. This is assembler specific.

    MACHINE CODE: It is the sequence of numbers that flip the switches in the computer on and off to perform a certain job of work - such as addition of numbers, branching, multiplication, etc etc. This is purely machine specific and well documented by the implementers of the processor.

    Assembly: There are two "assemblies" - one assembly program is a sequence of mnemonics and operands that are fed to an "assembler" which "assembles" the mnemonics and operands into executable machine code. Optionally a "linker" links the assemblies and produces an executable file.

    the second "assembly" in "CLR" based languages(.NET languages) is a sequence of CLR code infused with metadata information, sort of a library of executable code, but not directly executable.

提交回复
热议问题