Stack pointer

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,357件の閲覧回数
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,150件の閲覧回数
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,151件の閲覧回数
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,150件の閲覧回数
Eric_t
Contributor III

Thanks Jens Winkler

It works

Best regards

Nikos

0 件の賞賛
返信