|
|
|
|
|
by tibiapejagala
4089 days ago
|
|
Seconding this. I've implemented a part of x86 instruction encoding and you either find resources: * comprehensible, but far from complete (some blogs) * complete, but hard to understand and requiring some implicit knowledge (Intel manual or [1]) Rather than disassembler I recommend writing some simple JIT compiler, with [2] as a starting point. You skip some problems this way. [1] http://ref.x86asm.net/ this seems pretty cool as a reference, but I can't wrap my head around it [2] http://eli.thegreenplace.net/2013/11/05/how-to-jit-an-introd... |
|
But you have to understand that it's just a reference, it doesn't give you the complete picture. It just shows you the important stuff when you already know where to look.
I've written partial disassemblers/assemblers. And that site has been a huge help to me.
My 2 cents:
Start with being able to decode the mov instruction, with all the different possible memory encodings. Once you understand how you parse the memory/addressing scheme of x86 it's suddenly a whole lot easier. And I agree that writing an assembler to start is probably easier, to write a disassembler it has to be complete, but an assembler doesn't have to support all instructions to work.