summaryrefslogtreecommitdiff
path: root/src/arch/immediate.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/immediate.c')
-rw-r--r--src/arch/immediate.c20
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;