Alex Rivera | Logout

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

Asked 2010-05-03T18:22:48.550
14

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 binary machine code instructions.

Edit
Report

1 Answer

5

For x86, it's complicated as hell. A little less complicated since 32-bit processors took over, but yeah. Still a pain.

You may want to take a look at nasm ( http://www.nasm.us ). It's an open source 32-bit assembler. See how they do it. Or, use it instead. :)

answered 2010-05-03T18:27:48.483

Your Answer