We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi All,
I am trying to write functions at specific locations. I am using KEIL 4 IDE ... and LPC2478 Though I could find a keyword "FIXED" which says one can write function at specific locations, but don't know how to use it .
This is what I want to achieve ....
for eg :
void main(void){ function_1(); function_2();
}
void function_1(){
void function_2(){
I need "function_1()" to be placed at specific location ...say...address 0x2000.
and
I need "function_2()" to be placed at specific location ...say...address 0x4000.
Can this be achieved ....and if yes How can I do this ?
All suggestions are welcome.... (I could not understand how the keyword "FIXED" works )....
Thanks ... K.Ganesh
Per,
Thanks. Using such a table is a more robust solution - I admit that I never thought of doing that. Placing the functions in an absolute location seemed like the "natural" thing to do, but retrospectively, not the best solution. Next time I need to start from scratch, I will implement this system.
Ganesh,
It is better to use the .pdf version from the ARM site. I could not find the exact clause in the online version:
http://www.keil.com/support/man/docs/armlink/armlink_cegbbcjj.htm
<quote> Placing the functions in an absolute location seemed like the "natural" thing to do, but retrospectively, not the best solution. </quote>
Using a jump table:
Microsoft did it back in the 6502 BASIC days to make calls to the MONITOR functions.
The BBC Micro did it to call functions in the OS.
Wheels. They only exist so they can be re-invented.
Kind attn: Mr Per , Mr Tamir,
Can you help us with a sample file ....I went through the link and tried using the scattered file ...
The example suggests different load and execution address ...which will be same in my case....but it does not tell anything about Function relocation...
All suggestions are welcome.
(And I am using KEIL 4 IDE and LPC 2478 ).
Thanks