This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: MPC860 PC
- To: "'Tony Ko'" <nhko at gctsemi dot com>, ecos-discuss at sources dot redhat dot com
- Subject: RE: [ECOS] MPC860 PC
- From: Nielsen Linus <Linus dot Nielsen at elema dot siemens dot se>
- Date: Fri, 20 Jul 2001 09:22:00 +0200
Hi Tony!
There is no dedicated, readable register for the PC in the
PowerPC as in other architectures. Programs don't generally
need to know the PC anyway.
However, if you really need to find out the PC, you could try
something like this:
bl .tmp ; Branch to the next instruction, saving return address in LR
tmp:
mfspr r3, lr ; Move LR to r3, voila!
This will put the address of the instruction at tmp
in the r3 register. This will of course overwrite the LR
register, so if you are doing this in a subroutine you
will have to save restore LR afterwards.
Regards,
/Linus
> -----Original Message-----
> From: Tony Ko [mailto:nhko@gctsemi.com]
> Sent: den 19 juli 2001 13:50
> To: ecos-discuss@sources.redhat.com
> Subject: [ECOS] MPC860 PC
>
>
> hi.
> I'm wondering that which register is used for PC (program counter) on
> MPC860.
>
> thanks in advance.
>
> Tony.
>
>