|Writing a disassembler ? firstname.lastname@example.org (So and so) (2008-10-10)|
|Re: Writing a disassembler ? email@example.com (Vimal) (2008-10-11)|
|Re: Writing a disassembler ? firstname.lastname@example.org (Jeff Kenton) (2008-10-11)|
|Re: Writing a disassembler ? DrDiettrich1@aol.com (Hans-Peter Diettrich) (2008-10-11)|
|Re: Writing a disassembler ? email@example.com (Stephen Horne) (2008-10-11)|
|Re: Writing a disassembler ? ArarghMail810@Arargh.com (2008-10-11)|
|Re: Writing a disassembler ? firstname.lastname@example.org (glen herrmannsfeldt) (2008-10-12)|
|[3 later articles]|
|From:||"So and so" <email@example.com>|
|Date:||Fri, 10 Oct 2008 16:57:31 +0200|
|Posted-Date:||11 Oct 2008 05:55:37 EDT|
I've set myself a goal to write a disassembler, so far I've managed to
understand most of Intel's documentation (for now it's only going to
disassemble x86 code) and I'm about to start writing the basic
The algorithm I had in mind was :
Read N bytes (or the whole files, I'm not sure about it yet)
if this byte is part of a prefix instruction, parse it else continue
to opcode, and so on and so on .
Though, I ran into several "problems" in mind:
1. Which data structure should store the values I read ? A hash table
or a Tree ? Or a combination of both ? (trie) Should the tree be
balanced ? If not, will it cost in efficiency or whether balancing it
will cost in efficiency ?
2. What about invalid instructions ? Should I strip them the moment I
detect they're invalid or should they be stored FFU ?
3. Which data structure should hold the final result of the
disassembled instruction ?
5. Should the disassembler itself be multi threaded or one program
which does everything step-by-step and if it will be multi threaded -
how can I handle or parse different instructions ? or handle
Return to the
Search the comp.compilers archives again.