summaryrefslogtreecommitdiff
path: root/src/arch/x86/operand.h
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2009-10-07 00:22:10 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2009-10-07 00:22:10 (GMT)
commitdaa0084325d4e748f334a223e1cd3800120e6055 (patch)
tree9f8bfe9296e1a4f6aa945418293f895303b771e2 /src/arch/x86/operand.h
parentd9be16271ab3fbb95d6c95baa92242358f0e7dfd (diff)
Created a function to load n x86 operands and supported extra x86 opcodes.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@128 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/x86/operand.h')
-rw-r--r--src/arch/x86/operand.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/arch/x86/operand.h b/src/arch/x86/operand.h
index cb04ca8..fc40b38 100644
--- a/src/arch/x86/operand.h
+++ b/src/arch/x86/operand.h
@@ -207,11 +207,16 @@ typedef enum _X86OperandType
} X86OperandType;
-/* Procède à la lecture d'un opérande donné. */
-bool x86_read_one_operand(GArchInstruction *, const bin_t *data, off_t *pos, off_t, X86OperandType, ...);
+/* Nombre maximal d'opérande */
+#define MAX_OPERANDS 3
-/* Procède à la lecture de deux opérandes donnés. */
-bool x86_read_two_operands(GArchInstruction *, const bin_t *data, off_t *pos, off_t, X86OperandType, X86OperandType, ...);
+
+#define x86_read_one_operand(instr, data, pos, len, ...) _x86_read_operands(instr, data, pos, len, 1, __VA_ARGS__)
+#define x86_read_two_operands(instr, data, pos, len, ...) _x86_read_operands(instr, data, pos, len, 2, __VA_ARGS__)
+#define x86_read_three_operands(instr, data, pos, len, ...) _x86_read_operands(instr, data, pos, len, 3, __VA_ARGS__)
+
+/* Procède à la lecture de n opérandes donnés. */
+bool _x86_read_operands(GArchInstruction *, const bin_t *, off_t *, off_t, unsigned int, ...);