Skip to contentSkip to conversation

program counter...

DISCUSSION Raghava Raju 2 participants 2 messages Aug 17, 2001 – Aug 20, 2001

lore
Share & tools
lore
#0 lore raw

Hi

I was unable to find the registers for
program counter,stack pointer. Which registers
I should use to access these values in powerpc.

Thank You
Raj.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#1 lore raw
Quoted 3 lines · Raghava Raju

I was unable to find the registers for
program counter,stack pointer. Which registers
I should use to access these values in powerpc.

Er, there isn't really an program counter register that you can read. The only way I know to find it out the value of the internal "Next Instruction Address" is to do a bl and then look at the LR (link register) before doing a blr.

As far as the stack pointer goes, the PowerPC ABI (Application Binary Interface) states that gpr1 should be used as the stack pointer and therefor, it is...

Scott Anderson
[email protected] MontaVista Software Inc.
(408)328-9214 1237 East Arques Ave.
http://www.mvista.com Sunnyvale, CA 94085

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/