I'd like to reposition my code so all code starts at 0800h. The only things I want below that are the startup vector and interrupt vectors. Am I right in assuming that the vector at locn 0000 (actually an LJMP address) cannot be relocated as this is the start point after a reset? Is it also true that the interrupt vectors are similarly fixed? Using uVision.
the easy way would be to get another PC (trying this on a PC with licenced Keil may/will get you in trouble) and download the Keil software in eval mode. Everything will have the vectors relocated to 0x800
Erik
CSEG at XXXX in the startup code specifies where the reset and interrupt vectors are located (relative to XXXX). So, CSEG at 0000h locates the reset vector at 0000h, interrupt 0 at 0003h, interrupt 1 at 000Bh, and so on. These are ABSOLUTE segments that are located at absolute (physical) addresses.
The CODE linker directive specifies where to start locating the RELOCATABLE code (the stuff generated by the compiler and from the library files). So, if you specify CODE(0x1000) the linker will put all of the relocatable code segments starting up at 1000h.
If you look inside the STARTUP.A51 file you'll find that the "startup code" that's in there is placed in a relocatable segment most likely with an RSEG (from what I recall). That code will get lumped in with all the other relocatable code and stored up at 1000h.
Hopefully, these tips help. I think I got it all correct.
Jon Ward