
Cross-Compiler word set question
On Fri, 27 Sep 2002 14:20:31 +0400, "Michael L.Gassanenko"
Quote:
>The proposal defined 3 types of target sections:
>CData IData UData.
>I remember that I interpreted CData as "ROM code and data"
>but now I think that probably what was meant is just "constant data"
>and this type of sections may have no relation to ROM code.
>For example, on IIRC AVR the ROM data may reside in the 1st 64K
>segment, while the code may be in the code memory above 64K
>(that memory is execute-only anyway).
>But I *have to specify the target memory map* before compiling any
>target code. I have to specify where the code must be located.
>Questions:
>How this should be done in the dpStandard-compliant way?
>How this is done on MPE and FORTH Inc's compilers?
>((
>My current solution that works well on the current board is:
>$0000 $Cfff CDATA SECTION allcrom
>' allcrom IDATA ALIAS-SECTION alliram
>' alliram UDATA ALIAS-SECTION alluram
CDATA spaces refer to code areas, basically read/execute.
IDATA refers to read/write space that is automagically
initialised.
UDATA refers to read/write space that is NOT initialised
at cross compile time.
The intention on Harvard targets (e.g. AVR and 8051) is
that CDATA describes the type of the CODE area, and UDATA
and IDATA refer to the RAM space. If you need a third
address space you'll have to invent an xDATA name for
yourself.
In a machine with a single adress space all three types
live in the same address space.
In your example, you don't say whether AVR CDATA addresses
are 16 bit or 8 bit addresses. Assuming that you have 128 kb
Flash that is byte addressed by the cross compiler, you
could define:
$00000 $0ffff CDATA SECTION dataspace
$10000 $1ffff CDATA SECTION codespace
$0000 $00FF UDATA SECTION reserved
$0100 $07FF UDATA SECTION initialised
$0800 $0FFF IDATA SECTION uninitialised
\ Now select one section of each type to be current
codespace initilised uninitialised
Stephen
--
MicroProcessor Engineering Ltd - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691
web: http://www.mpeltd.demon.co.uk - free VFX Forth downloads