diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2009-05-31 20:58:20 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2009-05-31 20:58:20 (GMT) |
commit | 8724afdc73e0ddad86f46de1a3fbe0254575a76e (patch) | |
tree | de666b66e154c6c6453807d3fa4272efb6877a91 /src/arch/immediate.c | |
parent | 0b7d7f26c745ff0f52e9e483a0980351368ca824 (diff) |
Supported a new architecture (MIPS).
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@67 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/immediate.c')
-rw-r--r-- | src/arch/immediate.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/arch/immediate.c b/src/arch/immediate.c index 7ef1220..f8c2474 100644 --- a/src/arch/immediate.c +++ b/src/arch/immediate.c @@ -370,16 +370,28 @@ static char *g_imm_operand_get_text(const GImmOperand *operand, const exe_format snprintf(result, 19, "0x%llx", operand->unsigned_imm.val64); break; case AOS_8_BITS_SIGNED: - snprintf(result, 19, "0x%hhx", ~operand->signed_imm.val8 + 1); + if (g_imm_operand_is_negative(operand)) + snprintf(result, 19, "0x%hhx", ~operand->signed_imm.val8 + 1); + else + snprintf(result, 19, "0x%hhx", operand->signed_imm.val8); break; case AOS_16_BITS_SIGNED: - snprintf(result, 19, "0x%hx", ~operand->signed_imm.val16 + 1); + if (g_imm_operand_is_negative(operand)) + snprintf(result, 19, "0x%hx", ~operand->signed_imm.val16 + 1); + else + snprintf(result, 19, "0x%hx", operand->signed_imm.val16); break; case AOS_32_BITS_SIGNED: - snprintf(result, 19, "0x%x", ~operand->signed_imm.val32 + 1); + if (g_imm_operand_is_negative(operand)) + snprintf(result, 19, "0x%x", ~operand->signed_imm.val32 + 1); + else + snprintf(result, 19, "0x%x", operand->signed_imm.val32); break; case AOS_64_BITS_SIGNED: - snprintf(result, 19, "0x%llx", ~operand->signed_imm.val64 + 1); + if (g_imm_operand_is_negative(operand)) + snprintf(result, 19, "0x%llx", ~operand->signed_imm.val64 + 1); + else + snprintf(result, 19, "0x%llx", operand->signed_imm.val64); break; } break; |