/*****************************************************************************
 * Module    : XCL
 * File      : APP_BASE.xcl
 * Author    : Hanny
 * Email     : coldney@163.com
 * Function  : 基础空间的分配。应用开发时，请勿随意修改该文件的内容。
 *****************************************************************************/


-D_IDATA_END=0xFF               // Last address of Idata memory (0xFF for 8052 and 0x7F for 8051)

-D_PDATA_START=0x00             // First address for PDATA memory.
-D_PDATA_END=0xFF               // Last address for PDATA memory.

-D_IXDATA_START=0x000100        // First address of on chip XDATA memory.
-D_IXDATA_END=0x0003FF          // Last address of on chip XDATA memory.

-D_XDATA_START=0x000100         // First address of xdata memory.
-D_XDATA_END=0x0003FF           // Last address of xdata memory.

-D_CODE_START=0x002000          // First address for code.
-D_CODE_END=0x000039FF          // Last address for code.

-D_RSV_START=0x003A00          // First address for code.
-D_RSV_END=0x00003BFF          // Last address for code.

-D?REGISTER_BANK=0              // Default register bank (0,1,2,3).
-D_REGISTER_BANK_START=0        // Start address for default register bank (00,08,10,18).

-D_BREG_START=0x00              // The bit address where the BREG segments starts.
                                // Must be placed on: _BREG_START%8=0 where _BREG_START <= 0x78.
-D?VB=0x20                      // ?VB is used when referencing BREG as whole byte.
                                // Must be placed on: ?VB=0x20+_BREG_START/8

-D?ESP=9B                       // ESP Extended Stack Pointer
-D?PBANK_NUMBER=0	            // high byte of 16-bit address to the PDATA area
-D?PBANK=0xDF                   // Most significant byte in MOVX A,@R0. (0xA0 is sfr P2)

-Z(BIT)BREG=_BREG_START
-Z(BIT)BT_BIT=10-14
-Z(BIT)SDK_BIT,SBC_BIT=40-7F
-Z(BIT)BIT_N=40-7F
-Z(BIT)IRAM_HOOK_BIT=0x8-0xF

-Z(DATA)REGISTERS+8=_REGISTER_BANK_START
-Z(DATA)SYS_BDATA=0x23-0x23
-Z(DATA)SD_BDATA=0x27-0x27
-Z(DATA)BDATA_Z,BDATA_N,BDATA_I=27-2F
-Z(DATA)VREG+_NR_OF_VIRTUAL_REGISTERS=30-7F
-Z(DATA)PSP,XSP=08-7F
-Z(DATA)DOVERLAY=08-7F
//-Z(DATA)DATA_I,DATA_Z,DATA_N=08-7F
-Z(DATA)BANK_DATA=0x44-0x46
-Z(DATA)SPCTL_DATA=0x48-0x48
-Z(DATA)MP3_DATA,SYS_DATA,UART_DATA,BT_DATA,BT_RX_DATA=0x55-0x62

-Z(DATA)MBANK_DATA=0x7e-0x7f

-Z(DATA)WAV_PCM_DATA=0x105A:+2
-Z(DATA)WAV_ADPCM_DATA=0x205A:+2
-Z(DATA)RECORD_DATA=0x305A:+2

-U(IDATA)0-7F=(DATA)0-7F
//-Z(IDATA)IDATA_I,IDATA_Z,IDATA_N=08-_IDATA_END
-Z(IDATA)ISTACK+_IDATA_STACK_SIZE#08-_IDATA_END
-Z(IDATA)IOVERLAY=08-FF
-Z(IDATA)DECODER_IDATA,MP3_IDATA=80-FF
-Z(IDATA)BT_IDATA=0x1B1-0x1DD
-Z(IDATA)WAV_IDATA=0x2B1-0x2BE

-Z(CODE)APP_RESET=0x1800
-Z(CODE)INTVEC=0x2000-0x2075
-Z(CODE)INTVEC_ASM=0x12033-0x12035
-Z(CODE)IRAM_VECTOR=0x2100

//-Z(CODE)PDATA_RESERVED=0x80
-Z(CODE)BANKED_CODE_SWITCH_RET=_CODE_START-_CODE_END
-Z(CODE)BANKED_CODE_SWITCH,BANK_SWITCH=_CODE_START-_CODE_END
-Z(CODE)SYS_CALL=0x80
-Z(CODE)RCODE=_CODE_START-_CODE_END
-Z(CODE)NEAR_CODE,SYS_ASM=_CODE_START-_CODE_END
-Z(CODE)COMMON_DEV_SEG,SPI_COM_SEG,SCAN_COM=_CODE_START-_CODE_END
-Z(CODE)RSV_SEG=_RSV_START-_RSV_END

-Z(CODE)M_CONSTANT=0xC00000-0xC0FFFF

/*****************************************************************************
 * Section   : 以下是控制的Bank分段，比较关注切Bank的效率及位置
 *****************************************************************************/
