summaryrefslogtreecommitdiff
path: root/arch/mips
diff options
context:
space:
mode:
authorGalen Williamson <galen@vector35.com>2025-04-09 18:12:43 -0400
committerGalen Williamson <galen@vector35.com>2025-04-09 18:13:53 -0400
commitdf59402724eeae685966eeab5ccaee4518abcbc2 (patch)
tree6a8e1ed9b04d50d1b1ae4efec99cc2c4f544ead6 /arch/mips
parente3772366504d6d05b4809013cb4f4149ca64c4d4 (diff)
[mips] always show 0 offset in MIPS operands using Register + Offset Addressing Mode (including when the register r0 is elided)
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/arch_mips.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/arch/mips/arch_mips.cpp b/arch/mips/arch_mips.cpp
index 85fbeb36..d7b1d980 100644
--- a/arch/mips/arch_mips.cpp
+++ b/arch/mips/arch_mips.cpp
@@ -847,18 +847,15 @@ public:
break;
case MEM_IMM:
result.emplace_back(BeginMemoryOperandToken, "");
- if (imm != 0)
- {
- if (imm < -9)
- snprintf(operand, sizeof(operand), "-%#x", -imm);
- else if (imm < 0)
- snprintf(operand, sizeof(operand), "-%d", -imm);
- else if (imm < 10)
- snprintf(operand, sizeof(operand), "%d", imm);
- else
- snprintf(operand, sizeof(operand), "%#x", imm);
- result.emplace_back(IntegerToken, operand, imm);
- }
+ if (imm < -9)
+ snprintf(operand, sizeof(operand), "-%#x", -imm);
+ else if (imm < 0)
+ snprintf(operand, sizeof(operand), "-%d", -imm);
+ else if (imm < 10)
+ snprintf(operand, sizeof(operand), "%d", imm);
+ else
+ snprintf(operand, sizeof(operand), "%#x", imm);
+ result.emplace_back(IntegerToken, operand, imm);
if (instr.operands[i].reg == REG_ZERO)
break;
result.emplace_back(BraceToken, "(");