;The Num of Instruction(Size):766. The Max Address(Begin with 0):765 

                MCU  ES7P169C

A    equ    0
R    equ    1
HRAM_0X1  equ  0X1
HRAM_0X10  equ  0X10
HRAM_0X11  equ  0X11
HRAM_0X12  equ  0X12
HRAM_0X13  equ  0X13
HRAM_0X2  equ  0X2
HRAM_0X3  equ  0X3
HRAM_0X4  equ  0X4
HRAM_0X5  equ  0X5
HRAM_0X6  equ  0X6
HRAM_0X7  equ  0X7
HRAM_0X8  equ  0X8
HRAM_0X80  equ  0X80
HRAM_0X81  equ  0X81
HRAM_0X82  equ  0X82
HRAM_0X83  equ  0X83
HRAM_0X84  equ  0X84
HRAM_0X85  equ  0X85
HRAM_0X86  equ  0X86
HRAM_0X87  equ  0X87
HRAM_0X88  equ  0X88
HRAM_0X89  equ  0X89
HRAM_0X8A  equ  0X8a
HRAM_0X8B  equ  0X8b
HRAM_0X8C  equ  0X8c
HRAM_0X8D  equ  0X8d
HRAM_0X8E  equ  0X8e
HRAM_0X8F  equ  0X8f
HRAM_0X9  equ  0X9
HRAM_0X90  equ  0X90
HRAM_0X91  equ  0X91
HRAM_0X92  equ  0X92
HRAM_0X93  equ  0X93
HRAM_0X94  equ  0X94
HRAM_0X95  equ  0X95
HRAM_0X96  equ  0X96
HRAM_0XA  equ  0Xa
HRAM_0XB  equ  0Xb
HRAM_0XC  equ  0Xc
HRAM_0XD  equ  0Xd
HRAM_0XE  equ  0Xe
HRAM_0XF  equ  0Xf

                ORG             0X00
HADR_0X0:
:0X0  608c                      CALL            HADR_0X8C
:0X1  c704f000                  AJMP            HADR_0X4
                                ORG             0X3
