...SEGMENTS RAM = READ_WRITE 0x3000 TO 0x3FFF; /* unbanked FLASH ROM */ ROM_4000 = READ_ONLY 0x4000 TO 0x7FFF; ROM_C000 = READ_ONLY 0xC000 TO 0xFEFF; /* banked FLASH ROM */ PAGE_3C = READ_ONLY 0x3C8000 TO 0x3CBFFF; PAGE_3D = READ_ONLY 0x3D8000 TO 0x3DBFFF;ENDPLACEMENT _PRESTART, STARTUP, ROM_VAR, STRINGS, VIRTUAL_TABLE_SEGMENT, DEFAULT_ROM, NON_BANKED, COPY INTO ROM_4000, ROM_C000; OTHER_ROM INTO PAGE_3D, PAGE_3C; DEFAULT_RAM INTO RAM;ENDSTACKSIZE 0x100
已解决! 转到解答。
PLACEMENT
_PRESTART, STARTUP,
ROM_VAR, STRINGS,
VIRTUAL_TABLE_SEGMENT,
DEFAULT_ROM , NON_BANKED,
COPY INTO ROM_C000,
ROM_4000,PAGE_3C;
(please notice the order of segments!)
And to ensure the correct PPAGE register settings you have to modify Start12c file (_Startup function)
___INITRM = 0x39; /* lock Ram to end at 0x3FFF */
/* new line to set the correct PPAGE register value */ *(unsigned char *)0x30 = 0x3C;
#ifdef _HCS12_SERIALMON
/* for Monitor based software remap the RAM & EEPROM to adhere
to EB386. Edit RAM and EEPROM sections in PRM file to match these. */
___INITRG = 0x00; /* lock registers block to 0x0000 */
___INITRM = 0x39; /* lock Ram to end at 0x3FFF */
___INITEE = 0x09; /* lock EEPROM block to end at 0x0fff */ #endif "
Hope this helps,
Anders.