RAMSTART =? 0xc880;
RAMEND   =? 0xcbea;
ROMSTART =? 0x0000;
ROMEND   =? 0x8000;
STACKLEN =? 64;

MEMORY
{
  ram : org = RAMSTART, len = RAMEND - RAMSTART
  rom : org = ROMSTART, len = ROMEND - ROMSTART
}

SECTIONS {
	.text: { *(.text) } > rom
	.dtors : { *(.dtors) } > rom
	.ctors : { *(.ctors) } > rom
	.rodata: { *(.rodata) } > rom
	.dpage (NOLOAD): { *(.dpage) } > ram
	.data: { *(.data) } > ram AT> rom
	.bss (NOLOAD) : { *(.bss) } > ram

	__BS = ADDR(.bss);
	__BL = SIZEOF(.bss);
	__DS = ADDR(.data);
	__DC = LOADADDR(.data);
	__DL = SIZEOF(.data);

        __STACK = RAMEND;

	
	__heap = (ADDR(.bss) + SIZEOF(.bss) + 7) / 8 * 8;
	__heapend = __STACK-STACKLEN;
}
