gnupic: [gnupic] Differend data segment types
Subject:
Re: [gnupic] Differend data segment types
From:
Craig Franklin ####@####.####
Date:
22 May 2005 02:12:13 +0100
Message-Id: <428FDCC2.4070601@users.sourceforge.net>
Peter Onion wrote:
>I'm a little unsure what the various "udata" segment types mean in
>relocation mode, and the gputils manual isn't particularly helpful.
>
>
>
The mpasm/mplink/mplib manual has a pretty good description. A copy is
on the gputils website.
>UDATA I understand but what are UDATA_ACS,UDATA_OVR and UDATA_SHR
>for ?
>
>
>
udata - Use databank memory.
udata_shr - Use sharebank memory.
udata_acs - Use access bank.
udata_ovr - This is an overlay section. All overlay sections with the
same name, within the same object, are forced to start at the same
address. This is a simple way to save memory.
>Also, for preformance reasons I'de like to be able to have a data
>segment that I know is in bank 0, but which I can add variables to from
>differnet modules. I can't work out how to do this.
>
>
>
There are a few of options:
1. Name the sections so they will be combined before relocation. This
won't guarantee they are in bank 0, but it does guarantee they are in
the same bank. That is usually what you care about. This has the least
impact on the linker.
2. Create a logical section in bank one and use that logical name as
the section name. A little more linker impact, but the data is
guaranteed to be in bank 0.
3. Make the section absolute. This is done my adding an address to
the section. Often this is the first thing people try. This is the
worst option from the linker perspective. Its hands are tied and it
could make the code not fit in the target device.
Here is an example of #2.
Use this file:
processor 16f877
DATA1 udata
buffer res 1
end
Use this linker script:
include 16f877a.lkr
SECTION NAME=DATA1 RAM=gpr0
SECTION NAME=DATA2 RAM=gpr1
SECTION NAME=DATA3 RAM=gpr2
SECTION NAME=DATA4 RAM=gpr3
NOTE: Doing this uncovered a little bug. I am not using the default
script path on scripts included from scripts. I have fixed it. The
change will be in cvs shortly. In the mean time, copy the file to your
current directory.
>Peter
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ####@####.####
>For additional commands, e-mail: ####@####.####
>
>
>
>