Re: code directive question

Peter Onion <[email protected]>
Newsgroups gmane.comp.hardware.microcontrollers.gnupic
Message-ID <[email protected]>
On Fri, 2005-09-09 at 12:04 -0400, Ben Dugan wrote:
> > That's because interrupt vectors ARE NOT relocatable ;)
> > 
> > Try using relocation for some code that can be relocated and you'll
> > start to see the advantages.
> 
> 
> Yes, I understand that.  But I thought one advantage would be that I 
> could write the program in such a way that I could move it, say, from a 
> picdem board (with its linker script) to some other board or chip 
> architecture (with a different linker script) and just changing the 
> linker script would relocate things correctly.

It will do.  You'll have to name the segment you want to go in fixed
places and use the linker script to place it at the desired location for
the different targets.

I don't have the linker scripts to hand at the moment so I can't look
for an example but there are probably some segments already named for
the reset and interrupt vectors.

Peter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.