From df59402724eeae685966eeab5ccaee4518abcbc2 Mon Sep 17 00:00:00 2001 From: Galen Williamson Date: Wed, 9 Apr 2025 18:12:43 -0400 Subject: [mips] always show 0 offset in MIPS operands using Register + Offset Addressing Mode (including when the register r0 is elided) --- arch/mips/arch_mips.cpp | 21 +++++++++------------ 1 file 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, "("); -- cgit v1.3.1