summaryrefslogtreecommitdiff
path: root/src/arch/x86/processor.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2008-08-01 21:08:17 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2008-08-01 21:08:17 (GMT)
commitf0b80c6ab55ede4f8ab8ede757f1f8951512affa (patch)
tree7072841db027d421da1118f8021020a1b682de4f /src/arch/x86/processor.c
parent3786e818fdf8731dd6f310f0aaac75d431646160 (diff)
Handled the 'leave' and 'ret' opcodes.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@12 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/x86/processor.c')
-rw-r--r--src/arch/x86/processor.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/arch/x86/processor.c b/src/arch/x86/processor.c
index 94f2a51..487e4a0 100644
--- a/src/arch/x86/processor.c
+++ b/src/arch/x86/processor.c
@@ -223,6 +223,9 @@ void x86_register_instructions(asm_x86_processor *proc)
register_opcode(proc->opcodes[X86_OP_MOV_DI], 0x00, 0xbf, "mov", read_instr_mov_to_1632);
+ register_opcode(proc->opcodes[X86_OP_RET], 0x00, 0xc3, "ret", read_instr_ret);
+ register_opcode(proc->opcodes[X86_OP_LEAVE], 0x00, 0xc9, "leave", read_instr_leave);
+
register_opcode(proc->opcodes[X86_OP_INT], 0x00, 0xcd, "int", read_instr_int);
@@ -314,7 +317,7 @@ asm_instr *x86_fetch_instruction(const asm_x86_processor *proc, const uint8_t *d
{
result = proc->opcodes[i].read(data, pos, len, offset, proc);
if (result != NULL) result->type = i;
- printf("err while decoding :: [0x%02hhx] 0x%02hhx\n", proc->opcodes[i].prefix, proc->opcodes[i].opcode);
+ else printf("err while decoding :: [0x%02hhx] 0x%02hhx\n", proc->opcodes[i].prefix, proc->opcodes[i].opcode);
break;
}