-Z(CODE)BT_MAIN_API,BT_MAIN_SEG,BT_L2CAP_API,BT_A2DP_API,BT_HSF_API,BT_SCO_API,BT_SCO_TABLE,BT_MAIN_CONST=0x51800-0x51FFF
-Z(CODE)HCI_EVENT_SEG,BT_CHK_ACL_SEG,BT_L2CAP_RCV=0x51800-0x51FFF
-Z(CODE)BT_AVDTP_SIG_API,BT_AVDTP_MEDIA_API,BT_AVCTP_API,BT_HID_API=0x51800-0x51FFF
-Z(CODE)BT_SDP_API,BT_RFCOMM_API,BT_RFC_API,BT_HANDFREE_API=0x51800-0x51FFF
-Z(CODE)BT_L2CAP_RX,HOSTNUM_COMPLETED=0x51800-0x61FFF
-Z(CODE)TASK_BTEVENT_SEG=0x51800-0x51FFF
-Z(CODE)BT_PATCH_CODE,BT_PATCH_CONST=0x1B1800-0x1B1FFF

-Z(CODE)BT_L2CAP_RCV_BANK,BT_SDP_CONSTSEG,BT_SDP_RECORD=0x2B1800-0x2B1FFF

-Z(CODE)EQ_CONST,EQ_SEG,MP3_SEG,MP3_SEG_CONST=0x2C1800-0x2C1FFF
-Z(CODE)BT_HCI_EVENT,BT_SDP=0x2D1800-0x2D1FFF


-Z(CODE)BIT_ID,BDATA_ID,DATA_ID,IDATA_ID,IXDATA_ID,PDATA_ID,XDATA_ID=_BANK_0_START:+_BANK_LEN
-Z(CODE)CODE_C=_CODE_START-_CODE_END

-Z(XDATA)SD_PDATA,BT_PDATA_COMM,BTQ_PDATA,L2C_PDATA=_PDATA_START-_PDATA_END
-Z(XDATA)PDATA_N,PDATA_Z,PDATA_I=_PDATA_START-_PDATA_END

-Z(XDATA)IXDATA_N,IXDATA_Z,IXDATA_I=_IXDATA_START-_IXDATA_END
-Z(XDATA)XDATA_N,XDATA_Z,XDATA_I=_XDATA_START-_XDATA_END

-Z(XDATA)CLUST_BUF=0x400

-Z(XDATA)SPI_PARAM_DATA=0x700-0x7FF
-Z(XDATA)BT_SDP_BUF,BT_SDP_TEMP_XDATA=0x10700-0x107FF
-Z(XDATA)BT_TEMP_BUF=0x20700-0x207FF
-Z(XDATA)BT_PAIR_PARAM=0x30700-0x307FF
-Z(XDATA)TASK_HOLD_XDATA=0x40700-0x407FF

-Z(XDATA)DEC_BUF=0xFD0:+0x430
-Z(XDATA)L2CAP_PAYLOAD_BAK,BTQ3_XDATA,USB_RESAMPLE_XDATA,SCO_VAD_BUF,BT_MIC_PARAM#0x113FF

-Z(XDATA)L2CAP_PAYLOAD_BUF=0x9B74-0x9E17
-Z(XDATA)BTQ_XDATA,BTQ4_BUF=0x9E18-0x9EFF
-Z(XDATA)BT_RF_PARAM_BUF=0x19B74:+0x100

-Z(XDATA)HCI_SEND_BUF,BT_HCI_XDATA,BT_A2DP_XDATA#0x9EFF
-Z(XDATA)BTV_XDATA#0x9EFF
-Z(XDATA)BT_L2CAP_OCT_XDATA,BT_HSHF_XDATA,BT_ATCMD_XDATA#0x9EFF
-Z(XDATA)BT_RFC_XDATA,BTAPI_XDATA#0x9EFF
-Z(XDATA)BT_L2CAP_XDATA,SPP_BUF,BT_SDP_CONLIST,BT_SDP_XDATA#0x9EFF

-Z(XDATA)FAT_WIN_BUF=0x1000
-Z(XDATA)MP3EN_ADC_BUF=0x22C80-0x239FF


-Z(XDATA)LRC_LABEL_BUF=0x0A00
//-Z(XDATA)LRC_LABEL_BUF=0x8D80-0x8FFF
-Z(XDATA)LCD_BUFF=0x20700-0x20AFF
-Z(XDATA)LRC_READ_BUF=0x0800-0x09FF
-Z(XDATA)MASK_FUNC_XDATA=0x1740-0x17FF

-Z(XDATA)USB_HOST_EP0BUF#0x173F
-Z(XDATA)DEV_CTL_XDATA,USB_CTL_XDATA,USB_HOST_XDATA=0x1400-0x173F
-Z(XDATA)FS_HOOK_XDATA,FAT_XDATA,FAT_DPATH_CTL,DAC_XDATA=0x1400-0x173F
-Z(XDATA)SPCTL_XDATA=0x1400-0x173F
-Z(XDATA)BT_DEC_XDATA=0x169A-0x16D2

//堆栈空间配置
-Z(XDATA)EXT_STACK+_EXTENDED_STACK_SIZE=_EXTENDED_STACK_START-_EXTENDED_STACK_END

-Z(CODE)DECRAM_SEG,DECRAM_CONST,USB_ASM,RAM_MASS_SEG=0xF34000-0xF357FF
-Z(XDATA)USB_DEV_XDATA=0x6000-0x6FFF

-R
-cx51
-f APP.xcl
//-f Debug\Exe\hexscript.hs
lib.r51
btlib.r51
