How can i read sp of s12zvl 32

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can i read sp of s12zvl 32

Jump to solution
736 Views
ahnjoseph
Contributor III

How can i read a SP of s12zvl32

 

I need monitor a SP for protection of Stack overflow

Labels (1)
1 Solution
610 Views
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

View solution in original post

2 Replies
611 Views
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

610 Views
ahnjoseph
Contributor III

Thank you So much !

Now, I can do reading a stack ADDR.

0 Kudos