How Do Assemblers Map x86 Instruction Mnemonics to Binary Machine Instructions?

前端 未结 3 445
面向向阳花
面向向阳花 2021-02-07 18:06

I\'m interested in writing an x86 assembler. I\'m wondering what is a good way to map x86 assembly mnemonic instructions (using an Intel-like syntax) into the corresponding bina

3条回答
  •  后悔当初
    2021-02-07 18:38

    It's just a straight-up one-to-one mapping; the Intel documentation describes all of the instructions and their encodings. You'll need to build a giant lookup table or something equivalent to do the matching and code generation.

提交回复
热议问题