Home arrow Support arrow Forums

Luminary Micro Forums

blechman

Senior Boarder

2008/08/13 16:53

Re:stack pointer access?

Hello all... I just got the problem solved with help from Luminary's tech support:

In my ISR i used the inline assembler:

__asm("MOV r0, sp");
__asm("BL StackAccess");

to pass the Stack Pointer to a function:

void StackAccess(unsigned long *sptr)
{
printf(" pc = 0x%08Xn", sptr[6]);
}

which prints out the value of the PC (offset from the current stack pointer by 24).

I thought this was very helpful and wanted to share with all.

Thanks!

login or register to reply

      Topics Author Date
    thread link
stack pointer access?
blechman 2008/08/12 13:46
    thread link
thread linkthread link Re:stack pointer access?
ravaz 2008/08/13 11:27
    thread link
thread linkthread linkthread link Re:stack pointer access?
blechman 2008/08/13 12:54
    thread link
thread linkthread linkthread linkthread link Re:stack pointer access?
blechman 2008/08/13 16:53
    thread link
thread linkthread linkthread linkthread linkthread link Re:stack pointer access?
ravaz 2008/08/13 19:49
    thread link
thread linkthread linkthread linkthread linkthread link Re:stack pointer access?
joseph_yiu 2008/08/14 04:41
    thread link
thread linkthread linkthread linkthread linkthread linkthread link Re:stack pointer access?
blechman 2008/08/14 12:00