0

Im looking for the source code of an assembler (preferably for one of the more popular processors), specifically for the files where you see how the mnemonic-binary conversion is implemented. So Id like to look at the part where the mnemonics get mapped to the respective machine code (or however this is actually implemented).

Or maybe someone could describe this process for an assembler of their choosing.

I know that assemblers convert mnemonics to machine code but I still dont fully understand how.

user3629892
  • 2,960
  • 9
  • 33
  • 64
  • The GNU assembler is available as part of the [binutils](ftp://ftp.gnu.org/gnu/binutils/) package... – twalberg Apr 28 '15 at 17:07
  • 1
    `gas`, `nasm`, `fasm` are all open source. As for the actual conversion, you just map the mnemonic and the operands to the appropriate machine code. See also [this manual walkthrough](http://stackoverflow.com/a/28665062/547981). – Jester Apr 28 '15 at 17:09

1 Answers1

0

A good resource (at least for intel x86) is their published documentation on it: huge pdf file. It is a complete manual for all the instructions and their corresponding opcodes.

randomusername
  • 7,927
  • 23
  • 50