/* This is a linker parameter file for the JL8 */ NAMES END /* CodeWarrior will pass all the needed files to the linker by command line. But here you may add your own files too. */
SECTIONS /* here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */ Z_RAM = READ_WRITE 0x0060 TO 0x00FF; RAM = READ_WRITE 0x0100 TO 0x015F; ROM = READ_ONLY 0xDC00 TO 0xFBFF; END
PLACEMENT /* here all predefined and user segments are placed into the SECTIONS defined above. */ DEFAULT_ROM INTO ROM; DEFAULT_RAM INTO RAM; _DATA_ZEROPAGE, MY_ZEROPAGE INTO Z_RAM; END
STACKSIZE 0x30
VECTOR 0 _Startup /* reset vector: this is the default entry point for a C/C++ application. */ //VECTOR 0 Entry /* reset vector: this is the default entry point for a Assembly application. */ //INIT Entry /* for assembly applications: that this is as well the initialisation entry point */
实际上这个名字在C语言文件中可以随便取,只要在PRM文件里写明对应的内存区即可。例如你可以写程序: #pragma DATA_SEG SHORT YEWUYI_PAGE0 byte arg1; 然后修改PRM文件标明: _DATA_ZEROPAGE, MY_ZEROPAGE, YEWUYI_PAGE0 INTO Z_RAM;
* 定义变量段使其在复位初始化时不被自动清零(C语言编程) SECTIONS /* here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */ Z_RAM = READ_WRITE 0x0060 TO 0x00FF; RAM_SV = NO_INIT 0x0100 TO 0x011F; /*非自动清零段*/ RAM = READ_WRITE 0x0120 TO 0x015F; ROM = READ_ONLY 0xDC00 TO 0xFBFF; END 在PLACEMENT声明中写 RAM_KEEP INTO RAM_SV; 程序中定义: #pragma DATA_SEG RAM_KEEP byte arg1;
* 保留一段Flash作为EEPROM模拟 SECTIONS /* here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */ Z_RAM = READ_WRITE 0x0060 TO 0x00FF; RAM = READ_WRITE 0x0120 TO 0x015F; EEPROM = READ_ONLY 0xDC00 TO 0xDDFF; /*保留512字节做EEPROM模拟*/ ROM = READ_ONLY 0xDE00 TO 0xFBFF; END 在PLACEMENT声明中写 EE_DATA INTO EEPROM; 程序中定义数据并可以初始化 #pragma CONST_SEG EE_DATA const byte str1[]="123456";