public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* RE: [ECOS] MPC860 PC
@ 2001-07-20  0:26 Nielsen Linus
  0 siblings, 0 replies; 3+ messages in thread
From: Nielsen Linus @ 2001-07-20  0:26 UTC (permalink / raw)
  To: 'Tony Ko', ecos-discuss

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.
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ECOS] MPC860 PC
  2001-07-19  4:49 Tony Ko
@ 2001-07-19 11:46 ` Jonathan Larmour
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Larmour @ 2001-07-19 11:46 UTC (permalink / raw)
  To: Tony Ko; +Cc: ecos-discuss

Tony Ko wrote:
> 
> hi.
> I'm wondering that which register is used for PC (program counter) on
> MPC860.

Sounds like you need a powerPC programming manual, rather than asking on
the eCos list. How about
http://www.mactech.com/articles/mactech/Vol.10/10.08/PowerPcArchitecture/

or just google search on "powerpc architecture manual".

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
Come to the Red Hat TechWorld open source conference in Brussels!
Keynotes, techie talks and exhibitions    http://www.redhat-techworld.com/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ECOS] MPC860 PC
@ 2001-07-19  4:49 Tony Ko
  2001-07-19 11:46 ` Jonathan Larmour
  0 siblings, 1 reply; 3+ messages in thread
From: Tony Ko @ 2001-07-19  4:49 UTC (permalink / raw)
  To: ecos-discuss

hi.
I'm wondering that which register is used for PC (program counter) on
MPC860.

thanks in advance.

Tony.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-07-20  0:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-20  0:26 [ECOS] MPC860 PC Nielsen Linus
  -- strict thread matches above, loose matches on Subject: below --
2001-07-19  4:49 Tony Ko
2001-07-19 11:46 ` Jonathan Larmour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).