Re: Accessing the PC
alex shulman <[email protected]>
| Newsgroups | gmane.comp.hardware.motorola.microcontrollers |
|---|---|
| Message-ID | <[email protected]> |
Hi,
There is no architectural instruction to read the PC.
But here the trick code:
bl here
here:
mflr Rx
...
there:
...
Rx will contain absolute address of the lable "here"
if you'll need the absolute address of lable "there"
you can calculate this by following code:
addi Ry, Rx, there - here
Ry will contain absolute address of "there"
Of course, "there" and "here" should be defined in one
code section and be less than 32KB apart.
Regards
Alex.
--- Terry Hansen <[email protected]> wrote:
> 555 Gurus -
>
> Is there a way to access the contents of the PC?
> i.e a variation on the mfspr instruction?
>
> Thanks for the help.
>
> Terry Hansen
> Computer Engineer
> Compact Power - Monument CO
> [email protected]
> 719.488.1600 x 136
>
>
>
>
>
>
> [Non-text portions of this message have been
> removed]
>
>
__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/
-----------------------------------------------------------
To learn more about Freescale Microcontrollers, please visit
http://www.freescale.com/mcu
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/MPC500/
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/