how to get stack pointer (SP)

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

how to get stack pointer (SP)

2,726件の閲覧回数
mikoran
Contributor II
can you help me get the value of the stack pointer?
i am working on a module where I would monitor the value of the stack pointer and the program counter upon access violation.
 
I have this code in my interrupt handler:
 
    ISR void CPU12MPU_ISR(void) {
        __asm sts u16sp 
        __asm movw 8,SP,u16pc
       
        S12XAccessViolation_ISR();
    }
 
The problem with this code was it will have an endless loop executing __asm sts u16sp.
 
Is there any way I could get the value of SP?
 
Thanks
ラベル(1)
0 件の賞賛
返信
2 返答(返信)

1,190件の閲覧回数
CrasyCat
Specialist III
Hello
 
What about
   TFR SP, D
   STD u16sp 
 
CrasyCat
0 件の賞賛
返信

1,190件の閲覧回数
mikoran
Contributor II
ok tnx.
it works..
0 件の賞賛
返信