Put a function into the stack

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

Put a function into the stack

3,312 Views
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!
Labels (1)
0 Kudos
Reply
6 Replies

595 Views
tonyp
Senior Contributor II

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

0 Kudos
Reply

595 Views
Saga
Contributor II
Is this reference manual supposed to be with codewarrior? or where can i find it...? Thank you
0 Kudos
Reply

595 Views
Geezer
Contributor I
0 Kudos
Reply

595 Views
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 Kudos
Reply

595 Views
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 Kudos
Reply

595 Views
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 Kudos
Reply