Stack pointer

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

Stack pointer

跳至解决方案
1,361 次查看
Eric_t
Contributor III

Hi everybody,

 

I am using HCS12 controllers and Codewarrior v3.1.

Is it possible to read the current position of the SP and put it in a integer variable?

 

Thanks

Nikos

标签 (1)
0 项奖励
回复
1 解答
1,154 次查看
MJW
NXP Employee
NXP Employee

Hello Nikos,

you can, for example, try this:

/*declaration*/

unsigned short oldsp;


...

     /* save current SP */

     asm {

          STS oldsp

     }

...

Best Regards.

MJW

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,155 次查看
MJW
NXP Employee
NXP Employee

Hello Nikos,

you can, for example, try this:

/*declaration*/

unsigned short oldsp;


...

     /* save current SP */

     asm {

          STS oldsp

     }

...

Best Regards.

MJW

0 项奖励
回复
1,154 次查看
Eric_t
Contributor III

Thanks Jens Winkler

It works

Best regards

Nikos

0 项奖励
回复