I would like to fix an address to start my code always at the same address. I have all books C51, A51, BL51, etc but I've lost my L51 book... I use in the option file of linker the instruction CODE(4000H). It works but it's not enough: I want to specify the address (for example 4100H) of the main() function. I supposed we need to specify the order of files linked and the address of my first file to link... but I don't know how?! Please, could you help me?
This solution seams to be OK: CODE(4000h, ?PR?MAIN?FILE1(4100h)) My code is located from 4000h, and my main() written in file1.c is located from 4100h address.
"I need to put my code from 4000H" That sounds like a fixed address to me!? The knowledge base article refers to locating items at a fixed address in code space - that sounded like what you want to do? You can follow the same technique to fix the location (ie, address) of main()
my question concerns the code not a fixed memory address. Here is my need: my software is downloaded by a boot program. After download a JMP instruction is executed to a fixed address (i.e 4100H) where the code of my main() is located. I need to put my code from 4000H, where 4100H is the address of the main(). How?
First, all the manuals (in PDF) are accessible via the 'Books' tab in the uVision Project window See the thread "preset of a code-byte" http://www.keil.com/forum/msgpage.asp?MsgID=2645 - it contains some links to app notes about using the Linker for such things.
View all questions in Keil forum