public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Nielsen Linus <Linus.Nielsen@elema.siemens.se>
To: "'Tony Ko'" <nhko@gctsemi.com>, ecos-discuss@sources.redhat.com
Subject: RE: [ECOS] MPC860 PC
Date: Fri, 20 Jul 2001 00:26:00 -0000	[thread overview]
Message-ID: <63E7EC6F3685D311B640080006279198066A0615@VISBUR> (raw)

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

             reply	other threads:[~2001-07-20  0:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-20  0:26 Nielsen Linus [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-07-19  4:49 Tony Ko
2001-07-19 11:46 ` Jonathan Larmour

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=63E7EC6F3685D311B640080006279198066A0615@VISBUR \
    --to=linus.nielsen@elema.siemens.se \
    --cc=ecos-discuss@sources.redhat.com \
    --cc=nhko@gctsemi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).