Re: How to maintain opcode/modrbym/sib tables




spamtrap@xxxxxxxxxx wrote:
> How to maintain opcode/modrbym/sib tables
> ***************************************************
> Hi,
> Im writing a disassembler for PE files in C. I have almost
> understood how to do the disassembling but i dont know how to store the
> necessary information for decoding . The information inculdes opcodes,
> modrbym and sib tables.
> I have two strategies.
> One is to store everything in different arrays within the programs
> itself and search within it while disassembling.
> Second is to store these info in text files and search in them while
> disassembling.
> Both has adv and disadv. The first stratgey is good since everythin is
> in mem and faster access but will take lot of memory.

It won't take *that* much memory. And it will be better than 1,000
times faster than searching through a text file.


> The second
> strategy is good since it will take less memory but will have lot of
> disk i/o and will slow down the program.Please tell which one is good.

Reading from the file is *bad*.


>
> If anybody has a better method of doing it thats also welcome.

Perhaps if you were to explain a little better what you're trying to
do?
Opcodes map to mnemonics easy enough. As for your addressing mode
bytes, I don't see a lookup table being the solution -- construct your
output on the fly by decoding the various fields of these operands.
Cheers,
Randy Hyde

.



Relevant Pages

  • How to maintain opcode/modrbym/sib tables
    ... The information inculdes opcodes, ... One is to store everything in different arrays within the programs ... itself and search within it while disassembling. ... in mem and faster access but will take lot of memory. ...
    (alt.lang.asm)
  • How to maintain opcode/modrbym/sib tables
    ... The information inculdes opcodes, ... One is to store everything in different arrays within the programs ... itself and search within it while disassembling. ... in mem and faster access but will take lot of memory. ...
    (comp.lang.asm.x86)
  • Re: Z80 Assembly books related to CP/M
    ... So most of the CP/M compatible computer were Z80 compatible also. ... it was the Z-80 which was compatible (except the famous NMI ... All the one-byte long opcodes ... disassembling ZSID. ...
    (comp.os.cpm)
  • Re: Question regarding Jazz 6.8
    ... > Does Jazz have trouble disassembling certain opcodes? ... > GOSUB SomeLabel ...
    (comp.sys.hp48)
  • Question regarding Jazz 6.8
    ... Does Jazz have trouble disassembling certain opcodes? ... GOSUB SomeLabel ...
    (comp.sys.hp48)