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
712 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
586 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
587 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

586 Views
ahnjoseph
Contributor III

Thank you So much !

Now, I can do reading a stack ADDR.

0 Kudos