⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 custom_lnk8lgl1.xcl

📁 COP8 CPU的一个解释型BASIC源码
💻 XCL
字号:
/************************************************************************/
/*                        lnk8lgl1.xcl                                  */
/*                                                                      */
/* XLINK command file to be used with the COP8 C-compiler (ICCCOP8)	*/
/*                                                                      */
/* Usage:  xlink  your_file(s)  -f lnk8xx 	                        */
/*                                                                      */
/* Large memory model related linker command files:			*/
/*                                                                      */
/*	lnk8lds1.xcl	(default)					*/
/*	lnk8ldl1.xcl	--large_call					*/
/*	lnk8lgs1.xcl	--generic_pointer				*/
/*	lnk8lgl1.xcl	--large_call --generic_pointer			*/
/*                                                                      */
/*      NOTE1:  Be sure to use end values for the defined addresses.    */
/*                                                                      */
/*      NOTE2:  Make sure that your XLINK_DFLTDIR environment           */
/*              variable points to the compiler 'lib' directory.        */
/*                                                                      */
/*      (c) Copyright IAR Systems 1998       		                */
/*                                                                      */
/************************************************************************/

/* 
 * $Revision: 1.6 $
 */


/************************************************************************/
/*      Define CPU                                                      */
/************************************************************************/

-ccop8


/************************************************************************/
/* Insert jmp instruction to CSTARTUP code. 				*/
/*									*/
/* This may be removed if the CSTART and FAR initializing segments is   */
/* smaller than 0xFE bytes. In that case move the CSTART and FAR  	*/
/* segments to start directly at address 0, see any small or medium 	*/
/* memory model link file. The load of the reset or resetl object file 	*/
/* at the end of this file must then be omitted.			*/
/************************************************************************/

-Z(CODE)RESET=0000-0002


/************************************************************************/
/* Declare the CSTART segment and the special FAR initializing 		*/
/* segments. Here we use the third and fourth code page for this.	*/
/*									*/
/* IMPORTANT: It is not allowed to use the -P option on the CSTART 	*/
/* segment, since this may cause the cstartup routine to malfunction.   */
/*                                                                      */
/* -Z(CODE)CSTART,FAR_ID_START,FAR_ID,FAR_ID_END,\                      */
/* FAR_ZI_START,FAR_ZI,FAR_ZI_END=0300-04FF                             */
/************************************************************************/
/* changed to use the eighth and nineth code page                       */
/************************************************************************/

-Z(CODE)CSTART,FAR_ID_START,FAR_ID,FAR_ID_END,\
FAR_ZI_START,FAR_ZI,FAR_ZI_END=0800-09FF                             

-Z(CODE)PRELOAD=4000-57FF
-Z(CODE)SCRIPT_VARS=5800-58FF
-Z(CODE)CALIBRATION=6000-601F

/************************************************************************/
/* Declare the interrupt handling semgents, INTGEN and INTVEC.		*/
/*									*/
/* The general interrupt handling segment, INTGEN, must be located at   */
/* address 0xFF. This implies that the VIS instruction will be in the	*/
/* second code bank and thus the interrupt vector table segment, 	*/
/* INTVEC, must be located in the same bank at address 0x01E0.		*/
/************************************************************************/

-Z(CODE)INTGEN=00FF-013F
-Z(CODE)INTVEC=01E0-01FF


/************************************************************************/
/* All segments that contains constants to be placed in the code memory */
/* like the inializer segments, TINY_ID and BANKn_ID, and the constant  */
/* segment CONST, must be located in a code page that also includes the */
/* special FETCH segment, consisting of a LAID - RET sequence. By       */
/* default we have used the second code page for this.                  */
/*									*/
/* Copies of the FETCH segment can be made with the following command:  */ 
/*									*/
/*	-KFETCH=offset,no_of_copies					*/
/*									*/
/* If, for example, there is not enough memory for the CONST segment    */
/* then allocate the next code page also for constants. This is done    */
/* by making following changes:                                         */
/*									*/
/* -KFETCH=100,1                                                        */
/* -P(CODE)CONST=0202-02FF,0302-03FF                                    */
/*									*/
/* The -KFETCH=100,1 command makes 1 copy of the FETCH segment, with    */
/* an address offset at 0x100 from the original declaration (here at    */
/* address 0x0200). Hence the FETCH segments thus will be available at  */
/* following addresses:					 	        */
/*									*/
/* 	 0x0200 and 0x0300   					        */
/*									*/
/* If this is not sufficient then add more copies.                      */
/*									*/
/* IMPORTANT:								*/
/* Due to the implementation in the compiler all FETCH segments must	*/
/* reside at the same address (offset) in the code pages.		*/
/*									*/
/* ALSO IMPORTANT:                                                      */
/* The CONST segment are declared using the -P (packing option) which   */
/* enables the linker to rearrange the order of the constants. This is  */
/* NOT allowed for the initialiser segments xx_ID.                      */
/************************************************************************/

-Z(CODE)FETCH=0200-0201

/* Release this (and modify) if needed 	*/
/* -KFETCH=0100,1			*/
-KFETCH=0100,3

-Z(CODE)TINY_ID,BANK1_ID,BANK2_ID,BANK3_ID,BANK4_ID,BANK5_ID,BANK6_ID,\
BANK7_ID,BANK8_ID=0202-02FF
-P(CODE)CONST=0202-02FF,0302-03FF,0402-04FF,0502-05FF


