summaryrefslogtreecommitdiff
path: root/insns.h
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-09-18 15:08:20 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-09-18 15:08:20 -0700
commit19e201053689be68d0e45077fa86e9538d74daa1 (patch)
tree49c9bbd3d44939e9795951e72d700c83224e6f13 /insns.h
parent0edc309505e659345cf353f81fb77793f8f5c291 (diff)
downloadnasm-19e201053689be68d0e45077fa86e9538d74daa1.tar.gz
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.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/insns.h b/insns.h
index b5d6caf7..b025c7a5 100644
--- a/insns.h
+++ b/insns.h
@@ -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