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?
"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()
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.