Put a function into the stack

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

Put a function into the stack

4,324 次查看
Saga
Contributor II
Hi to all, i was wondering is there any way to put a function into the stack? This function (as you may guess) is for writing into the flash.

Thanks for your help!
标签 (1)
0 项奖励
回复
6 回复数

1,607 次查看
tonyp
Senior Contributor II

See the example code given in Fig. 4-12 of the HCS08 Family Reference Manual.

0 项奖励
回复

1,607 次查看
Saga
Contributor II
Is this reference manual supposed to be with codewarrior? or where can i find it...? Thank you
0 项奖励
回复

1,607 次查看
Geezer
Contributor I
0 项奖励
回复

1,607 次查看
CompilerGuru
NXP Employee
NXP Employee

There are some technical notes on this topic.

TN 235: Running Portion of the Application from Stack
TN 228: Running Portion of the Application in RAM

Daniel

 

TN228.pdf

TN235.pdf

Message Edited by t.dowe on 2009-09-24 03:18 PM
0 项奖励
回复

1,607 次查看
Geezer
Contributor I
Putting a function on the stack is equivalent to placing it in RAM, so here's another way:
Define an array of RAM bytes, copy down the routine bytes from your ROM space, in C-code use an "__asm JSR xxxx" to that location.
0 项奖励
回复

1,607 次查看
Saga
Contributor II
Thank you geezer, i would like to know how can i know (from code) which is the size of the function i want to put into the RAM. Yes im using C language. Thank you!
0 项奖励
回复