summaryrefslogtreecommitdiff
path: root/src/arch/x86/op_mov.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86/op_mov.c')
-rw-r--r--src/arch/x86/op_mov.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/arch/x86/op_mov.c b/src/arch/x86/op_mov.c
index db731bb..d0a1bfc 100644
--- a/src/arch/x86/op_mov.c
+++ b/src/arch/x86/op_mov.c
@@ -65,27 +65,27 @@ asm_x86_instr *read_instr_mov_with_reg1632(const uint8_t *data, off_t *pos, off_
ASM_INSTRUCTION(result)->opcode = data[(*pos)++];
- /* TODO ! */
- if ((data[*pos] & 0xc0) != 0xc0)
- return NULL;
-
- reg1 = x86_create_reg1632_operand_from_modrm(data[*pos], oprsize == AOS_32_BITS, true);
- if (reg1 == NULL)
+ reg2 = x86_create_reg1632_operand_from_modrm(data[*pos], oprsize == AOS_32_BITS, false);
+ if (reg2 == NULL)
{
free(result);
return NULL;
}
- reg2 = x86_create_reg1632_operand_from_modrm(data[*pos], oprsize == AOS_32_BITS, false);
- if (reg2 == NULL)
+ if ((data[*pos] & 0xc0) == 0xc0)
+ {
+ reg1 = x86_create_reg1632_operand_from_modrm(data[*pos], oprsize == AOS_32_BITS, true);
+ (*pos)++;
+ }
+ else reg1 = x86_create_content1632_operand(data, pos, len, oprsize == AOS_32_BITS, true);
+
+ if (reg1 == NULL)
{
free(result);
- free(reg1);
+ free(reg2);
return NULL;
}
- (*pos)++;
-
ASM_INSTRUCTION(result)->operands = (asm_operand **)calloc(2, sizeof(asm_operand *));
ASM_INSTRUCTION(result)->operands_count = 2;