diff options
Diffstat (limited to 'src/arch/x86')
-rw-r--r-- | src/arch/x86/operand.c | 15 | ||||
-rw-r--r-- | src/arch/x86/processor.c | 2 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/arch/x86/operand.c b/src/arch/x86/operand.c index a028dc2..38e1468 100644 --- a/src/arch/x86/operand.c +++ b/src/arch/x86/operand.c @@ -179,7 +179,7 @@ asm_x86_operand *create_new_x86_operand(void) * * * Retour : true si la définition est opérée, false sinon. * * * -* Remarques : - * +* Remarques : - * * * ******************************************************************************/ @@ -409,7 +409,7 @@ asm_x86_operand *x86_create_content1632_operand(const uint8_t *data, off_t *pos, case 0x40: result->displacement = create_new_x86_operand(); - if (!fill_imm_operand(ASM_OPERAND(result->displacement), AOS_8_BITS, data, pos, len)) + if (!fill_imm_operand(ASM_OPERAND(result->displacement), AOS_8_BITS_SIGNED, data, pos, len)) { (*pos) -= 2; free(result->displacement); @@ -420,7 +420,7 @@ asm_x86_operand *x86_create_content1632_operand(const uint8_t *data, off_t *pos, case 0x80: result->displacement = create_new_x86_operand(); - if (!fill_imm_operand(ASM_OPERAND(result->displacement), AOS_32_BITS, data, pos, len)) + if (!fill_imm_operand(ASM_OPERAND(result->displacement), AOS_32_BITS_SIGNED, data, pos, len)) { (*pos) -= 2; free(result->displacement); @@ -572,7 +572,7 @@ asm_x86_operand *x86_create_rm8_operand(const uint8_t *data, off_t *pos, off_t l case 0x40: result->displacement = create_new_x86_operand(); - if (!fill_imm_operand(ASM_OPERAND(result->displacement), AOS_8_BITS, data, pos, len)) + if (!fill_imm_operand(ASM_OPERAND(result->displacement), AOS_8_BITS_SIGNED, data, pos, len)) { free(result->displacement); free(result); @@ -766,7 +766,7 @@ asm_x86_operand *x86_create_rm1632_operand(const uint8_t *data, off_t *pos, off_ case 0x40: result->displacement = create_new_x86_operand(); - if (!fill_imm_operand(ASM_OPERAND(result->displacement), AOS_8_BITS, data, pos, len)) + if (!fill_imm_operand(ASM_OPERAND(result->displacement), AOS_8_BITS_SIGNED, data, pos, len)) { free(result->displacement); free(result); @@ -776,7 +776,7 @@ asm_x86_operand *x86_create_rm1632_operand(const uint8_t *data, off_t *pos, off_ case 0x80: result->displacement = create_new_x86_operand(); - if (!fill_imm_operand(ASM_OPERAND(result->displacement), AOS_32_BITS, data, pos, len)) + if (!fill_imm_operand(ASM_OPERAND(result->displacement), AOS_32_BITS_SIGNED, data, pos, len)) { free(result->displacement); free(result); @@ -1092,7 +1092,8 @@ void x86_print_reg_operand(const asm_x86_operand *operand, char *buffer, size_t if (operand->displacement != NULL) { - strcat(buffer, "+"); /* TODO: n */ + if (is_imm_operand_negative(operand->displacement)) strcat(buffer, "-"); + else strcat(buffer, "+"); pos = strlen(buffer); print_imm_operand(operand->displacement, &buffer[pos], len - pos, syntax); diff --git a/src/arch/x86/processor.c b/src/arch/x86/processor.c index 8be503c..820c6a1 100644 --- a/src/arch/x86/processor.c +++ b/src/arch/x86/processor.c @@ -494,7 +494,7 @@ void x86_print_instruction(const asm_x86_processor *proc, const exe_format *form case AOT_IMM: print_imm_operand(ASM_OPERAND(ASM_INSTRUCTION(instr)->operands[i]), opbuffer[i], 256, syntax); - offset = ASM_OPERAND(ASM_INSTRUCTION(instr)->operands[i])->value.val32; /* FIXME !!! */ + offset = ASM_OPERAND(ASM_INSTRUCTION(instr)->operands[i])->unsigned_imm.val32; /* FIXME !!! */ if (ASM_OPERAND(ASM_INSTRUCTION(instr)->operands[i])->size == proc->operand_size && resolve_exe_symbol(format, &label, &symtype, &offset)) |