1 Replies - 516 Views - Last Post: 10 August 2017 - 08:57 PM Rate Topic: -----

#1 Rob D  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 10-August 17

Trying to understand the link register

Posted 10 August 2017 - 08:10 PM

Hi Folks,

I am trying to dissassemble an automotive flash file that runs on an MPC555. I have found what I think is the entry point that has a branch always to another address. Here is the code:

ROM:000120A8 Start_0:                                # CODE XREF: Startj
ROM:000120A8                                         # ROM:0000A180j ...
ROM:000120A8                 lhz       r9, -0x35A8(r9)
ROM:000120AC                 lhz       r10, 0x14(r31)
ROM:000120B0                 or        r9, r9, r10
ROM:000120B4                 sth       r9, -0x5904(r12)
ROM:000120B8                 lmw       r29, 0x18+var_C(r1)
ROM:000120BC                 lwz       r0, 0x18+arg_4(r1)
ROM:000120C0                 mtlr      r0
ROM:000120C4                 addi      r1, r1, 0x18
ROM:000120C8                 blr
ROM:000120C8 # End of function sub_11F80


I don't understand what the code is doing here, but I can see a branch to the link register at the end. How do I know what address is in the link register so I can see what code executes next?

And if someone is willing, give me a hint whats happening here... As you can tell I'm brand new at this.

Is This A Good Question/Topic? 0
  • +

Replies To: Trying to understand the link register

#2 Rob D  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 10-August 17

Re: Trying to understand the link register

Posted 10 August 2017 - 08:57 PM

Sorry I don't know why this didn't got to assembly section. Mods please close.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1