How can i read sp of s12zvl 32

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How can i read sp of s12zvl 32

跳至解决方案
990 次查看
ahnjoseph
Contributor III

How can i read a SP of s12zvl32

 

I need monitor a SP for protection of Stack overflow

标签 (1)
1 解答
864 次查看
MJW
NXP Employee
NXP Employee

Hello,

assuming I understand the requirement correctly, the code to read the

current stack-pointer would look similar to this:

/*declaration*/

void *copy_of_stack_ptr;

...

     /*copy stack pointer*/

     asm {

          ST     S,copy_of_stack_ptr

     }

...

HTH,

MJW

在原帖中查看解决方案

2 回复数
865 次查看
MJW
NXP Employee
NXP Employee

Hello,

assuming I understand the requirement correctly, the code to read the

current stack-pointer would look similar to this:

/*declaration*/

void *copy_of_stack_ptr;

...

     /*copy stack pointer*/

     asm {

          ST     S,copy_of_stack_ptr

     }

...

HTH,

MJW

864 次查看
ahnjoseph
Contributor III

Thank you So much !

Now, I can do reading a stack ADDR.

0 项奖励
回复