HI,
On 12/4/05, Larry Barello <yahoo@barello.net> wrote:
> The only way to get the PC is to interrupt the processor. The PC will be on
> the stack upon entry into the ISR. WDT will reset the processor and you
> will lose your PC.
Every time you call a subroutine, the PC is pushed onto the stack.
Therefore you should be able to write a simple assembler function like
this:
GetPC:
pop r24
pop r25
push r25
push r24
ret
I haven't tested the above, bbut I think that I got the order right
r24=LSB, r25=MSB
--
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/Message
Re: [AVR-Chat] Getting The Program Counter in C
2005-12-04 by Dave Hylands