Em 8/4/2010 21:13, Josh Koffman escreveu:
{Quote hidden}> Hi all. I'm currently using relocatable code, and I'm working on an
> 18f2520. The data memory (GPRs) is divided into 256 byte banks.
>
> I need to define a large area of memory for a buffer. It needs to be
> greater than 256 bytes, and it needs to be contiguous so I can use the
> FSR on it. In absolute mode you could do something like:
>
> CBLOCK 0x100
> Buffer: d'300'
> ENDC
>
> However, I want to use relocatable mode. If I try to "RES" longer than
> a bank, it complains. Is the only solution to do two separate defines
> like this:
>
> Bank1 udata 0x100
> BufferPartA res 0xFF
>
> Bank2 udata 0x200
> BufferPartA res 0x2C
>
> Or is there something I'm missing?
>
> Thanks!
>
> Josh
>
Create a modified linker-script with a bank the size you want, by
linking some 256-byte banks
For instance, change:
DATABANK NAME=gpr0 START=0x80 END=0xFF
DATABANK NAME=gpr1 START=0x100 END=0x1FF
DATABANK NAME=gpr2 START=0x200 END=0x2FF
DATABANK NAME=gpr3 START=0x300 END=0x3FF
DATABANK NAME=gpr4 START=0x400 END=0x4FF
DATABANK NAME=gpr5 START=0x500 END=0x5FF
DATABANK NAME=gpr6 START=0x600 END=0x6FF
DATABANK NAME=gpr7 START=0x700 END=0x7FF
DATABANK NAME=gpr8 START=0x800 END=0x8FF
DATABANK NAME=gpr9 START=0x900 END=0x9FF
DATABANK NAME=gpr10 START=0xA00 END=0xAFF
DATABANK NAME=gpr11 START=0xB00 END=0xBFF
DATABANK NAME=gpr12 START=0xC00 END=0xCFF
DATABANK NAME=gpr13 START=0xD00 END=0xDFF
To:
DATABANK NAME=gpr0 START=0x80 END=0xFF
DATABANK NAME=gpr1_8 START=0x100 END=0x8FF
DATABANK NAME=gpr9 START=0x900 END=0x9FF
DATABANK NAME=gpr10 START=0xA00 END=0xAFF
DATABANK NAME=gpr11 START=0xB00 END=0xBFF
DATABANK NAME=gpr12 START=0xC00 END=0xCFF
DATABANK NAME=gpr13 START=0xD00 END=0xDFF
// Add this:
SECTION NAME=DATA1_8 RAM=gpr1_8
Now you have a data bank that is 0x800 (2K) bytes long.
In you "ASM" file, use:
DATA1_8 udata
Buffer res .2048 ; Please use "radix decimal", this "dot
number" thing is horrible.
Best regards,
Isaac
__________________________________________________
Fale com seus amigos de graça com o novo Yahoo! Messenger
http://br.messenger.yahoo.com/