1

I'm currently working on reversing some Sparc code in Ghidra, and calculated register values are shown incorrectly. This is how the line looks in the listing:

add o3, o0=>DAT_00007d88, o0

and I would like it to look like this:

add o3, o0, o0=>DAT_00007d88

This is because the Sparc disassembly has the destination operand as the last register listed. The Instruction info looks like this, with calculated addresses always binding to the first instance of the register.

enter image description here

I'm currently working from a copy of the language spec, so modifying the pspec or cspec is no problem if that is what is needed to fix the issue. The instruction here is just an example, but the issue is generic across the entire instruction set.

EDIT Larger code snippet:

   ram:00004d4c 17 04 b4 14    sethi     %hi(0x12d05000), o3
   ram:00004d50 96 12 e0 e8    or        o3, 0xe8, o3
   ram:00004d54 11 3b 4c 0b    sethi     %hi(0xed302c00), o0
   ram:00004d58 90 12 20 a0    or        o0, 0xa0, o0
   ram:00004d5c 90 02 c0 08    add       o3, o0=>DAT_00007d88, o0                   
2
  • Does ghidra know the value of o3
    – mumbel
    Aug 20 at 16:33
  • Yes. The value shown here, 7d88, is the result of the addition. o3 is 0x12d050E8, and the original value of o0 is 0xed302ca0.
    – Tahg
    Aug 20 at 18:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.