diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-09-18 15:08:20 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-09-18 15:08:20 -0700 |
commit | 19e201053689be68d0e45077fa86e9538d74daa1 (patch) | |
tree | 49c9bbd3d44939e9795951e72d700c83224e6f13 /insns.h | |
parent | 0edc309505e659345cf353f81fb77793f8f5c291 (diff) | |
download | nasm-19e201053689be68d0e45077fa86e9538d74daa1.tar.gz nasm-19e201053689be68d0e45077fa86e9538d74daa1.tar.bz2 nasm-19e201053689be68d0e45077fa86e9538d74daa1.zip |
Speed up the disassembler by allowing prefixed instruction tables
Modify the disassembler so that we can have separate instruction
tables for prefixed instructions. As it was, all instructions which
started with 0F were linearly searched, and that is by now more than
half the instruction set.
Diffstat (limited to 'insns.h')
-rw-r--r-- | insns.h | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -26,9 +26,18 @@ struct itemplate { uint32_t flags; /* some flags */ }; +/* Disassembler table structure */ +/* If n == -1, then p points to another table of 256 + struct disasm_index, otherwise p points to a list of n + struct itemplates to consider. */ +struct disasm_index { + const void *p; + int n; +}; + /* Tables for the assembler and disassembler, respectively */ extern const struct itemplate * const nasm_instructions[]; -extern const struct itemplate * const * const itable[]; +extern const struct disasm_index itable[256]; /* * this define is used to signify the end of an itemplate |