在main.c文件中
#pragma CONST_SEG ARRAY_BUFFER
const byte speed=0x5a;
#pragma CONST_SEG DEFAULT
void main(void) {
EnableInterrupts;
for(;;) {
__RESET_WATCHDOG();
}
}
project.prm文件中
/* This is a linker parameter file for the mc9s08aw16 */
NAMES END /* CodeWarrior will pass all the needed files to the linker by command line. But here you may add your own files too. */
SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */
Z_RAM = READ_WRITE 0x0070 TO 0x00FF;
RAM = READ_WRITE 0x0100 TO 0x01FF;
MYRAM = READ_WRITE 0X0200 TO 0X046F;
ROM = READ_ONLY 0xC000 TO 0xDFFF;
MYROM = READ_ONLY 0XE000 TO 0XFFAF;
ROM1 = READ_ONLY 0xFFC0 TO 0xFFCB;
//FUNCTIONROM = READ_ONLY 0XFFCC TO 0XFFFB;
/* INTVECTS = READ_ONLY 0xFFCC TO 0xFFFF; Reserved for Interrupt Vectors */
END
PLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */
ARRAY_BUFFER INTO MYROM;
CODE_BUFFER INTO ROM1;
DATA_BUFFER INTO MYRAM ;
DEFAULT_RAM /* non-zero page variables */
INTO RAM;