:0X3  6800                      GOTO            HADR_0X0
HADR_0X4:
;}
;
;/*******************************************************
;函数名：void main(void)
;描  述：主函数，数据区IAP操作，数据区地址：0xC000~0xC1FF
;输入值：无
;输出值：无
;返回值：无
;*******************************************************/
;void main(void)
;{
;    unsigned char i;
;    unsigned long j;
;    unsigned int dtflashaddr;       //地址变量，用于DataFlash擦除、读写操作
;
;    RAMclear();
:0X4  e783                      CLR             HRAM_0X83
:0X5  ec00                      PAGE            (_RAMclear)>>11
:0X6  60b3                      CALL            HADR_0XB3
:0X7  ec00                      PAGE            (_5)>>11
;    GPIOInit();
:0X8  ec00                      PAGE            (_GPIOInit)>>11
:0X9  60c5                      CALL            HADR_0XC5
:0Xa  ec00                      PAGE            (_6)>>11
;
;    /************IAP擦除操作，擦除Flash数据区(256Word)****/
;    CallFlashEn = 0x55;         //CallFlashEn赋值0x55才能正常执行擦除编程操作
:0Xb  e555                      MOVI            0X55
:0Xc  2094                      MOVAR           _CallFlashEn                          ;_CallFlashEn: Bank 1    Addr: 148     
;    DataFlashErsPage(STARTADDR, ~STARTADDR);
:0Xd  e500                      MOVI            0X0
:0Xe  2087                      MOVAR           HRAM_0X87
:0Xf  e5c0                      MOVI            0XC0
:0X10  2088                     MOVAR           HRAM_0X88
:0X11  e5ff                     MOVI            0XFF
:0X12  2089                     MOVAR           HRAM_0X89
:0X13  e53f                     MOVI            0X3F
:0X14  208a                     MOVAR           HRAM_0X8A
:0X15  ec00                     PAGE            (_DataFlashErsPage)>>11
:0X16  60ea                     CALL            HADR_0XEA
:0X17  ec00                     PAGE            (_7)>>11
;    CLRWDT();
:0X18  c18b                     CWDT
;
;    /******************IAP写入并读出校验******************/
;    for (dtflashaddr = STARTADDR; dtflashaddr <= ENDADDR; dtflashaddr++)
:0X19  e5c0                     MOVI            0XC0
:0X1a  2082                     MOVAR           HRAM_0X82
:0X1b  e500                     MOVI            0X0
:0X1c  2081                     MOVAR           HRAM_0X81
HADR_0X1D:
:0X1d  ea01                     SECTION         0X1
:0X1e  5002                     MOV             HRAM_0X2,       A
:0X1f  cec0                     SUBI            0XC0
:0X20  9284                     JBS             HRAM_0X84,      2
:0X21  6824                     GOTO            HADR_0X24
:0X22  5001                     MOV             HRAM_0X1,       A
:0X23  ce7f                     SUBI            0X7F
HADR_0X24:
:0X24  9084                     JBS             HRAM_0X84,      0
:0X25  684d                     GOTO            HADR_0X4D
;    {
;        CallFlashEn = 0x55;     //CallFlashEn赋值0x55才能正常执行擦除编程操作
:0X26  e555                     MOVI            0X55
:0X27  e614                     MOVA            (_CallFlashEn)&7f                    ;(_CallFlashEn)&7f: Bank 0    Addr: 20     
;        i = DataFlashWrData(dtflashaddr, ~dtflashaddr, WRDATA);
:0X28  5001                     MOV             HRAM_0X1,       A
:0X29  e607                     MOVA            HRAM_0X7
:0X2a  5002                     MOV             HRAM_0X2,       A
:0X2b  e608                     MOVA            HRAM_0X8
:0X2c  5201                     COM             HRAM_0X1,       A
:0X2d  e603                     MOVA            HRAM_0X3
:0X2e  5202                     COM             HRAM_0X2,       A
:0X2f  e604                     MOVA            HRAM_0X4
:0X30  5003                     MOV             HRAM_0X3,       A
:0X31  e609                     MOVA            HRAM_0X9
:0X32  5004                     MOV             HRAM_0X4,       A
:0X33  e60a                     MOVA            HRAM_0XA
:0X34  e521                     MOVI            0X21
:0X35  e60b                     MOVA            HRAM_0XB
:0X36  e543                     MOVI            0X43
:0X37  e60c                     MOVA            HRAM_0XC
:0X38  e565                     MOVI            0X65
:0X39  e60d                     MOVA            HRAM_0XD
:0X3a  e587                     MOVI            0X87
:0X3b  e60e                     MOVA            HRAM_0XE
:0X3c  ec00                     PAGE            (_DataFlashWrData)>>11
:0X3d  620d                     CALL            HADR_0X20D
:0X3e  ec00                     PAGE            (_8)>>11
:0X3f  2083                     MOVAR           HRAM_0X83
;
;        if (i != 1)
:0X40  7883                     MOVRA           HRAM_0X83
:0X41  e301                     XORI            0X1
:0X42  9a84                     JBC             HRAM_0X84,      2
:0X43  6847                     GOTO            HADR_0X47
;            dataerr = 1;        //数据校验出错
:0X44  e501                     MOVI            0X1
:0X45  ea01                     SECTION         0X1
:0X46  e600                     MOVA            (_dataerr)&7f                        ;(_dataerr)&7f: Bank 0    Addr: 0     
HADR_0X47:
;    }
:0X47  ea01                     SECTION         0X1
:0X48  5501                     INC             HRAM_0X1,       R
:0X49  9284                     JBS             HRAM_0X84,      2
:0X4a  684c                     GOTO            HADR_0X4C
:0X4b  5502                     INC             HRAM_0X2,       R
HADR_0X4C:
:0X4c  681d                     GOTO            HADR_0X1D
HADR_0X4D:
;
;    ROMCL = 0x00;       //退出IAP
:0X4d  e794                     CLR             _ROMCL_0                             ;_ROMCL_0: Bank 511    Addr: 65428    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    CLRWDT();
:0X4e  c18b                     CWDT
;
;    /******************IAP读出校验(示例)******************/
;    for (dtflashaddr = STARTADDR; dtflashaddr <= ENDADDR; dtflashaddr++)
:0X4f  e5c0                     MOVI            0XC0
:0X50  e602                     MOVA            HRAM_0X2
:0X51  e500                     MOVI            0X0
:0X52  e601                     MOVA            HRAM_0X1
HADR_0X53:
:0X53  5002                     MOV             HRAM_0X2,       A
:0X54  cec0                     SUBI            0XC0
:0X55  9284                     JBS             HRAM_0X84,      2
:0X56  6859                     GOTO            HADR_0X59
:0X57  5001                     MOV             HRAM_0X1,       A
:0X58  ce7f                     SUBI            0X7F
HADR_0X59:
:0X59  9084                     JBS             HRAM_0X84,      0
:0X5a  6882                     GOTO            HADR_0X82
;    {
;        j = DataFlashRdData(dtflashaddr);
:0X5b  5001                     MOV             HRAM_0X1,       A
:0X5c  e607                     MOVA            HRAM_0X7
:0X5d  5002                     MOV             HRAM_0X2,       A
:0X5e  e608                     MOVA            HRAM_0X8
:0X5f  ec00                     PAGE            (_DataFlashRdData)>>11
:0X60  6146                     CALL            HADR_0X146
:0X61  ec00                     PAGE            (_9)>>11
:0X62  2083                     MOVAR           HRAM_0X83
:0X63  5001                     MOV             (?_TMP+1)&7f,   A                    ;(?_TMP+1)&7f: Bank 0    Addr: 1     
:0X64  2084                     MOVAR           HRAM_0X84
:0X65  5002                     MOV             (?_TMP+2)&7f,   A                    ;(?_TMP+2)&7f: Bank 0    Addr: 2     
:0X66  2085                     MOVAR           HRAM_0X85
:0X67  5003                     MOV             (?_TMP+3)&7f,   A                    ;(?_TMP+3)&7f: Bank 0    Addr: 3     
:0X68  2086                     MOVAR           HRAM_0X86
;
;        if (j != WRDATA)
:0X69  7883                     MOVRA           HRAM_0X83
:0X6a  e321                     XORI            0X21
:0X6b  9284                     JBS             HRAM_0X84,      2
:0X6c  687a                     GOTO            HADR_0X7A
:0X6d  ea01                     SECTION         0X1
:0X6e  5004                     MOV             HRAM_0X4,       A
:0X6f  e343                     XORI            0X43
:0X70  9284                     JBS             HRAM_0X84,      2
:0X71  687a                     GOTO            HADR_0X7A
:0X72  5005                     MOV             HRAM_0X5,       A
:0X73  e365                     XORI            0X65
:0X74  9284                     JBS             HRAM_0X84,      2
:0X75  687a                     GOTO            HADR_0X7A
:0X76  5006                     MOV             HRAM_0X6,       A
:0X77  e387                     XORI            0X87
:0X78  9a84                     JBC             HRAM_0X84,      2
:0X79  687d                     GOTO            HADR_0X7D
HADR_0X7A:
;            dataerr = 1;        //数据校验出错
:0X7a  e501                     MOVI            0X1
:0X7b  ea01                     SECTION         0X1
:0X7c  e600                     MOVA            (_dataerr)&7f                        ;(_dataerr)&7f: Bank 0    Addr: 0     
HADR_0X7D:
;    }
:0X7d  5501                     INC             HRAM_0X1,       R
:0X7e  9284                     JBS             HRAM_0X84,      2
:0X7f  6881                     GOTO            HADR_0X81
:0X80  5502                     INC             HRAM_0X2,       R
HADR_0X81:
:0X81  6853                     GOTO            HADR_0X53
HADR_0X82:
;
;    ROMCL = 0x00;       //退出IAP
:0X82  e794                     CLR             _ROMCL_0                             ;_ROMCL_0: Bank 511    Addr: 65428    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    CLRWDT();
:0X83  c18b                     CWDT
HADR_0X84:
;
;    while (1)
:0X84  c18b                     CWDT
;    }
:0X85  6884                     GOTO            HADR_0X84
HADR_0X86:
:0X86  5f86                     ADD             HRAM_0X86,      R
:0X87  e401                     RETIA           0X1
:0X88  e480                     RETIA           0X80
:0X89  e401                     RETIA           0X1
:0X8a  e400                     RETIA           0X0
:0X8b  e400                     RETIA           0X0
HADR_0X8C:
:0X8c  e783                     CLR             HRAM_0X83
:0X8d  e500                     MOVI            (#_CINIT)>>8
:0X8e  e687                     MOVA            HRAM_0X87
:0X8f  e500                     MOVI            0X0
:0X90  e600                     MOVA            ?_TMP                                ;?_TMP: Bank 0    Addr: 0     
:0X91  5000                     MOV             ?_TMP,          A                    ;?_TMP: Bank 0    Addr: 0     
:0X92  ec00                     PAGE            (#_CINIT)>>11
:0X93  6086                     CALL            HADR_0X86
:0X94  e601                     MOVA            ?_TMP+1                              ;?_TMP+1: Bank 0    Addr: 1     
:0X95  5101                     MOV             ?_TMP+1,        R                    ;?_TMP+1: Bank 0    Addr: 1     
:0X96  9a84                     JBC             HRAM_0X84,      2
:0X97  c183                     RET
HADR_0X98:
:0X98  5500                     INC             ?_TMP,          R                    ;?_TMP: Bank 0    Addr: 0     
:0X99  5000                     MOV             ?_TMP,          A                    ;?_TMP: Bank 0    Addr: 0     
:0X9a  ec00                     PAGE            (#_CINIT)>>11
:0X9b  6086                     CALL            HADR_0X86
:0X9c  e602                     MOVA            ?_TMP+2                              ;?_TMP+2: Bank 0    Addr: 2     
:0X9d  5500                     INC             ?_TMP,          R                    ;?_TMP: Bank 0    Addr: 0     
:0X9e  5000                     MOV             ?_TMP,          A                    ;?_TMP: Bank 0    Addr: 0     
:0X9f  ec00                     PAGE            (#_CINIT)>>11
:0Xa0  6086                     CALL            HADR_0X86
:0Xa1  e603                     MOVA            ?_TMP+3                              ;?_TMP+3: Bank 0    Addr: 3     
:0Xa2  60a6                     CALL            HADR_0XA6
:0Xa3  5701                     JDEC            HRAM_0X1,       R
:0Xa4  6898                     GOTO            HADR_0X98
:0Xa5  c183                     RET
HADR_0XA6:
:0Xa6  5002                     MOV             ?_TMP+2,        A                    ;?_TMP+2: Bank 0    Addr: 2     
:0Xa7  e681                     MOVA            HRAM_0X81
:0Xa8  e500                     MOVI            0X0
:0Xa9  e682                     MOVA            HRAM_0X82
:0Xaa  5500                     INC             ?_TMP,          R                    ;?_TMP: Bank 0    Addr: 0     
:0Xab  5000                     MOV             ?_TMP,          A                    ;?_TMP: Bank 0    Addr: 0     
:0Xac  ec00                     PAGE            (#_CINIT)>>11
:0Xad  6086                     CALL            HADR_0X86
:0Xae  e680                     MOVA            HRAM_0X80
:0Xaf  5502                     INC             ?_TMP+2,        R                    ;?_TMP+2: Bank 0    Addr: 2     
:0Xb0  5703                     JDEC            HRAM_0X3,       R
:0Xb1  68a6                     GOTO            HADR_0XA6
:0Xb2  c183                     RET
HADR_0XB3:
;/*******************************************************
;*Copyright(C),2020,Shanghai Eastsoft Microelectronics Co.,Ltd.
;*文件名：iap_dataflash.c
;*作  者：AE Team
;*版  本：v1.1，编译于iDesigner(v4.2.3.166) + 工具链HRCC(v1.2.0.106)
;*日  期：2020/12/18
;*描  述：数据区IAP操作，数据区地址：0xC000~0xC1FF
;        IAP擦除以页(256个地址单元)为单位，对一个地址执行擦除动作即是擦除这个地址所在的一整页。
;        IAP写入以一个地址单元为单位(一个地址单元对应一个Word)。每页擦除时间至少2ms，单个地址编程时间至少25us。
;        增加IAP擦除编程软件锁，防止程序跑飞误擦程序。
;        注意：建议IAP操作前关闭WDT(配置字选择WDTEN为Disable)，若使能WDT，请设置合理的WDT溢出时间，并合理清狗。
;*备  注：本软件仅供学习和演示使用，对用户直接引用代码所带来的风险或后果不承担任何法律责任。
;*******************************************************/
;#include <hic.h>
;
;#define CLRWDT()   {__Asm CWDT;}        //宏定义清狗指令
;
;#define STARTADDR    0xC000     //宏定义数据区IAP操作起始地址
;#define ENDADDR      0xC07F     //宏定义数据区IAP操作结束地址
;#define WRDATA       0x87654321     //宏定义待写入数据
;
;unsigned char dataerr = 0;      //0：写入与读出相等，1：写入与读出不等
;
;unsigned char CallFlashEn, FlashEwEn; //软件锁变量
;
;/******************************************************
;函数名：void RAMclear(void)
;描  述：RAM区数据清零，RAM区地址0x0000~0x03FF
;输入值：无
;输出值：无
;返回值：无
;*******************************************************/
;void RAMclear(void)
;{
;    for (IAAH = 0; IAAH <= 0x03; IAAH++)
:0Xb3  e783                     CLR             HRAM_0X83
:0Xb4  e782                     CLR             _IAAH_0                              ;_IAAH_0: Bank 511    Addr: 65410    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
HADR_0XB5:
:0Xb5  5082                     MOV             _IAAH_0,        A                    ;_IAAH_0: Bank 511    Addr: 65410    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0Xb6  ce03                     SUBI            0X3
:0Xb7  9084                     JBS             HRAM_0X84,      0
:0Xb8  68c4                     GOTO            HADR_0XC4
;    {
;        for (IAAL = 0; IAAL < 0xFF; IAAL++)
:0Xb9  e781                     CLR             _IAAL_0                              ;_IAAL_0: Bank 511    Addr: 65409    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
HADR_0XBA:
:0Xba  e5ff                     MOVI            0XFF
:0Xbb  ee81                     SUB             _IAAL_0,        A                    ;_IAAL_0: Bank 511    Addr: 65409    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0Xbc  9884                     JBC             HRAM_0X84,      0
:0Xbd  68c1                     GOTO            HADR_0XC1
;            IAD = 0x00;
:0Xbe  e780                     CLR             _IAD_0                               ;_IAD_0: Bank 511    Addr: 65408    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0Xbf  5581                     INC             _IAAL_0,        R                    ;_IAAL_0: Bank 511    Addr: 65409    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0Xc0  68ba                     GOTO            HADR_0XBA
HADR_0XC1:
;
;        IAD = 0x00;
:0Xc1  e780                     CLR             _IAD_0                               ;_IAD_0: Bank 511    Addr: 65408    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0Xc2  5582                     INC             _IAAH_0,        R                    ;_IAAH_0: Bank 511    Addr: 65410    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    }
:0Xc3  68b5                     GOTO            HADR_0XB5
HADR_0XC4:
;}
:0Xc4  c183                     RET
HADR_0XC5:
;
;/******************************************************
;函数名：void GPIOInit(void)
;描  述：首先初始化所有未用到的IO口为输出低电平
;输入值：无
;输出值：无
;返回值：无
;*******************************************************/
;void GPIOInit(void)
;{
;    ANSH = 0xFF;        //选择对应端口为数字IO功能
:0Xc5  e783                     CLR             HRAM_0X83
:0Xc6  e5ff                     MOVI            0XFF
:0Xc7  e68d                     MOVA            _ANSH_0                              ;_ANSH_0: Bank 511    Addr: 65421    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    ANSL = 0xFF;        //选择对应端口为数字IO功能
:0Xc8  e5ff                     MOVI            0XFF
:0Xc9  e6bc                     MOVA            _ANSL_0                              ;_ANSL_0: Bank 511    Addr: 65468    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    PAT = 0x00;         //所有IO设为输出低电平
:0Xca  e7ad                     CLR             _PAT_0                               ;_PAT_0: Bank 511    Addr: 65453    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    PBT = 0x00;
:0Xcb  e7ae                     CLR             _PBT_0                               ;_PBT_0: Bank 511    Addr: 65454    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    PCT = 0x00;
:0Xcc  e7af                     CLR             _PCT_0                               ;_PCT_0: Bank 511    Addr: 65455    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    PA = 0x00;
:0Xcd  e7a8                     CLR             _PA_0                                ;_PA_0: Bank 511    Addr: 65448    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    PB = 0x00;
:0Xce  e7a9                     CLR             _PB_0                                ;_PB_0: Bank 511    Addr: 65449    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    PC = 0x00;
:0Xcf  e7aa                     CLR             _PC_0                                ;_PC_0: Bank 511    Addr: 65450    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;}
:0Xd0  c183                     RET
HADR_0XD1:
;
;static volatile unsigned int section8 FRAN @ 0xFF8E;
;static volatile unsigned int section8 FRA  @ 0xFF90;
;
;/******************************************************
;函数名：void StartIAP(void)
;描  述：开始IAP操作。注意：IAP固定操作格式，使用时不可改变
;输入值：无
;输出值：无
;返回值：无
;*******************************************************/
;void StartIAP(void)
;{
;    __asm
:0Xd1  e783                     CLR             HRAM_0X83
;    {
;        MOVI 0x55
:0Xd2  e555                     MOVI            0X55
;        MOVA ROMCH
:0Xd3  e695                     MOVA            HRAM_0X95
;        MOVI 0xFF     //8个NOP代替语句开始
:0Xd4  e5ff                     MOVI            0XFF
;        SECSEL &FlashEwEn &% 0x80//选择变量所在的section
:0Xd5  ea01                     SECTION         (_FlashEwEn)>>7
;        XOR &FlashEwEn &% 0x80, 0 //0xFF xor 0xAA = 0x55
:0Xd6  5c15                     XOR             (_FlashEwEn)&7f,                A    ;(_FlashEwEn)&7f: Bank 0    Addr: 21     
;        SECSEL &CallFlashEn &% 0x80//选择变量所在的section
:0Xd7  ea01                     SECTION         (_CallFlashEn)>>7
;        XOR &CallFlashEn &% 0x80, 0 //若CallFlashEn在调用函数前为0x55，0x55 xor 0x55 = 0x00
:0Xd8  5c14                     XOR             (_CallFlashEn)&7f,              A    ;(_CallFlashEn)&7f: Bank 0    Addr: 20     
;        JBS PSW, Z //如果运算结果为0x00，则执行正确，跳至下一个NOP
:0Xd9  9284                     JBS             HRAM_0X84,      2
;        GOTO $+3
:0Xda  68dd                     GOTO            HADR_0XDD
;        NOP//8个NOP代替语句结束
:0Xdb  ffff                     NOP
;        MOVI 0xAA
:0Xdc  e5aa                     MOVI            0XAA
HADR_0XDD:
;        MOVA ROMCH
:0Xdd  e695                     MOVA            HRAM_0X95
;        MOVI 0xFF     //8个NOP代替语句开始
:0Xde  e5ff                     MOVI            0XFF
;        SECSEL &FlashEwEn &% 0x80//选择变量所在的section
:0Xdf  ea01                     SECTION         (_FlashEwEn)>>7
;        XOR &FlashEwEn &% 0x80, 0 //0xFF xor 0xAA = 0x55
:0Xe0  5c15                     XOR             (_FlashEwEn)&7f,                A    ;(_FlashEwEn)&7f: Bank 0    Addr: 21     
;        SECSEL &CallFlashEn &% 0x80//选择变量所在的section
:0Xe1  ea01                     SECTION         (_CallFlashEn)>>7
;        XOR &CallFlashEn &% 0x80, 0 //若CallFlashEn在调用函数前为0x55，0x55 xor 0x55 = 0x00
:0Xe2  5c14                     XOR             (_CallFlashEn)&7f,              A    ;(_CallFlashEn)&7f: Bank 0    Addr: 20     
;        JBS PSW, Z //如果运算结果为0x00，则执行正确，跳至下一个NOP
:0Xe3  9284                     JBS             HRAM_0X84,      2
;        GOTO $+3
:0Xe4  68e7                     GOTO            HADR_0XE7
;        NOP//8个NOP代替语句结束
:0Xe5  ffff                     NOP
;        BSS ROMCL, WR    //触发编程操作
:0Xe6  a194                     BSS             HRAM_0X94,      1
HADR_0XE7:
;        JBC ROMCL, WR
:0Xe7  9994                     JBC             HRAM_0X94,      1
;        goto $-1         //等待操作结束
:0Xe8  68e7                     GOTO            HADR_0XE7
;    }
:0Xe9  c183                     RET
HADR_0XEA:
;
;/*******************************************************
;函数名：void DataFlashErsPage(void)
;描  述：擦除DataFlash整页(256 word)，地址范围：0xC000~0xC1FF
;输入值：DataFlash地址addr，DataFlash取反地址addri
;输出值：无
;返回值：无
;*******************************************************/
;void DataFlashErsPage(unsigned int addr, unsigned int addri)
;{
;    unsigned char gie_bk = GIE;     //备份GIE
:0Xea  e783                     CLR             HRAM_0X83
:0Xeb  e500                     MOVI            0X0
:0Xec  9f96                     JBC             HRAM_0X96,      7
:0Xed  e501                     MOVI            0X1
:0Xee  ea01                     SECTION         0X1
:0Xef  e60c                     MOVA            HRAM_0XC
:0Xf0  500c                     MOV             HRAM_0XC,       A
:0Xf1  e60b                     MOVA            HRAM_0XB
;    CLRWDT();
:0Xf2  c18b                     CWDT
HADR_0XF3:
;
;    while (GIE == 1)GIE = 0;           //启动IAP前关闭全局中断
:0Xf3  e500                     MOVI            0X0
:0Xf4  9f96                     JBC             HRAM_0X96,      7
:0Xf5  e501                     MOVI            0X1
:0Xf6  e60c                     MOVA            HRAM_0XC
:0Xf7  500c                     MOV             HRAM_0XC,       A
:0Xf8  e301                     XORI            0X1
:0Xf9  9284                     JBS             HRAM_0X84,      2
:0Xfa  68fd                     GOTO            HADR_0XFD
:0Xfb  af96                     BCC             (_GIE_0)>>3,    7                    ;(_GIE_0)>>3: Bank 511    Addr: 65430    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0Xfc  68f3                     GOTO            HADR_0XF3
HADR_0XFD:
;
;    FlashEwEn = 0xAA;//设置软件锁变量
:0Xfd  e5aa                     MOVI            0XAA
:0Xfe  e615                     MOVA            (_FlashEwEn)&7f                      ;(_FlashEwEn)&7f: Bank 0    Addr: 21     
;
;    FPEE = 1;           //存储器擦除模式
:0Xff  a394                     BSS             (_FPEE_0)>>3,   3                    ;(_FPEE_0)>>3: Bank 511    Addr: 65428    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    FRAH = addr >> 8;
:0X100  e508                    MOVI            0X8
:0X101  e001                    ADDI            0X1
:0X102  2000                    MOVAR           ?_TMP                               ;?_TMP: Bank 0    Addr: 0     
:0X103  5007                    MOV             HRAM_0X7,       A
:0X104  2001                    MOVAR           ?_TMP+1                             ;?_TMP+1: Bank 0    Addr: 1     
:0X105  5008                    MOV             HRAM_0X8,       A
:0X106  2002                    MOVAR           ?_TMP+2                             ;?_TMP+2: Bank 0    Addr: 2     
:0X107  7800                    MOVRA           ?_TMP                               ;?_TMP: Bank 0    Addr: 0     
:0X108  690d                    GOTO            HADR_0X10D
HADR_0X109:
:0X109  a884                    BCC             HRAM_0X84,      0
:0X10a  ea00                    SECTION         0X0
:0X10b  d102                    RRB             (?_TMP+2)&7f,   R,              0X1 ;(?_TMP+2)&7f: Bank 0    Addr: 2     
:0X10c  d101                    RRB             (?_TMP+1)&7f,   R,              0X1 ;(?_TMP+1)&7f: Bank 0    Addr: 1     
HADR_0X10D:
:0X10d  e0ff                    ADDI            0XFF
:0X10e  9284                    JBS             HRAM_0X84,      2
:0X10f  6909                    GOTO            HADR_0X109
:0X110  ea00                    SECTION         0X0
:0X111  5001                    MOV             (?_TMP+1)&7f,   A                   ;(?_TMP+1)&7f: Bank 0    Addr: 1     
:0X112  e691                    MOVA            _FRAH_0                             ;_FRAH_0: Bank 511    Addr: 65425    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    FRAL = addr;
:0X113  7887                    MOVRA           HRAM_0X87
:0X114  e690                    MOVA            _FRAL_0                             ;_FRAL_0: Bank 511    Addr: 65424    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    FRAHN = addri >> 8;    //IAP擦除/编程必须满足地址取反逻辑
:0X115  e508                    MOVI            0X8
:0X116  e001                    ADDI            0X1
:0X117  e600                    MOVA            (?_TMP)&7f                          ;(?_TMP)&7f: Bank 0    Addr: 0     
:0X118  7889                    MOVRA           HRAM_0X89
:0X119  e601                    MOVA            (?_TMP+1)&7f                        ;(?_TMP+1)&7f: Bank 0    Addr: 1     
:0X11a  788a                    MOVRA           HRAM_0X8A
:0X11b  e602                    MOVA            (?_TMP+2)&7f                        ;(?_TMP+2)&7f: Bank 0    Addr: 2     
:0X11c  5000                    MOV             (?_TMP)&7f,     A                   ;(?_TMP)&7f: Bank 0    Addr: 0     
:0X11d  6921                    GOTO            HADR_0X121
HADR_0X11E:
:0X11e  a884                    BCC             HRAM_0X84,      0
:0X11f  d102                    RRB             (?_TMP+2)&7f,   R,              0X1 ;(?_TMP+2)&7f: Bank 0    Addr: 2     
:0X120  d101                    RRB             (?_TMP+1)&7f,   R,              0X1 ;(?_TMP+1)&7f: Bank 0    Addr: 1     
HADR_0X121:
:0X121  e0ff                    ADDI            0XFF
:0X122  9284                    JBS             HRAM_0X84,      2
:0X123  691e                    GOTO            HADR_0X11E
:0X124  5001                    MOV             (?_TMP+1)&7f,   A                   ;(?_TMP+1)&7f: Bank 0    Addr: 1     
:0X125  e68f                    MOVA            _FRAHN_0                            ;_FRAHN_0: Bank 511    Addr: 65423    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    FRALN = addri;
:0X126  7889                    MOVRA           HRAM_0X89
:0X127  e68e                    MOVA            _FRALN_0                            ;_FRALN_0: Bank 511    Addr: 65422    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;
;    WREN = 1;           //使能擦除/编程功能
:0X128  a294                    BSS             (_WREN_0)>>3,   2                   ;(_WREN_0)>>3: Bank 511    Addr: 65428    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    StartIAP();         //开始IAP操作
:0X129  ec00                    PAGE            (_StartIAP)>>11
:0X12a  60d1                    CALL            HADR_0XD1
:0X12b  ec00                    PAGE            (_3)>>11
;    CallFlashEn = 0;//清零软件锁变量
:0X12c  ea01                    SECTION         0X1
:0X12d  e714                    CLR             (_CallFlashEn)&7f                   ;(_CallFlashEn)&7f: Bank 0    Addr: 20     
;    FlashEwEn = 0;
:0X12e  e715                    CLR             (_FlashEwEn)&7f                     ;(_FlashEwEn)&7f: Bank 0    Addr: 21     
;    ROMCL = 0x00;       //退出IAP
:0X12f  e794                    CLR             _ROMCL_0                            ;_ROMCL_0: Bank 511    Addr: 65428    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    FRA = 0xFF12;//指到不用的地址空间
:0X130  e5ff                    MOVI            0XFF
:0X131  e691                    MOVA            _FRA_0+1                            ;_FRA_0+1: Bank 511    Addr: 65425    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0X132  e512                    MOVI            0X12
:0X133  e690                    MOVA            _FRA_0                              ;_FRA_0: Bank 511    Addr: 65424    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    FRAN = 0x3456;//此处把地址反码赋成与0xFFFF和FRA无取反关系的值
:0X134  e534                    MOVI            0X34
:0X135  e68f                    MOVA            _FRAN_0+1                           ;_FRAN_0+1: Bank 511    Addr: 65423    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0X136  e556                    MOVI            0X56
:0X137  e68e                    MOVA            _FRAN_0                             ;_FRAN_0: Bank 511    Addr: 65422    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    GIE = gie_bk;       //恢复全局中断
:0X138  ea00                    SECTION         0X0
:0X139  a90a                    BCC             ((_DataFlashErsPage_#T20520_9)>>3)&7f,          1   ;((_DataFlashErsPage_#T20520_9)>>3)&7f: Bank 0    Addr: 10    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0X13a  ea01                    SECTION         0X1
:0X13b  900b                    JBS             HRAM_0XB,       0
:0X13c  693f                    GOTO            HADR_0X13F
:0X13d  ea00                    SECTION         0X0
:0X13e  a10a                    BSS             ((_DataFlashErsPage_#T20520_9)>>3)&7f,          1   ;((_DataFlashErsPage_#T20520_9)>>3)&7f: Bank 0    Addr: 10    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
HADR_0X13F:
:0X13f  ea00                    SECTION         0X0
:0X140  990a                    JBC             HRAM_0XA,       1
:0X141  6944                    GOTO            HADR_0X144
:0X142  af96                    BCC             (_GIE_0)>>3,    7                   ;(_GIE_0)>>3: Bank 511    Addr: 65430    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0X143  6945                    GOTO            HADR_0X145
HADR_0X144:
:0X144  a796                    BSS             (_GIE_0)>>3,    7                   ;(_GIE_0)>>3: Bank 511    Addr: 65430    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
HADR_0X145:
;}
:0X145  c183                    RET
HADR_0X146:
;
;/*******************************************************
;函数名：unsigned long DataFlashRdData(unsigned int addr)
;描  述：读Flash指定地址的数据
;输入值：DataFlash地址addr，地址范围：0xC000~0xC1FF
;输出值：无
;返回值：DataFlash指定地址的数据
;*******************************************************/
;unsigned long DataFlashRdData(unsigned int addr)
;{
;    unsigned long data;
;    unsigned char gie_bk = GIE;   //备份GIE
:0X146  e783                    CLR             HRAM_0X83
:0X147  e500                    MOVI            0X0
:0X148  9f96                    JBC             HRAM_0X96,      7
:0X149  e501                    MOVI            0X1
:0X14a  ea01                    SECTION         0X1
:0X14b  e609                    MOVA            HRAM_0X9
:0X14c  5009                    MOV             HRAM_0X9,       A
:0X14d  e60b                    MOVA            HRAM_0XB
;    CLRWDT();
:0X14e  c18b                    CWDT
HADR_0X14F:
;
;    while (GIE == 1)GIE = 0;
:0X14f  e500                    MOVI            0X0
:0X150  9f96                    JBC             HRAM_0X96,      7
:0X151  e501                    MOVI            0X1
:0X152  e609                    MOVA            HRAM_0X9
:0X153  5009                    MOV             HRAM_0X9,       A
:0X154  e301                    XORI            0X1
:0X155  9284                    JBS             HRAM_0X84,      2
:0X156  6959                    GOTO            HADR_0X159
:0X157  af96                    BCC             (_GIE_0)>>3,    7                   ;(_GIE_0)>>3: Bank 511    Addr: 65430    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0X158  694f                    GOTO            HADR_0X14F
HADR_0X159:
;
;    FRAL = addr;
:0X159  5007                    MOV             HRAM_0X7,       A
:0X15a  e690                    MOVA            _FRAL_0                             ;_FRAL_0: Bank 511    Addr: 65424    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    FRAH = addr >> 8;
:0X15b  e508                    MOVI            0X8
:0X15c  e001                    ADDI            0X1
:0X15d  2000                    MOVAR           ?_TMP                               ;?_TMP: Bank 0    Addr: 0     
:0X15e  5007                    MOV             HRAM_0X7,       A
:0X15f  2001                    MOVAR           ?_TMP+1                             ;?_TMP+1: Bank 0    Addr: 1     
:0X160  5008                    MOV             HRAM_0X8,       A
:0X161  2002                    MOVAR           ?_TMP+2                             ;?_TMP+2: Bank 0    Addr: 2     
:0X162  7800                    MOVRA           ?_TMP                               ;?_TMP: Bank 0    Addr: 0     
:0X163  6968                    GOTO            HADR_0X168
HADR_0X164:
:0X164  a884                    BCC             HRAM_0X84,      0
:0X165  ea00                    SECTION         0X0
:0X166  d102                    RRB             (?_TMP+2)&7f,   R,              0X1 ;(?_TMP+2)&7f: Bank 0    Addr: 2     
:0X167  d101                    RRB             (?_TMP+1)&7f,   R,              0X1 ;(?_TMP+1)&7f: Bank 0    Addr: 1     
HADR_0X168:
:0X168  e0ff                    ADDI            0XFF
:0X169  9284                    JBS             HRAM_0X84,      2
:0X16a  6964                    GOTO            HADR_0X164
:0X16b  ea00                    SECTION         0X0
:0X16c  5001                    MOV             (?_TMP+1)&7f,   A                   ;(?_TMP+1)&7f: Bank 0    Addr: 1     
:0X16d  e691                    MOVA            _FRAH_0                             ;_FRAH_0: Bank 511    Addr: 65425    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    DATARDTRG = 1;
:0X16e  a094                    BSS             (_DATARDTRG_0)>>3,              0   ;(_DATARDTRG_0)>>3: Bank 511    Addr: 65428    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
HADR_0X16F:
;
;    while (DATARDTRG);
:0X16f  9894                    JBC             HRAM_0X94,      0
:0X170  696f                    GOTO            HADR_0X16F
;
;    DATARDEN = 1;       //DATA区读出使能
:0X171  a794                    BSS             (_DATARDEN_0)>>3,               7   ;(_DATARDEN_0)>>3: Bank 511    Addr: 65428    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    __Asm TBR;          //查表读指令
:0X172  c184                    TBR
;    data = ((unsigned long)ROMD1H << 24) | ((unsigned long)ROMD1L << 16) | ((unsigned long)ROMDH << 8) | ROMDL;
:0X173  ea01                    SECTION         0X1
:0X174  e708                    CLR             HRAM_0X8
:0X175  e709                    CLR             HRAM_0X9
:0X176  e70a                    CLR             HRAM_0XA
:0X177  50a2                    MOV             _ROMD1H_0,      A                   ;_ROMD1H_0: Bank 511    Addr: 65442    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0X178  e607                    MOVA            HRAM_0X7
:0X179  e518                    MOVI            0X18
:0X17a  e001                    ADDI            0X1
:0X17b  2000                    MOVAR           ?_TMP                               ;?_TMP: Bank 0    Addr: 0     
:0X17c  5007                    MOV             HRAM_0X7,       A
:0X17d  2001                    MOVAR           ?_TMP+1                             ;?_TMP+1: Bank 0    Addr: 1     
:0X17e  5008                    MOV             HRAM_0X8,       A
:0X17f  2002                    MOVAR           ?_TMP+2                             ;?_TMP+2: Bank 0    Addr: 2     
:0X180  5009                    MOV             HRAM_0X9,       A
:0X181  2003                    MOVAR           ?_TMP+3                             ;?_TMP+3: Bank 0    Addr: 3     
:0X182  500a                    MOV             HRAM_0XA,       A
:0X183  2004                    MOVAR           ?_TMP+4                             ;?_TMP+4: Bank 0    Addr: 4     
:0X184  7800                    MOVRA           ?_TMP                               ;?_TMP: Bank 0    Addr: 0     
:0X185  698c                    GOTO            HADR_0X18C
HADR_0X186:
:0X186  a884                    BCC             HRAM_0X84,      0
:0X187  ea00                    SECTION         0X0
:0X188  b101                    RLB             (?_TMP+1)&7f,   R,              0X1 ;(?_TMP+1)&7f: Bank 0    Addr: 1     
:0X189  b102                    RLB             (?_TMP+2)&7f,   R,              0X1 ;(?_TMP+2)&7f: Bank 0    Addr: 2     
:0X18a  b103                    RLB             (?_TMP+3)&7f,   R,              0X1 ;(?_TMP+3)&7f: Bank 0    Addr: 3     
:0X18b  b104                    RLB             (?_TMP+4)&7f,   R,              0X1 ;(?_TMP+4)&7f: Bank 0    Addr: 4     
HADR_0X18C:
:0X18c  e0ff                    ADDI            0XFF
:0X18d  9284                    JBS             HRAM_0X84,      2
:0X18e  6986                    GOTO            HADR_0X186
:0X18f  ea00                    SECTION         0X0
:0X190  5001                    MOV             (?_TMP+1)&7f,   A                   ;(?_TMP+1)&7f: Bank 0    Addr: 1     
:0X191  208c                    MOVAR           HRAM_0X8C
:0X192  5002                    MOV             (?_TMP+2)&7f,   A                   ;(?_TMP+2)&7f: Bank 0    Addr: 2     
:0X193  208d                    MOVAR           HRAM_0X8D
:0X194  5003                    MOV             (?_TMP+3)&7f,   A                   ;(?_TMP+3)&7f: Bank 0    Addr: 3     
:0X195  208e                    MOVAR           HRAM_0X8E
:0X196  5004                    MOV             (?_TMP+4)&7f,   A                   ;(?_TMP+4)&7f: Bank 0    Addr: 4     
:0X197  208f                    MOVAR           HRAM_0X8F
:0X198  ea01                    SECTION         0X1
:0X199  e708                    CLR             HRAM_0X8
:0X19a  e709                    CLR             HRAM_0X9
:0X19b  e70a                    CLR             HRAM_0XA
:0X19c  50a1                    MOV             _ROMD1L_0,      A                   ;_ROMD1L_0: Bank 511    Addr: 65441    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0X19d  e607                    MOVA            HRAM_0X7
:0X19e  e510                    MOVI            0X10
:0X19f  e001                    ADDI            0X1
:0X1a0  2000                    MOVAR           ?_TMP                               ;?_TMP: Bank 0    Addr: 0     
:0X1a1  5007                    MOV             HRAM_0X7,       A
:0X1a2  2001                    MOVAR           ?_TMP+1                             ;?_TMP+1: Bank 0    Addr: 1     
:0X1a3  5008                    MOV             HRAM_0X8,       A
:0X1a4  2002                    MOVAR           ?_TMP+2                             ;?_TMP+2: Bank 0    Addr: 2     
:0X1a5  5009                    MOV             HRAM_0X9,       A
:0X1a6  2003                    MOVAR           ?_TMP+3                             ;?_TMP+3: Bank 0    Addr: 3     
:0X1a7  500a                    MOV             HRAM_0XA,       A
:0X1a8  2004                    MOVAR           ?_TMP+4                             ;?_TMP+4: Bank 0    Addr: 4     
:0X1a9  7800                    MOVRA           ?_TMP                               ;?_TMP: Bank 0    Addr: 0     
:0X1aa  69b1                    GOTO            HADR_0X1B1
HADR_0X1AB:
:0X1ab  a884                    BCC             HRAM_0X84,      0
:0X1ac  ea00                    SECTION         0X0
:0X1ad  b101                    RLB             (?_TMP+1)&7f,   R,              0X1 ;(?_TMP+1)&7f: Bank 0    Addr: 1     
:0X1ae  b102                    RLB             (?_TMP+2)&7f,   R,              0X1 ;(?_TMP+2)&7f: Bank 0    Addr: 2     
:0X1af  b103                    RLB             (?_TMP+3)&7f,   R,              0X1 ;(?_TMP+3)&7f: Bank 0    Addr: 3     
:0X1b0  b104                    RLB             (?_TMP+4)&7f,   R,              0X1 ;(?_TMP+4)&7f: Bank 0    Addr: 4     
HADR_0X1B1:
:0X1b1  e0ff                    ADDI            0XFF
:0X1b2  9284                    JBS             HRAM_0X84,      2
:0X1b3  69ab                    GOTO            HADR_0X1AB
:0X1b4  ea00                    SECTION         0X0
:0X1b5  5001                    MOV             (?_TMP+1)&7f,   A                   ;(?_TMP+1)&7f: Bank 0    Addr: 1     
:0X1b6  2090                    MOVAR           HRAM_0X90
:0X1b7  5002                    MOV             (?_TMP+2)&7f,   A                   ;(?_TMP+2)&7f: Bank 0    Addr: 2     
:0X1b8  2091                    MOVAR           HRAM_0X91
:0X1b9  5003                    MOV             (?_TMP+3)&7f,   A                   ;(?_TMP+3)&7f: Bank 0    Addr: 3     
:0X1ba  2092                    MOVAR           HRAM_0X92
:0X1bb  5004                    MOV             (?_TMP+4)&7f,   A                   ;(?_TMP+4)&7f: Bank 0    Addr: 4     
:0X1bc  2093                    MOVAR           HRAM_0X93
:0X1bd  7890                    MOVRA           HRAM_0X90
:0X1be  ea01                    SECTION         0X1
:0X1bf  580c                    IOR             HRAM_0XC,       A
:0X1c0  e607                    MOVA            HRAM_0X7
:0X1c1  5011                    MOV             HRAM_0X11,      A
:0X1c2  580d                    IOR             HRAM_0XD,       A
:0X1c3  e608                    MOVA            HRAM_0X8
:0X1c4  5012                    MOV             HRAM_0X12,      A
:0X1c5  580e                    IOR             HRAM_0XE,       A
:0X1c6  e609                    MOVA            HRAM_0X9
:0X1c7  5013                    MOV             HRAM_0X13,      A
:0X1c8  580f                    IOR             HRAM_0XF,       A
:0X1c9  e60a                    MOVA            HRAM_0XA
:0X1ca  e70d                    CLR             HRAM_0XD
:0X1cb  e70e                    CLR             HRAM_0XE
:0X1cc  e70f                    CLR             HRAM_0XF
:0X1cd  5093                    MOV             _ROMDH_0,       A                   ;_ROMDH_0: Bank 511    Addr: 65427    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0X1ce  e60c                    MOVA            HRAM_0XC
:0X1cf  500c                    MOV             HRAM_0XC,       A
:0X1d0  e611                    MOVA            HRAM_0X11
:0X1d1  500d                    MOV             HRAM_0XD,       A
:0X1d2  e612                    MOVA            HRAM_0X12
:0X1d3  500e                    MOV             HRAM_0XE,       A
:0X1d4  e613                    MOVA            HRAM_0X13
:0X1d5  e710                    CLR             HRAM_0X10
:0X1d6  5010                    MOV             HRAM_0X10,      A
:0X1d7  5807                    IOR             HRAM_0X7,       A
:0X1d8  e60c                    MOVA            HRAM_0XC
:0X1d9  5011                    MOV             HRAM_0X11,      A
:0X1da  5808                    IOR             HRAM_0X8,       A
:0X1db  e60d                    MOVA            HRAM_0XD
:0X1dc  5012                    MOV             HRAM_0X12,      A
:0X1dd  5809                    IOR             HRAM_0X9,       A
:0X1de  e60e                    MOVA            HRAM_0XE
:0X1df  5013                    MOV             HRAM_0X13,      A
:0X1e0  580a                    IOR             HRAM_0XA,       A
:0X1e1  e60f                    MOVA            HRAM_0XF
:0X1e2  e711                    CLR             HRAM_0X11
:0X1e3  e712                    CLR             HRAM_0X12
:0X1e4  e713                    CLR             HRAM_0X13
:0X1e5  5092                    MOV             _ROMDL_0,       A                   ;_ROMDL_0: Bank 511    Addr: 65426    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0X1e6  e610                    MOVA            HRAM_0X10
:0X1e7  5010                    MOV             HRAM_0X10,      A
:0X1e8  580c                    IOR             HRAM_0XC,       A
:0X1e9  e607                    MOVA            HRAM_0X7
:0X1ea  5011                    MOV             HRAM_0X11,      A
:0X1eb  580d                    IOR             HRAM_0XD,       A
:0X1ec  e608                    MOVA            HRAM_0X8
:0X1ed  5012                    MOV             HRAM_0X12,      A
:0X1ee  580e                    IOR             HRAM_0XE,       A
:0X1ef  e609                    MOVA            HRAM_0X9
:0X1f0  5013                    MOV             HRAM_0X13,      A
:0X1f1  580f                    IOR             HRAM_0XF,       A
:0X1f2  e60a                    MOVA            HRAM_0XA
;    DATARDEN = 0;       //DATA区读出禁止
:0X1f3  af94                    BCC             (_DATARDEN_0)>>3,               7   ;(_DATARDEN_0)>>3: Bank 511    Addr: 65428    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    GIE = gie_bk;       //恢复全局中断
:0X1f4  ea00                    SECTION         0X0
:0X1f5  aa0a                    BCC             ((_DataFlashRdData_#T20632_12)>>3)&7f,          2   ;((_DataFlashRdData_#T20632_12)>>3)&7f: Bank 0    Addr: 10    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0X1f6  ea01                    SECTION         0X1
:0X1f7  900b                    JBS             HRAM_0XB,       0
:0X1f8  69fb                    GOTO            HADR_0X1FB
:0X1f9  ea00                    SECTION         0X0
:0X1fa  a20a                    BSS             ((_DataFlashRdData_#T20632_12)>>3)&7f,          2   ;((_DataFlashRdData_#T20632_12)>>3)&7f: Bank 0    Addr: 10    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
HADR_0X1FB:
:0X1fb  ea00                    SECTION         0X0
:0X1fc  9a0a                    JBC             HRAM_0XA,       2
:0X1fd  6a00                    GOTO            HADR_0X200
:0X1fe  af96                    BCC             (_GIE_0)>>3,    7                   ;(_GIE_0)>>3: Bank 511    Addr: 65430    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0X1ff  6a01                    GOTO            HADR_0X201
HADR_0X200:
:0X200  a796                    BSS             (_GIE_0)>>3,    7                   ;(_GIE_0)>>3: Bank 511    Addr: 65430    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
HADR_0X201:
;    return data;
:0X201  ea01                    SECTION         0X1
:0X202  5007                    MOV             HRAM_0X7,       A
:0X203  2000                    MOVAR           ?_TMP                               ;?_TMP: Bank 0    Addr: 0     
:0X204  5008                    MOV             HRAM_0X8,       A
:0X205  2001                    MOVAR           ?_TMP+1                             ;?_TMP+1: Bank 0    Addr: 1     
:0X206  5009                    MOV             HRAM_0X9,       A
:0X207  2002                    MOVAR           ?_TMP+2                             ;?_TMP+2: Bank 0    Addr: 2     
:0X208  500a                    MOV             HRAM_0XA,       A
:0X209  2003                    MOVAR           ?_TMP+3                             ;?_TMP+3: Bank 0    Addr: 3     
:0X20a  7800                    MOVRA           ?_TMP                               ;?_TMP: Bank 0    Addr: 0     
:0X20b  ea00                    SECTION         0X0
:0X20c  c183                    RET
HADR_0X20D:
;}
;
;/*******************************************************
;函数名：void DataFlashWrData(unsigned int addr, unsigned long word)
;描  述：写DataFlash指定地址的数据，地址范围：0xC000~0xC1FF
;输入值：DataFlash地址addr，DataFlash取反地址addri，待写的数据word
;输出值：无
;返回值：0:写入失败，1:写入成功
;*******************************************************/
;unsigned char DataFlashWrData(unsigned int addr, unsigned int addri, unsigned long word)
;{
;    unsigned char rmdh, rmdl, rmd1h, rmd1l;   //临时存放ROMDH、ROMDL值
;    unsigned char gie_bk = GIE;   //备份GIE
:0X20d  e783                    CLR             HRAM_0X83
:0X20e  e500                    MOVI            0X0
:0X20f  9f96                    JBC             HRAM_0X96,      7
:0X210  e501                    MOVI            0X1
:0X211  ea01                    SECTION         0X1
:0X212  e610                    MOVA            HRAM_0X10
:0X213  5010                    MOV             HRAM_0X10,      A
:0X214  e60f                    MOVA            HRAM_0XF
;    unsigned int reault; 
;	
;    CLRWDT();
:0X215  c18b                    CWDT
HADR_0X216:
;
;    while (GIE == 1)GIE = 0;           //启动IAP前关闭全局中断
:0X216  e500                    MOVI            0X0
:0X217  9f96                    JBC             HRAM_0X96,      7
:0X218  e501                    MOVI            0X1
:0X219  e610                    MOVA            HRAM_0X10
:0X21a  5010                    MOV             HRAM_0X10,      A
:0X21b  e301                    XORI            0X1
:0X21c  9284                    JBS             HRAM_0X84,      2
:0X21d  6a20                    GOTO            HADR_0X220
:0X21e  af96                    BCC             (_GIE_0)>>3,    7                   ;(_GIE_0)>>3: Bank 511    Addr: 65430    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0X21f  6a16                    GOTO            HADR_0X216
HADR_0X220:
;
;    FlashEwEn = 0xAA;//设置软件锁变量
:0X220  e5aa                    MOVI            0XAA
:0X221  e615                    MOVA            (_FlashEwEn)&7f                     ;(_FlashEwEn)&7f: Bank 0    Addr: 21     
;
;    FPEE = 0;           //存储器编程模式
:0X222  ab94                    BCC             (_FPEE_0)>>3,   3                   ;(_FPEE_0)>>3: Bank 511    Addr: 65428    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    ROMD1H = word >> 24;  //写Word
:0X223  e518                    MOVI            0X18
:0X224  e001                    ADDI            0X1
:0X225  2000                    MOVAR           ?_TMP                               ;?_TMP: Bank 0    Addr: 0     
:0X226  500b                    MOV             HRAM_0XB,       A
:0X227  2001                    MOVAR           ?_TMP+1                             ;?_TMP+1: Bank 0    Addr: 1     
:0X228  500c                    MOV             HRAM_0XC,       A
:0X229  2002                    MOVAR           ?_TMP+2                             ;?_TMP+2: Bank 0    Addr: 2     
:0X22a  500d                    MOV             HRAM_0XD,       A
:0X22b  2003                    MOVAR           ?_TMP+3                             ;?_TMP+3: Bank 0    Addr: 3     
:0X22c  500e                    MOV             HRAM_0XE,       A
:0X22d  2004                    MOVAR           ?_TMP+4                             ;?_TMP+4: Bank 0    Addr: 4     
:0X22e  7800                    MOVRA           ?_TMP                               ;?_TMP: Bank 0    Addr: 0     
:0X22f  6a36                    GOTO            HADR_0X236
HADR_0X230:
:0X230  a884                    BCC             HRAM_0X84,      0
:0X231  ea00                    SECTION         0X0
:0X232  d104                    RRB             (?_TMP+4)&7f,   R,              0X1 ;(?_TMP+4)&7f: Bank 0    Addr: 4     
:0X233  d103                    RRB             (?_TMP+3)&7f,   R,              0X1 ;(?_TMP+3)&7f: Bank 0    Addr: 3     
:0X234  d102                    RRB             (?_TMP+2)&7f,   R,              0X1 ;(?_TMP+2)&7f: Bank 0    Addr: 2     
:0X235  d101                    RRB             (?_TMP+1)&7f,   R,              0X1 ;(?_TMP+1)&7f: Bank 0    Addr: 1     
HADR_0X236:
:0X236  e0ff                    ADDI            0XFF
:0X237  9284                    JBS             HRAM_0X84,      2
:0X238  6a30                    GOTO            HADR_0X230
:0X239  ea00                    SECTION         0X0
:0X23a  5001                    MOV             (?_TMP+1)&7f,   A                   ;(?_TMP+1)&7f: Bank 0    Addr: 1     
:0X23b  e6a2                    MOVA            _ROMD1H_0                           ;_ROMD1H_0: Bank 511    Addr: 65442    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    ROMD1L = word >> 16;
:0X23c  e510                    MOVI            0X10
:0X23d  e001                    ADDI            0X1
:0X23e  e600                    MOVA            (?_TMP)&7f                          ;(?_TMP)&7f: Bank 0    Addr: 0     
:0X23f  788b                    MOVRA           HRAM_0X8B
:0X240  e601                    MOVA            (?_TMP+1)&7f                        ;(?_TMP+1)&7f: Bank 0    Addr: 1     
:0X241  788c                    MOVRA           HRAM_0X8C
:0X242  e602                    MOVA            (?_TMP+2)&7f                        ;(?_TMP+2)&7f: Bank 0    Addr: 2     
:0X243  788d                    MOVRA           HRAM_0X8D
:0X244  e603                    MOVA            (?_TMP+3)&7f                        ;(?_TMP+3)&7f: Bank 0    Addr: 3     
:0X245  788e                    MOVRA           HRAM_0X8E
:0X246  e604                    MOVA            (?_TMP+4)&7f                        ;(?_TMP+4)&7f: Bank 0    Addr: 4     
:0X247  5000                    MOV             (?_TMP)&7f,     A                   ;(?_TMP)&7f: Bank 0    Addr: 0     
:0X248  6a4e                    GOTO            HADR_0X24E
HADR_0X249:
:0X249  a884                    BCC             HRAM_0X84,      0
:0X24a  d104                    RRB             (?_TMP+4)&7f,   R,              0X1 ;(?_TMP+4)&7f: Bank 0    Addr: 4     
:0X24b  d103                    RRB             (?_TMP+3)&7f,   R,              0X1 ;(?_TMP+3)&7f: Bank 0    Addr: 3     
:0X24c  d102                    RRB             (?_TMP+2)&7f,   R,              0X1 ;(?_TMP+2)&7f: Bank 0    Addr: 2     
:0X24d  d101                    RRB             (?_TMP+1)&7f,   R,              0X1 ;(?_TMP+1)&7f: Bank 0    Addr: 1     
HADR_0X24E:
:0X24e  e0ff                    ADDI            0XFF
:0X24f  9284                    JBS             HRAM_0X84,      2
:0X250  6a49                    GOTO            HADR_0X249
:0X251  5001                    MOV             (?_TMP+1)&7f,   A                   ;(?_TMP+1)&7f: Bank 0    Addr: 1     
:0X252  e6a1                    MOVA            _ROMD1L_0                           ;_ROMD1L_0: Bank 511    Addr: 65441    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    ROMDH = word >> 8;
:0X253  e508                    MOVI            0X8
:0X254  e001                    ADDI            0X1
:0X255  e600                    MOVA            (?_TMP)&7f                          ;(?_TMP)&7f: Bank 0    Addr: 0     
:0X256  788b                    MOVRA           HRAM_0X8B
:0X257  e601                    MOVA            (?_TMP+1)&7f                        ;(?_TMP+1)&7f: Bank 0    Addr: 1     
:0X258  788c                    MOVRA           HRAM_0X8C
:0X259  e602                    MOVA            (?_TMP+2)&7f                        ;(?_TMP+2)&7f: Bank 0    Addr: 2     
:0X25a  788d                    MOVRA           HRAM_0X8D
:0X25b  e603                    MOVA            (?_TMP+3)&7f                        ;(?_TMP+3)&7f: Bank 0    Addr: 3     
:0X25c  788e                    MOVRA           HRAM_0X8E
:0X25d  e604                    MOVA            (?_TMP+4)&7f                        ;(?_TMP+4)&7f: Bank 0    Addr: 4     
:0X25e  5000                    MOV             (?_TMP)&7f,     A                   ;(?_TMP)&7f: Bank 0    Addr: 0     
:0X25f  6a65                    GOTO            HADR_0X265
HADR_0X260:
:0X260  a884                    BCC             HRAM_0X84,      0
:0X261  d104                    RRB             (?_TMP+4)&7f,   R,              0X1 ;(?_TMP+4)&7f: Bank 0    Addr: 4     
:0X262  d103                    RRB             (?_TMP+3)&7f,   R,              0X1 ;(?_TMP+3)&7f: Bank 0    Addr: 3     
:0X263  d102                    RRB             (?_TMP+2)&7f,   R,              0X1 ;(?_TMP+2)&7f: Bank 0    Addr: 2     
:0X264  d101                    RRB             (?_TMP+1)&7f,   R,              0X1 ;(?_TMP+1)&7f: Bank 0    Addr: 1     
HADR_0X265:
:0X265  e0ff                    ADDI            0XFF
:0X266  9284                    JBS             HRAM_0X84,      2
:0X267  6a60                    GOTO            HADR_0X260
:0X268  5001                    MOV             (?_TMP+1)&7f,   A                   ;(?_TMP+1)&7f: Bank 0    Addr: 1     
:0X269  e693                    MOVA            _ROMDH_0                            ;_ROMDH_0: Bank 511    Addr: 65427    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    ROMDL = word;
:0X26a  788b                    MOVRA           HRAM_0X8B
:0X26b  e692                    MOVA            _ROMDL_0                            ;_ROMDL_0: Bank 511    Addr: 65426    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    FRAH = addr >> 8;   //IAP编程地址
:0X26c  e508                    MOVI            0X8
:0X26d  e001                    ADDI            0X1
:0X26e  e600                    MOVA            (?_TMP)&7f                          ;(?_TMP)&7f: Bank 0    Addr: 0     
:0X26f  7887                    MOVRA           HRAM_0X87
:0X270  e601                    MOVA            (?_TMP+1)&7f                        ;(?_TMP+1)&7f: Bank 0    Addr: 1     
:0X271  7888                    MOVRA           HRAM_0X88
:0X272  e602                    MOVA            (?_TMP+2)&7f                        ;(?_TMP+2)&7f: Bank 0    Addr: 2     
:0X273  5000                    MOV             (?_TMP)&7f,     A                   ;(?_TMP)&7f: Bank 0    Addr: 0     
:0X274  6a78                    GOTO            HADR_0X278
HADR_0X275:
:0X275  a884                    BCC             HRAM_0X84,      0
:0X276  d102                    RRB             (?_TMP+2)&7f,   R,              0X1 ;(?_TMP+2)&7f: Bank 0    Addr: 2     
:0X277  d101                    RRB             (?_TMP+1)&7f,   R,              0X1 ;(?_TMP+1)&7f: Bank 0    Addr: 1     
HADR_0X278:
:0X278  e0ff                    ADDI            0XFF
:0X279  9284                    JBS             HRAM_0X84,      2
:0X27a  6a75                    GOTO            HADR_0X275
:0X27b  5001                    MOV             (?_TMP+1)&7f,   A                   ;(?_TMP+1)&7f: Bank 0    Addr: 1     
:0X27c  e691                    MOVA            _FRAH_0                             ;_FRAH_0: Bank 511    Addr: 65425    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    FRAL = addr;
:0X27d  7887                    MOVRA           HRAM_0X87
:0X27e  e690                    MOVA            _FRAL_0                             ;_FRAL_0: Bank 511    Addr: 65424    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    FRAHN = addri >> 8;    //IAP擦除/编程必须满足地址取反逻辑
:0X27f  e508                    MOVI            0X8
:0X280  e001                    ADDI            0X1
:0X281  e600                    MOVA            (?_TMP)&7f                          ;(?_TMP)&7f: Bank 0    Addr: 0     
:0X282  7889                    MOVRA           HRAM_0X89
:0X283  e601                    MOVA            (?_TMP+1)&7f                        ;(?_TMP+1)&7f: Bank 0    Addr: 1     
:0X284  788a                    MOVRA           HRAM_0X8A
:0X285  e602                    MOVA            (?_TMP+2)&7f                        ;(?_TMP+2)&7f: Bank 0    Addr: 2     
:0X286  5000                    MOV             (?_TMP)&7f,     A                   ;(?_TMP)&7f: Bank 0    Addr: 0     
:0X287  6a8b                    GOTO            HADR_0X28B
HADR_0X288:
:0X288  a884                    BCC             HRAM_0X84,      0
:0X289  d102                    RRB             (?_TMP+2)&7f,   R,              0X1 ;(?_TMP+2)&7f: Bank 0    Addr: 2     
:0X28a  d101                    RRB             (?_TMP+1)&7f,   R,              0X1 ;(?_TMP+1)&7f: Bank 0    Addr: 1     
HADR_0X28B:
:0X28b  e0ff                    ADDI            0XFF
:0X28c  9284                    JBS             HRAM_0X84,      2
:0X28d  6a88                    GOTO            HADR_0X288
:0X28e  5001                    MOV             (?_TMP+1)&7f,   A                   ;(?_TMP+1)&7f: Bank 0    Addr: 1     
:0X28f  e68f                    MOVA            _FRAHN_0                            ;_FRAHN_0: Bank 511    Addr: 65423    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    FRALN = addri;
:0X290  7889                    MOVRA           HRAM_0X89
:0X291  e68e                    MOVA            _FRALN_0                            ;_FRALN_0: Bank 511    Addr: 65422    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;
;    WREN = 1;           //使能编程
:0X292  a294                    BSS             (_WREN_0)>>3,   2                   ;(_WREN_0)>>3: Bank 511    Addr: 65428    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    StartIAP();         //开始IAP操作
:0X293  ec00                    PAGE            (_StartIAP)>>11
:0X294  60d1                    CALL            HADR_0XD1
:0X295  ec00                    PAGE            (_4)>>11
;    CallFlashEn = 0;//清零软件锁变量
:0X296  ea01                    SECTION         0X1
:0X297  e714                    CLR             (_CallFlashEn)&7f                   ;(_CallFlashEn)&7f: Bank 0    Addr: 20     
;    FlashEwEn = 0;
:0X298  e715                    CLR             (_FlashEwEn)&7f                     ;(_FlashEwEn)&7f: Bank 0    Addr: 21     
;    rmdh = ROMDH++;
:0X299  5093                    MOV             _ROMDH_0,       A                   ;_ROMDH_0: Bank 511    Addr: 65427    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0X29a  e609                    MOVA            HRAM_0X9
:0X29b  5593                    INC             _ROMDH_0,       R                   ;_ROMDH_0: Bank 511    Addr: 65427    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    rmdl = ROMDL++;
:0X29c  5092                    MOV             _ROMDL_0,       A                   ;_ROMDL_0: Bank 511    Addr: 65426    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0X29d  e60a                    MOVA            HRAM_0XA
:0X29e  5592                    INC             _ROMDL_0,       R                   ;_ROMDL_0: Bank 511    Addr: 65426    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    rmd1h = ROMD1H++;
:0X29f  50a2                    MOV             _ROMD1H_0,      A                   ;_ROMD1H_0: Bank 511    Addr: 65442    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0X2a0  e60b                    MOVA            HRAM_0XB
:0X2a1  55a2                    INC             _ROMD1H_0,      R                   ;_ROMD1H_0: Bank 511    Addr: 65442    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    rmd1l = ROMD1L++;
:0X2a2  50a1                    MOV             _ROMD1L_0,      A                   ;_ROMD1L_0: Bank 511    Addr: 65441    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0X2a3  e60c                    MOVA            HRAM_0XC
:0X2a4  55a1                    INC             _ROMD1L_0,      R                   ;_ROMD1L_0: Bank 511    Addr: 65441    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    DATARDEN = 1;    //DATA区读出使能
:0X2a5  a794                    BSS             (_DATARDEN_0)>>3,               7   ;(_DATARDEN_0)>>3: Bank 511    Addr: 65428    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    FRAH = addr >> 8;
:0X2a6  e508                    MOVI            0X8
:0X2a7  e001                    ADDI            0X1
:0X2a8  2000                    MOVAR           ?_TMP                               ;?_TMP: Bank 0    Addr: 0     
:0X2a9  5007                    MOV             HRAM_0X7,       A
:0X2aa  2001                    MOVAR           ?_TMP+1                             ;?_TMP+1: Bank 0    Addr: 1     
:0X2ab  5008                    MOV             HRAM_0X8,       A
:0X2ac  2002                    MOVAR           ?_TMP+2                             ;?_TMP+2: Bank 0    Addr: 2     
:0X2ad  7800                    MOVRA           ?_TMP                               ;?_TMP: Bank 0    Addr: 0     
:0X2ae  6ab3                    GOTO            HADR_0X2B3
HADR_0X2AF:
:0X2af  a884                    BCC             HRAM_0X84,      0
:0X2b0  ea00                    SECTION         0X0
:0X2b1  d102                    RRB             (?_TMP+2)&7f,   R,              0X1 ;(?_TMP+2)&7f: Bank 0    Addr: 2     
:0X2b2  d101                    RRB             (?_TMP+1)&7f,   R,              0X1 ;(?_TMP+1)&7f: Bank 0    Addr: 1     
HADR_0X2B3:
:0X2b3  e0ff                    ADDI            0XFF
:0X2b4  9284                    JBS             HRAM_0X84,      2
:0X2b5  6aaf                    GOTO            HADR_0X2AF
:0X2b6  ea00                    SECTION         0X0
:0X2b7  5001                    MOV             (?_TMP+1)&7f,   A                   ;(?_TMP+1)&7f: Bank 0    Addr: 1     
:0X2b8  e691                    MOVA            _FRAH_0                             ;_FRAH_0: Bank 511    Addr: 65425    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    FRAL = addr;
:0X2b9  7887                    MOVRA           HRAM_0X87
:0X2ba  e690                    MOVA            _FRAL_0                             ;_FRAL_0: Bank 511    Addr: 65424    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;    DATARDTRG = 1;   //DATA区读出触发
:0X2bb  a094                    BSS             (_DATARDTRG_0)>>3,              0   ;(_DATARDTRG_0)>>3: Bank 511    Addr: 65428    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
HADR_0X2BC:
;
;    while (DATARDTRG);
:0X2bc  9894                    JBC             HRAM_0X94,      0
:0X2bd  6abc                    GOTO            HADR_0X2BC
;
;    __Asm TBR;          //查表读指令
:0X2be  c184                    TBR
;
;    if (ROMDH == rmdh && ROMDL == rmdl && ROMD1H == rmd1h && ROMD1L == rmd1l)
:0X2bf  ea01                    SECTION         0X1
:0X2c0  5009                    MOV             HRAM_0X9,       A
:0X2c1  5c93                    XOR             _ROMDH_0,       A                   ;_ROMDH_0: Bank 511    Addr: 65427    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0X2c2  9284                    JBS             HRAM_0X84,      2
:0X2c3  6ad5                    GOTO            HADR_0X2D5
:0X2c4  500a                    MOV             HRAM_0XA,       A
:0X2c5  5c92                    XOR             _ROMDL_0,       A                   ;_ROMDL_0: Bank 511    Addr: 65426    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0X2c6  9284                    JBS             HRAM_0X84,      2
:0X2c7  6ad5                    GOTO            HADR_0X2D5
:0X2c8  500b                    MOV             HRAM_0XB,       A
:0X2c9  5ca2                    XOR             _ROMD1H_0,      A                   ;_ROMD1H_0: Bank 511    Addr: 65442    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0X2ca  9284                    JBS             HRAM_0X84,      2
:0X2cb  6ad5                    GOTO            HADR_0X2D5
:0X2cc  500c                    MOV             HRAM_0XC,       A
:0X2cd  5ca1                    XOR             _ROMD1L_0,      A                   ;_ROMD1L_0: Bank 511    Addr: 65441    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0X2ce  9284                    JBS             HRAM_0X84,      2
:0X2cf  6ad5                    GOTO            HADR_0X2D5
;    {
;		reault = 1;
:0X2d0  e500                    MOVI            0X0
:0X2d1  e608                    MOVA            HRAM_0X8
:0X2d2  e501                    MOVI            0X1
:0X2d3  e607                    MOVA            HRAM_0X7
;    }
:0X2d4  6ad7                    GOTO            HADR_0X2D7
HADR_0X2D5:
;	else
:0X2d5  e707                    CLR             HRAM_0X7
:0X2d6  e708                    CLR             HRAM_0X8
HADR_0X2D7:
;	}
:0X2d7  e794                    CLR             _ROMCL_0                            ;_ROMCL_0: Bank 511    Addr: 65428    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;	FRA = 0xFF12;//指到不用的地址空间
:0X2d8  e5ff                    MOVI            0XFF
:0X2d9  e691                    MOVA            _FRA_0+1                            ;_FRA_0+1: Bank 511    Addr: 65425    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0X2da  e512                    MOVI            0X12
:0X2db  e690                    MOVA            _FRA_0                              ;_FRA_0: Bank 511    Addr: 65424    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;	FRAN = 0x3456;//此处把地址反码赋成与0xFFFF和FRA无取反关系的值
:0X2dc  e534                    MOVI            0X34
:0X2dd  e68f                    MOVA            _FRAN_0+1                           ;_FRAN_0+1: Bank 511    Addr: 65423    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0X2de  e556                    MOVI            0X56
:0X2df  e68e                    MOVA            _FRAN_0                             ;_FRAN_0: Bank 511    Addr: 65422    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;	ROMDH = 0xFF;//数据初始化为0xFF
:0X2e0  e5ff                    MOVI            0XFF
:0X2e1  e693                    MOVA            _ROMDH_0                            ;_ROMDH_0: Bank 511    Addr: 65427    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;	ROMDL = 0xFF;//数据初始化为0xFF
:0X2e2  e5ff                    MOVI            0XFF
:0X2e3  e692                    MOVA            _ROMDL_0                            ;_ROMDL_0: Bank 511    Addr: 65426    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;	ROMD1H = 0xFF;//数据初始化为0xFF
:0X2e4  e5ff                    MOVI            0XFF
:0X2e5  e6a2                    MOVA            _ROMD1H_0                           ;_ROMD1H_0: Bank 511    Addr: 65442    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;	ROMD1L = 0xFF;//数据初始化为0xFF
:0X2e6  e5ff                    MOVI            0XFF
:0X2e7  e6a1                    MOVA            _ROMD1L_0                           ;_ROMD1L_0: Bank 511    Addr: 65441    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
;	CallFlashEn = 0;//清零软件锁变量
:0X2e8  e714                    CLR             (_CallFlashEn)&7f                   ;(_CallFlashEn)&7f: Bank 0    Addr: 20     
;	FlashEwEn = 0; 
:0X2e9  e715                    CLR             (_FlashEwEn)&7f                     ;(_FlashEwEn)&7f: Bank 0    Addr: 21     
;	GIE = gie_bk;            //恢复全局中断
:0X2ea  ea00                    SECTION         0X0
:0X2eb  a80a                    BCC             ((_DataFlashWrData_#T20984_15)>>3)&7f,          0   ;((_DataFlashWrData_#T20984_15)>>3)&7f: Bank 0    Addr: 10    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0X2ec  ea01                    SECTION         0X1
:0X2ed  900f                    JBS             HRAM_0XF,       0
:0X2ee  6af1                    GOTO            HADR_0X2F1
:0X2ef  ea00                    SECTION         0X0
:0X2f0  a00a                    BSS             ((_DataFlashWrData_#T20984_15)>>3)&7f,          0   ;((_DataFlashWrData_#T20984_15)>>3)&7f: Bank 0    Addr: 10    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
HADR_0X2F1:
:0X2f1  ea00                    SECTION         0X0
:0X2f2  980a                    JBC             HRAM_0XA,       0
:0X2f3  6af6                    GOTO            HADR_0X2F6
:0X2f4  af96                    BCC             (_GIE_0)>>3,    7                   ;(_GIE_0)>>3: Bank 511    Addr: 65430    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
:0X2f5  6af7                    GOTO            HADR_0X2F7
HADR_0X2F6:
:0X2f6  a796                    BSS             (_GIE_0)>>3,    7                   ;(_GIE_0)>>3: Bank 511    Addr: 65430    D:\WorkSpace\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\IAP\iap_dataflash\debug\iap_dataflash.obj 
HADR_0X2F7:
;
;	return reault;
:0X2f7  ea01                    SECTION         0X1
:0X2f8  5007                    MOV             HRAM_0X7,       A
:0X2f9  e609                    MOVA            HRAM_0X9
:0X2fa  5009                    MOV             HRAM_0X9,       A
:0X2fb  2000                    MOVAR           ?_TMP                               ;?_TMP: Bank 0    Addr: 0     
:0X2fc  ea00                    SECTION         0X0
:0X2fd  c183                    RET

                                END
