piclist 2008\07\06\095637a >
Thread: Code packing
face picon face BY : email (remove spam text)(Olin Lathrop)

Jan-Erik Soderholm wrote:
> Well, changing the line into "STARTUP CODE  h'0000'
> put it right.
> Or (if one prefer a no-hardcoded-addreses-at-all
> source code) one can add a named section to the LKR.

I think in this case the section addresses should be fixed int the source
code.  If you want you can define constants for the two absolute addresses
dictated by the hardware.

Using sections bound to specific memory regions in the linker file for this
purpose is bad for two reasons.  First, it requires that a separate memory
region is defined.  This breaks up the otherwise contiguous page 0
needlessly, and you have to guess how long you will need for the interrupt
routine.  Second, it only guarantees that the code will go somewhere in the
section, not specifically at its starting address.  If you only have one
code section, then it will be placed at the beginning.  But this won't catch
accidental collisions with if multiple pieces of source accidentally use the
same section or try to place code at colliding specific addresses.  If the
fixed address is specified in the source file, then that code will be placed
there or you will get a link error.

Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.
<001001c8df70$6bc7da50$0300a8c0@main> 7bit

See also: www.piclist.com/techref/microchip/devices.htm?key=pic
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Code packing

month overview.

new search...