1 Replies - 2704 Views - Last Post: 14 September 2017 - 12:23 PM

#1 Rob D  Icon User is offline

  • New D.I.C Head

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

Link register question

Posted 10 August 2017 - 09:01 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: Link register question

#2 turboscrew  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 152
  • View blog
  • Posts: 1,032
  • Joined: 03-April 12

Re: Link register question

Posted 14 September 2017 - 12:23 PM

ROM:000120BC                 lwz       r0, 0x18+arg_4(r1)
	ROM:000120C0                 mtlr      r0


I don't know what's in r1.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1