资 源 简 介
不是原创,但原地址找不到了,向作者致敬!
SEGMENTS
RAM_DEF = READ_WRITE 0x3C00 TO 0x3EFF;
RAM_CODE = READ_ONLY 0x2000 TO 0x3BFF;
ROM = READ_ONLY 0xE000 TO 0xFEFF;
...
/* relocated memory */
BOOTLOADER_MEM = READ_ONLY 0xC000 TO 0xDBFF
RELOCATE_TO 0x2000 ;
END
PLACEMENT
NON_BANKED,
...
COPY
INTO ROM;
BOOT_SEG INTO BOOTLOADER_MEM;
...
END__EXTERN_C void _Startup(void ) {
...
MoveBootLoader();
main();
}
void MoveBootLoader(void)
{
unsigned int *pRom, *pRam;
int cnt=3584; //3.5K word, 7K byte