Subversion Repositories svn.mios


Rev 299 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

// linker script for a MIOS project


CODEPAGE   NAME=vectors    START=0x2C00         END=0x2FFF         PROTECTED
CODEPAGE   NAME=page       START=0x3000         END=0x7FFF
CODEPAGE   NAME=idlocs     START=0x200000       END=0x200007       PROTECTED
CODEPAGE   NAME=config     START=0x300000       END=0x30000D       PROTECTED
CODEPAGE   NAME=eedata     START=0xF00000       END=0xF003FF       PROTECTED

DATABANK   NAME=miosvars   START=0x000          END=0x00f
ACCESSBANK NAME=accessram  START=0x010          END=0x05f
DATABANK   NAME=gpr0       START=0x060          END=0x0FF
DATABANK   NAME=gpr1       START=0x100          END=0x1FF
DATABANK   NAME=gpr2       START=0x200          END=0x2FF
DATABANK   NAME=stack      START=0x300          END=0x37F          PROTECTED
DATABANK   NAME=miosram_u  START=0x380          END=0x5FF          PROTECTED

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=cansfr0    START=0xD00          END=0xDFF          PROTECTED
DATABANK   NAME=cansfr1    START=0xE00          END=0xEFF          PROTECTED
DATABANK   NAME=cansfr2    START=0xF00          END=0xF5F          PROTECTED

ACCESSBANK NAME=accesssfr  START=0xF60          END=0xFFF          PROTECTED

SECTION    NAME=forcebanked     RAM=gpr0

// Use:
// gpr0 is not available for indirect memory access
// To work around this, we will try to force all banked accesses into gpr0// 
// To do this, use the 'udata' pragma like so:
// #pragma udata forcebanked MyVar
// unsigned char MyVar;
// Scalar variables will always use banked access, so they should be assigned to gpr0 as above
// Aggregate types (arrays, structs) should not be stored here as they will use indirect addressing