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.
Thanks for that. A useful document. I actually need to have two pieces of code, one (main) piece starting at (e.g) $1000 and the other starting at $0080. I'm using an Atmel 89C51RC2 flash based device and I'm seeing some product returned with the first half page of Flash (0000 to 007F) corrupted to FF. I've determined that this is probably due to poor power supply management. A solution would require some hardware modification which will happen at the next cycle of product review but I need to find a software solution for now. I thought that if I put a piece of code at $0080 (immediately after the area that I've seen corrupted) which rewrites the vectors at the bottom of page zero I can recover the situation. I already use the 'write to flash' routines built into the RC2. 'FF' is a benign instruction which sets up one of the registers so I recon that when the processor starts running from 0000 it will eventually hit the code at $0080, correct the corrupt flash and restart itself. An uncorrupted chip will never see the extra code as it will have a correct reset vector taking it to (e.g) $1000. Does this sound plausible (or possibly naive)?
I've determined that this is probably due to poor power supply management more likely the abscence of a supervisor chip.
Erik