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.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/src/arch/immediate.c b/src/arch/immediate.c
index 876fa88..dde5f02 100644
--- a/src/arch/immediate.c
+++ b/src/arch/immediate.c
@@ -351,21 +351,29 @@ static char *g_imm_operand_get_text(const GImmOperand *operand, const exe_format
snprintf(result, 19, "$0x???");
break;
case AOS_8_BITS_UNSIGNED:
- case AOS_8_BITS_SIGNED:
snprintf(result, 19, "0x%hhx", operand->unsigned_imm.val8);
break;
case AOS_16_BITS_UNSIGNED:
- case AOS_16_BITS_SIGNED:
snprintf(result, 19, "0x%hx", operand->unsigned_imm.val16);
break;
case AOS_32_BITS_UNSIGNED:
- case AOS_32_BITS_SIGNED:
snprintf(result, 19, "0x%x", operand->unsigned_imm.val32);
break;
case AOS_64_BITS_UNSIGNED:
- case AOS_64_BITS_SIGNED:
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);
+ break;
+ case AOS_16_BITS_SIGNED:
+ snprintf(result, 19, "0x%hx", ~operand->signed_imm.val16 + 1);
+ break;
+ case AOS_32_BITS_SIGNED:
+ snprintf(result, 19, "0x%x", ~operand->signed_imm.val32 + 1);
+ break;
+ case AOS_64_BITS_SIGNED:
+ snprintf(result, 19, "0x%llx", ~operand->signed_imm.val64 + 1);
+ break;
}
break;
@@ -376,21 +384,29 @@ static char *g_imm_operand_get_text(const GImmOperand *operand, const exe_format
snprintf(result, 19, "$0x???");
break;
case AOS_8_BITS_UNSIGNED:
- case AOS_8_BITS_SIGNED:
snprintf(result, 19, "$0x%hhx", operand->unsigned_imm.val8);
break;
case AOS_16_BITS_UNSIGNED:
- case AOS_16_BITS_SIGNED:
snprintf(result, 19, "$0x%hx", operand->unsigned_imm.val16);
break;
case AOS_32_BITS_UNSIGNED:
- case AOS_32_BITS_SIGNED:
snprintf(result, 19, "$0x%x", operand->unsigned_imm.val32);
break;
case AOS_64_BITS_UNSIGNED:
- case AOS_64_BITS_SIGNED:
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);
+ break;
+ case AOS_16_BITS_SIGNED:
+ snprintf(result, 19, "$0x%hx", ~operand->signed_imm.val16 + 1);
+ break;
+ case AOS_32_BITS_SIGNED:
+ snprintf(result, 19, "$0x%x", ~operand->signed_imm.val32 + 1);
+ break;
+ case AOS_64_BITS_SIGNED:
+ snprintf(result, 19, "$0x%llx", ~operand->signed_imm.val64 + 1);
+ break;
}
break;