/************************************************************************/
/* If the code is compiled with the --large-call option the maximal	*/
/* code size is 0x7FFF. If it is compiled without the --large-call 	*/
/* option then the lnk8xxsx.xcl file should be used.			*/
/*									*/
/* Here we specify the total available memory area since the linker	*/
/* will allocate variables in the segments in the order it was defined	*/
/* in this file. When all necessary space in the segments noted so far 	*/
/* has been allocated the remaining unused memory will be available for */
/* the CODE segment.							*/
/*									*/
/* CODE is the normal code segment. It is specified using the -P 	*/
/* option, which causes the linker to optimise the memory usage by 	*/
/* packing the segment parts in available memory areas.			*/
/************************************************************************/
/*  -P(CODE)CODE=0000-7FFF       */
/************************************************************************/
/* changed to place script images from 4000 on                          */
/************************************************************************/

-P(CODE)CODE=0000-3FFF


/************************************************************************/
/* Allocate the special CONF segment. This should include the EPROM 	*/
/* Configuration register (ECON) byte and the USER storage area 	*/
/* (8 bytes).								*/
/*									*/
/* This is allocated outside of the normal code area, immediately 	*/
/* following the end address. Here it is allocated to address 0x1000.	*/
/* 									*/
/* IMPORTANT: If the actual chip has a different memory size then the	*/
/* memory areas has to be adjusted accordingly.				*/ 
/************************************************************************/

-Z(CODE)CONF=8000-8008


/************************************************************************/
/************************************************************************/
/* Allocate the writable segments to the RAM area.			*/
/************************************************************************/
/************************************************************************/


/************************************************************************/
/* Available data memory areas:						*/
/*									*/
/*	TINY_x		address range:	0x0000 - 0x000F			*/
/*	BANK0_x		default not used.				*/
/*	BANKn_x		address range:	0x0n00 - 0x0n7F			*/
/*									*/
/*			_Z	denotes zero (un-) initialized data	*/
/*			_I	denotes initialized data		*/
/*			_N	denotes __no_init data		        */
/*									*/
/* The stack segment, CSTACK, is allocated between 0x10 and 0x6F, and 	*/
/* the size is specified to 0x60 by CSTACK+60. The Stack Pointer 	*/
/* defaults to 0x6F at processor reset, therefore the end address 	*/
/* should be 0x6F. 							*/
/*									*/
/* If any other end value is used then the SP register has to be 	*/
/* explicitly loaded in the cstartup routine. This is omitted by 	*/
/* default to save space.						*/
/*									*/
/* The definition of the available memory areas for the general bank	*/
/* segment, FAR, is done with:						*/
/*									*/
/*	-P(DATA)FAR_Z,FAR_I=0000-006F,[0100-017F]*8+0100		*/
/*									*/
/* The last definition will expand to 8 memory banks separated with	*/
/* an offset of 0x0100, i.e. 0x0n00-0x0n7F, where n = 1,2,....,8.	*/
/*									*/
/* The variables defined in the general bank will be placed at any 	*/
/* unused memory locations in the defined ranges.			*/
/************************************************************************/

-Z(DATA)TINY_Z,TINY_I,TINY_N=0000-000F
-Z(DATA)CSTACK+60=0010-006F

-Z(DATA)BANK1_Z,BANK1_I,BANK1_N=0100-017F

-Z(DATA)BANK2_Z,BANK2_I,BANK2_N=0200-027F
-Z(DATA)BANK3_Z,BANK3_I,BANK3_N=0300-037F
-Z(DATA)BANK4_Z,BANK4_I,BANK4_N=0400-047F
-Z(DATA)BANK5_Z,BANK5_I,BANK5_N=0500-057F
-Z(DATA)BANK6_Z,BANK6_I,BANK6_N=0600-067F
-Z(DATA)BANK7_Z,BANK7_I,BANK7_N=0700-077F
-Z(DATA)BANK8_Z,BANK8_I,BANK8_N=0800-087F

-P(DATA)FAR_Z,FAR_I,FAR_N=[0100-017F]*8+0100



/************************************************************************/
/* If the EERAM functionality is used then declare the EERAM segments.  */
/*                                                                      */
/* 	EERAM_LABEL	Contains a label used for getting the correct   */
/*                      EERAM bank number into the S register when      */
/*			accessing EERAM variables.			*/
/* 	EERAM_N		The segment where the EERAM variables are       */
/*			located. _N denotes that they are of __no_init	*/
/*			type.						*/
/*                                                                      */
/* NOTE: Remember to remove the eeram area from the standard DATA       */
/*       (BANK) segment declaration above.                              */
/************************************************************************/

/* -Z(DATA)EERAM_LABEL,EERAM_N=<eeram_start>-<eeram_end>                */


/************************************************************************/
/* Select the printf/sprintf formatter to use.                          */
/*   See configuration section in manual.                               */
/************************************************************************/

-e_small_write=_formatted_write


/************************************************************************/
/* Select the scanf/sscanf formatter to use.                            */
/*   See configuration section in manual.                               */
/************************************************************************/

-e_medium_read=_formatted_read


/************************************************************************/
/* Load the reset (default) or resetl (--large_call) object file which 	*/
/* contains the RESET segment. This has to be loaded using the -A (load */
/* as program) option since it is not referenced anywhere in the source	*/
/* code.								*/
/*									*/
/* Select the "C" library to use.                                       */
/*   clc8ld1     pointer option: (none)                                 */
/*   clc8lg1     pointer option: --generic_pointer                      */
/************************************************************************/

-A resetl

/*clc8ld1*/

clc8lg1


/************************************************************************/
/* End of File            	                                        */
/************************************************************************/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -