summaryrefslogtreecommitdiff
path: root/src/arch/x86/instruction.h
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2008-09-14 20:54:43 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2008-09-14 20:54:43 (GMT)
commit06cf576b280cbabb73a956161693a63ee846f57b (patch)
tree3ac4b32e869cc8aaa1d4b7429d7d4a12f9a8ae7f /src/arch/x86/instruction.h
parentab1489b6a6ef1f09957f6f805f143fceb42f6a08 (diff)
Made the program able to disassemble a simple binary completely.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@30 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/x86/instruction.h')
-rw-r--r--src/arch/x86/instruction.h38
1 files changed, 29 insertions, 9 deletions
diff --git a/src/arch/x86/instruction.h b/src/arch/x86/instruction.h
index af4f7cf..68a5fff 100644
--- a/src/arch/x86/instruction.h
+++ b/src/arch/x86/instruction.h
@@ -38,8 +38,12 @@ typedef struct _asm_x86_instr asm_x86_instr;
/* Enumération de tous les opcodes */
typedef enum _X86Opcodes
{
+ X86_OP_SUB_R1632_RM1632, /* sub ([0x66] 0x29) */
+
X86_OP_XOR_REG1632, /* xor ([0x66] 0x31) */
+ X86_OP_CMP_RM1632_R1632, /* cmp ([0x66] 0x39) */
+
X86_OP_INC_E_AX, /* inc ([0x66] 0x40) */
X86_OP_INC_E_CX, /* inc ([0x66] 0x41) */
X86_OP_INC_E_DX, /* inc ([0x66] 0x42) */
@@ -78,19 +82,27 @@ typedef enum _X86Opcodes
X86_OP_PUSH_IMM1632, /* push ([0x66] 0x68) */
- X86_OP_MOV_REG1632, /* mov ([0x66] 0x89) */
+ X86_OP_JE_8, /* je (0x74) */
+ X86_OP_JNE_8, /* jne (0x75) */
+
+ X86_OP_CMP_RM8_IMM8, /* cmp (0x80 7) */
+
+ X86_OP_ADD_IMM1632_REG1632, /* add ([0x66] 0x81 0) */
- X86_OP_ADD8_REG1632, /* add ([0x66] 0x83) */
- X86_OP_OR8_REG1632, /* or ([0x66] 0x83) */
- X86_OP_ADC8_REG1632, /* adc ([0x66] 0x83) */
- X86_OP_SBB8_REG1632, /* sbb ([0x66] 0x83) */
- X86_OP_AND8_REG1632, /* and ([0x66] 0x83) */
- X86_OP_SUB8_REG1632, /* sub ([0x66] 0x83) */
- X86_OP_XOR8_REG1632, /* xor ([0x66] 0x83) */
+ X86_OP_ADD8_REG1632, /* add ([0x66] 0x83 0) */
+ X86_OP_OR8_REG1632, /* or ([0x66] 0x83 1) */
+ X86_OP_ADC8_REG1632, /* adc ([0x66] 0x83 2) */
+ X86_OP_SBB8_REG1632, /* sbb ([0x66] 0x83 3) */
+ X86_OP_AND8_REG1632, /* and ([0x66] 0x83 4) */
+ X86_OP_SUB8_REG1632, /* sub ([0x66] 0x83 5) */
+ X86_OP_XOR8_REG1632, /* xor ([0x66] 0x83 6) */
+ X86_OP_CMP_RM1632_IMM8, /* cmp ([0x66] 0x08 7) */
X86_OP_TEST_RM8, /* test ([0x66] 0x84) */
X86_OP_TEST_RM1632, /* test ([0x66] 0x85) */
+ X86_OP_MOV_REG1632, /* mov ([0x66] 0x89) */
+
X86_OP_MOV_FROM_CONTENT1632, /* mov ([0x66] 0x8b) */
X86_OP_LEA, /* lea ([0x66] 0x8d) */ /* 66 ? */
@@ -99,6 +111,8 @@ typedef enum _X86Opcodes
X86_OP_MOV_MOFFS_TO_AL, /* mov (0xa0) */
X86_OP_MOV_MOFFS_TO_E_AX, /* mov ([0x66] 0xa1) */
+ X86_OP_MOV_AL_TO_MOFFS, /* mov (0xa2) */
+ X86_OP_MOV_E_AX_TO_MOFFS, /* mov ([0x66] 0xa3) */
X86_OP_TEST_AL, /* test (0xa8) */
X86_OP_TEST_E_AX, /* test ([0x66] 0xa9) */
@@ -112,8 +126,11 @@ typedef enum _X86Opcodes
X86_OP_MOV_E_SI, /* mov ([0x66] 0xbe) */
X86_OP_MOV_E_DI, /* mov ([0x66] 0xbf) */
+ X86_OP_SAR_RM1632_IMM8, /* sar ([0x66 0xc1 7) */
+
X86_OP_RET, /* ret (0xc3) */
+ X86_OP_MOV_IMM8_TO_RM8, /* mov (0xc6) */
X86_OP_MOV_TO_CONTENT1632, /* mov ([0x66] 0xc7) */
X86_OP_LEAVE, /* leave (0xc9) */
@@ -122,9 +139,12 @@ typedef enum _X86Opcodes
X86_OP_CALL, /* call (0xe8) */
+ X86_OP_JMP_8, /* jmp (0xeb) */
+
X86_OP_HLT, /* hlt (0xf4) */
- X86_OP_PUSH_CONTENT, /* push ([0x66] 0xff) */ /* 66 ? */
+ X86_OP_CALL_RM1632, /* call ([0x66] 0xff 2) */
+ X86_OP_PUSH_CONTENT, /* push ([0x66] 0xff 6) */ /* 66 ? */
X86_OP_COUNT