//================================================================ // IAR XLINK command file for the M16C/R8C IAR C/EC++ Compiler // // This is an example XLINK command file for use with the // IAR C libraries and R8C derivatives. // // Copyright 1995 - 2003 IAR Systems. All rights reserved. // // Usage: xlink your_file(s) -f this_file clm16cxxx // // $Revision: 1.3 $ //================================================================ //================================================================ // The M16C IAR C/EC++ Compiler places code and data into named // segments which are referred to by the IAR XLINK Linker. The // table below shows the available segments. // // SEGMENT REFERENCE // ================= // // Segment Description // ------- ----------- // BITVARS Bit variables. // CODE The program code. // CSTACK The stack used by C or Embedded C++ programs. // CSTART The startup code. // // x_AC Non-initialized located const objects. // x_AN Non-initialized located non-const objects. // x_C Constant data, including string literals. // x_I Initialized data. // x_ID Data that is copied to x_I by cstartup. // x_N Uninitialized data. // x_Z zero initialized data. // // Where x can be one of: // DATA13 (Range: 0-0x1FFF) // DATA16 (Range: 0-0xFFFF) // DATA20 (Range: 0-0xFFFFF) // FAR (Range: 0-0xFFFFF) // // DIFUNCT Pointers to code, typically EC++ constructors // FLIST Jump table for __tiny_func functions. // HEAP The heap data used by malloc and free. // INTVEC Contains reset and interrupt vectors. // INTVEC1 Contains the fixed reset and interrupt vectors. // ISTACK The stack used by interrupts and exceptions. //================================================================ // Define CPU -cm16c //================================================================ // USER DEFINITIONS // Please customize according to your specific derivative! //================================================================ // Size of the user stack -D_CSTACK_SIZE=200 // Size of the interrupt stack -D_ISTACK_SIZE=40 // Memory areas available for the application -D_USER_RAM_BEGIN=400 -D_USER_RAM_END=7FF -D_USER_ROM_BEGIN=C100 -D_USER_ROM_END=FEFF -D_CSTART_ROM_BEGIN=C100 // Relocatable "bit" variables, range -D_BITVAR_BEGIN=400 // 8*400 hex -D_BITVAR_END=FFFF // ID code written to ROM memory for the ID Code Check Function -D_ID_CODE_1=0 -D_ID_CODE_2=0 -D_ID_CODE_3=0 -D_ID_CODE_4=0 -D_ID_CODE_5=0 -D_ID_CODE_6=0 -D_ID_CODE_7=0 // ======================= // DATA13 RAM // ======================= -Z(NEAR)DATA13_AN=0-1FFF -Z(NEAR)DATA13_I=_USER_RAM_BEGIN-1FFF -Z(NEAR)DATA13_Z,DATA13_N // Relocatable "bit" segment. As BITVARS contains bit addresses, // the desired (byte) address has to be multiplied by 8. -Z(BIT)BITVARS=_BITVAR_BEGIN-_BITVAR_END // ======================= // DATA16 RAM // ======================= // Set up user stack -Z(NEAR)CSTACK+_CSTACK_SIZE=_USER_RAM_BEGIN-_USER_RAM_END // Set up interrupt stack -Z(NEAR)ISTACK+_ISTACK_SIZE // Near variables -Z(NEAR)DATA16_I,DATA16_Z,DATA16_N,DATA16_AN -Z(NEAR)FAR_I,FAR_Z,FAR_N,FAR_AN,DATA20_I,DATA20_Z,DATA20_N,DATA20_AN // User defined near DATA segments // ======================= // DATA16 ROM // ======================= // Constant segments (in ROM), reachable for near pointers -Z(NEARCONST)DATA16_C=_USER_ROM_BEGIN-_USER_ROM_END -Z(NEARCONST)INFORMATION=C000 // Constant and initializer segments (in ROM) -Z(NEARCONST)DATA16_ID,DATA13_ID,DIFUNCT,CHECKSUM=_USER_ROM_BEGIN -Z(NEARCONST)FAR_ID,FAR_C,DATA20_C,DATA20_ID // User defined near CONST segments // CODE segments -Z(CODE)CODE=_USER_ROM_BEGIN-_USER_ROM_END -Z(CODE)CSTART=_CSTART_ROM_BEGIN-_USER_ROM_END // User defined CODE segments // Variable vector table -Z(CONST)INTVEC=FD00-FDFF // Fixed interrupt vector table -Z(CONST)INTVEC1=FFDC-FFFF // ======================== // IAR C library formatting // ======================== -e_small_write=_formatted_write -e_medium_read=_formatted_read // ======================== // Output files // ======================== // Use the -O option to create one or more output files // at the same link session. Formats flags, file name and // extension is optional. Please un-comment the wanted // output formats below. // // CAUTION: Do not combine ohter output formats with -rt (special // UBROF for Terminal I/O in C-SPY). Output files are valid but // contain code that expects to be run under C-SPY. // Motorola output //-Omotorola=.mot // IEEE-695 output with format flags for the Renesas debugger //-Oieee695,lbm=.x30 // ELF/DWARF output with format flags for the Renesas debugger //-Oelf,spc=.elf