;The Num of Instruction(Size):140. The Max Address(Begin with 0):6178 

                MCU  ES7P169C

A    equ    0
R    equ    1
HRAM_0X0  equ  0X0
HRAM_0X1  equ  0X1
HRAM_0X2  equ  0X2
HRAM_0X3  equ  0X3
HRAM_0X80  equ  0X80
HRAM_0X81  equ  0X81
HRAM_0X83  equ  0X83
HRAM_0X84  equ  0X84
HRAM_0X9A  equ  0X9a

                ORG             0X00
HADR_0X0:
:0X0  c703f000                  AJMP            HADR_0X3
                                ORG             0X2
:0X2  6800                      GOTO            HADR_0X0
HADR_0X3:
;
;/**********************************************
;函数名：void main(void) 
;描  述：主函数
;输入值：无
;输出值：无
;返回值：无
;**********************************************/
;void main(void) 
;{
;    uchar i;
;    RAMclear();
:0X3  e783                      CLR             HRAM_0X83
:0X4  ec00                      PAGE            (_RAMclear)>>11
:0X5  604b                      CALL            HADR_0X4B
:0X6  ec00                      PAGE            (_0)>>11
HADR_0X7:
;    GPIOInit();
:0X7  ec00                      PAGE            (_GPIOInit)>>11
:0X8  605d                      CALL            HADR_0X5D
:0X9  ec00                      PAGE            (_1)>>11
HADR_0XA:
;    WDTC = 0x16;         //分频比1:128，使能WDT预分频器，看门狗溢出时间t=256*128/32000=1.024s
:0Xa  e516                      MOVI            0X16
:0Xb  e6a4                      MOVA            _WDTC_0                               ;_WDTC_0: Bank 511    Addr: 65444    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\WDT\wdt\debug\wdt.obj 
;
;/****************T8N初始化********************/
;    T8NC = 0x0E;         //定时器模式，预分频1:(Fosc/2)/128
:0Xc  e50e                      MOVI            0XE
:0Xd  e6be                      MOVA            _T8NC_0                               ;_T8NC_0: Bank 511    Addr: 65470    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\WDT\wdt\debug\wdt.obj 
HADR_0XE:
;    T8NIF = 0;           //清溢出标志位
:0Xe  a99a                      BCC             (_T8NIF_0)>>3,  1                     ;(_T8NIF_0)>>3: Bank 511    Addr: 65434    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\WDT\wdt\debug\wdt.obj 
;    T8NEN = 1;           //使能T8N
:0Xf  a7be                      BSS             (_T8NEN_0)>>3,  7                     ;(_T8NEN_0)>>3: Bank 511    Addr: 65470    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\WDT\wdt\debug\wdt.obj 
;    for (i=0; i<200; i++)       //上电快速翻转
:0X10  ea01                     SECTION         0X1
:0X11  e700                     CLR             HRAM_0X0
HADR_0X12:
:0X12  e5c8                     MOVI            0XC8
:0X13  ee00                     SUB             HRAM_0X0,       A
:0X14  9884                     JBC             HRAM_0X84,      0
:0X15  6833                     GOTO            HADR_0X33
HADR_0X16:
;    {
;        while (T8NIF != 1)      //等待定时器溢出
:0X16  e500                     MOVI            0X0
:0X17  999a                     JBC             HRAM_0X9A,      1
:0X18  e501                     MOVI            0X1
:0X19  e601                     MOVA            HRAM_0X1
:0X1a  5001                     MOV             HRAM_0X1,       A
:0X1b  e301                     XORI            0X1
:0X1c  9284                     JBS             HRAM_0X84,      2
:0X1d  6816                     GOTO            HADR_0X16
;            ;
;        if (i%10 == 0)
:0X1e  e50a                     MOVI            0XA
:0X1f  ea00                     SECTION         0X0
:0X20  e601                     MOVA            (?_TMP+1)&7f                         ;(?_TMP+1)&7f: Bank 0    Addr: 1     
HADR_0X21:
:0X21  7880                     MOVRA           HRAM_0X80
:0X22  e600                     MOVA            (?_TMP)&7f                           ;(?_TMP)&7f: Bank 0    Addr: 0     
:0X23  ec03                     PAGE            (BMOD)>>11
:0X24  6000                     CALL            HADR_0X0
:0X25  ec00                     PAGE            (_2)>>11
:0X26  5000                     MOV             (?_TMP)&7f,     A                    ;(?_TMP)&7f: Bank 0    Addr: 0     
:0X27  2081                     MOVAR           HRAM_0X81
:0X28  ea01                     SECTION         0X1
:0X29  e702                     CLR             HRAM_0X2
:0X2a  5001                     MOV             HRAM_0X1,       A
:0X2b  5802                     IOR             HRAM_0X2,       A
:0X2c  9284                     JBS             HRAM_0X84,      2
:0X2d  6830                     GOTO            HADR_0X30
;		{
;			CLRWDT();       //清狗
:0X2e  c18b                     CWDT
;            PB6 = ~PB6;
:0X2f  2ea9                     BTT             (_PB6_0)>>3,    6                    ;(_PB6_0)>>3: Bank 511    Addr: 65449    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\WDT\wdt\debug\wdt.obj 
HADR_0X30:
;		}
:0X30  a99a                     BCC             (_T8NIF_0)>>3,  1                    ;(_T8NIF_0)>>3: Bank 511    Addr: 65434    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\WDT\wdt\debug\wdt.obj 
:0X31  5500                     INC             HRAM_0X0,       R
;    }
:0X32  6812                     GOTO            HADR_0X12
HADR_0X33:
;    while(1)
:0X33  c18b                     CWDT
HADR_0X34:
;        while (T8NIF != 1);      //等待定时器溢出
:0X34  e500                     MOVI            0X0
:0X35  999a                     JBC             HRAM_0X9A,      1
:0X36  e501                     MOVI            0X1
:0X37  e600                     MOVA            HRAM_0X0
:0X38  5000                     MOV             HRAM_0X0,       A
:0X39  e301                     XORI            0X1
:0X3a  9284                     JBS             HRAM_0X84,      2
:0X3b  6834                     GOTO            HADR_0X34
;
;        if (++timer_cnt == 125)        //约0.5s定时
:0X3c  5003                     MOV             (_timer_cnt)&7f,                A    ;(_timer_cnt)&7f: Bank 0    Addr: 3     
:0X3d  e001                     ADDI            0X1
:0X3e  e600                     MOVA            HRAM_0X0
:0X3f  5000                     MOV             HRAM_0X0,       A
:0X40  e603                     MOVA            (_timer_cnt)&7f                      ;(_timer_cnt)&7f: Bank 0    Addr: 3     
:0X41  5000                     MOV             HRAM_0X0,       A
:0X42  e601                     MOVA            HRAM_0X1
:0X43  5001                     MOV             HRAM_0X1,       A
:0X44  e37d                     XORI            0X7D
:0X45  9284                     JBS             HRAM_0X84,      2
:0X46  6849                     GOTO            HADR_0X49
;        {
;            timer_cnt = 0;
:0X47  e703                     CLR             (_timer_cnt)&7f                      ;(_timer_cnt)&7f: Bank 0    Addr: 3     
;            PB6 = ~PB6;
:0X48  2ea9                     BTT             (_PB6_0)>>3,    6                    ;(_PB6_0)>>3: Bank 511    Addr: 65449    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\WDT\wdt\debug\wdt.obj 
HADR_0X49:
;        }  
:0X49  a99a                     BCC             (_T8NIF_0)>>3,  1                    ;(_T8NIF_0)>>3: Bank 511    Addr: 65434    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\WDT\wdt\debug\wdt.obj 
;    }
:0X4a  6833                     GOTO            HADR_0X33
HADR_0X4B:
;/*********************************************************
;*Copyright (C), 2020, Shanghai Eastsoft Microelectronics Co., Ltd
;*文件名:  wdt.c
;*作  者:  AE Team
;*版  本:  v1.0，编译于iDesigner(v4.2.3.166) + 工具链HRCC(v1.2.0.106)
;*日  期:  2020/07/08
;*描  述:  WDT复位演示
;          PB6：管脚翻转
;          配置字中使能WDTEN，初始PB6对应的LED1闪烁一段时间，然后以约0.5s闪烁一次，如果程序中不清狗，则芯片工作一段时间会复位。
;          分频比1:128,看门狗溢出时间t=256*128/32000=1.024s
;*备  注:  本软件仅供学习和演示使用，对用户直接引用代码所带来的风险或后果不承担任何法律责任。
;**********************************************************/
;#include <hic.h>
;
;#define CLRWDT()   {__Asm CWDT;}        //宏定义清狗指令
;
;typedef unsigned char uchar;
;uchar timer_cnt;        //计数器溢出次数
;
;/******************************************************
;函数名：void RAMclear(void)
;描  述：RAM区数据清零，RAM区地址0x0000~0x03FF
;输入值：无
;输出值：无
;返回值：无
;*******************************************************/
;void RAMclear(void)
;{
;    for (IAAH=0; IAAH<=0x03; IAAH++)
:0X4b  e783                     CLR             HRAM_0X83
:0X4c  e782                     CLR             _IAAH_0                              ;_IAAH_0: Bank 511    Addr: 65410    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\WDT\wdt\debug\wdt.obj 
HADR_0X4D:
:0X4d  5082                     MOV             _IAAH_0,        A                    ;_IAAH_0: Bank 511    Addr: 65410    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\WDT\wdt\debug\wdt.obj 
:0X4e  ce03                     SUBI            0X3
:0X4f  9084                     JBS             HRAM_0X84,      0
:0X50  685c                     GOTO            HADR_0X5C
;    {
;        for (IAAL=0; IAAL<0xFF; IAAL++)
:0X51  e781                     CLR             _IAAL_0                              ;_IAAL_0: Bank 511    Addr: 65409    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\WDT\wdt\debug\wdt.obj 
HADR_0X52:
:0X52  e5ff                     MOVI            0XFF
:0X53  ee81                     SUB             _IAAL_0,        A                    ;_IAAL_0: Bank 511    Addr: 65409    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\WDT\wdt\debug\wdt.obj 
:0X54  9884                     JBC             HRAM_0X84,      0
:0X55  6859                     GOTO            HADR_0X59
;            IAD = 0x00;
:0X56  e780                     CLR             _IAD_0                               ;_IAD_0: Bank 511    Addr: 65408    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\WDT\wdt\debug\wdt.obj 
:0X57  5581                     INC             _IAAL_0,        R                    ;_IAAL_0: Bank 511    Addr: 65409    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\WDT\wdt\debug\wdt.obj 
:0X58  6852                     GOTO            HADR_0X52
HADR_0X59:
;        IAD = 0x00;
:0X59  e780                     CLR             _IAD_0                               ;_IAD_0: Bank 511    Addr: 65408    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\WDT\wdt\debug\wdt.obj 
:0X5a  5582                     INC             _IAAH_0,        R                    ;_IAAH_0: Bank 511    Addr: 65410    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\WDT\wdt\debug\wdt.obj 
;    }
:0X5b  684d                     GOTO            HADR_0X4D
HADR_0X5C:
;}
:0X5c  c183                     RET
HADR_0X5D:
;
;/******************************************************
;函数名：void GPIOInit(void)
;描  述：首先初始化所有未用到的IO口为输出低电平
;输入值：无
;输出值：无
;返回值：无
;*******************************************************/
;void GPIOInit(void)
;{
;    ANSL = 0xFF;        //选择对应端口为数字IO功能
:0X5d  e783                     CLR             HRAM_0X83
:0X5e  e5ff                     MOVI            0XFF
:0X5f  e6bc                     MOVA            _ANSL_0                              ;_ANSL_0: Bank 511    Addr: 65468    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\WDT\wdt\debug\wdt.obj 
;	ANSH = 0xFF;
:0X60  e5ff                     MOVI            0XFF
:0X61  e68d                     MOVA            _ANSH_0                              ;_ANSH_0: Bank 511    Addr: 65421    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\WDT\wdt\debug\wdt.obj 
;    PAT = 0x00;         //所有IO设为输出低电平
:0X62  e7ad                     CLR             _PAT_0                               ;_PAT_0: Bank 511    Addr: 65453    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\WDT\wdt\debug\wdt.obj 
;    PBT = 0x00;
:0X63  e7ae                     CLR             _PBT_0                               ;_PBT_0: Bank 511    Addr: 65454    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\WDT\wdt\debug\wdt.obj 
;    PCT = 0x00;
:0X64  e7af                     CLR             _PCT_0                               ;_PCT_0: Bank 511    Addr: 65455    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\WDT\wdt\debug\wdt.obj 
;    PA = 0x00;
:0X65  e7a8                     CLR             _PA_0                                ;_PA_0: Bank 511    Addr: 65448    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\WDT\wdt\debug\wdt.obj 
;    PB = 0x00;
:0X66  e7a9                     CLR             _PB_0                                ;_PB_0: Bank 511    Addr: 65449    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\WDT\wdt\debug\wdt.obj 
;    PC = 0x00;
:0X67  e7aa                     CLR             _PC_0                                ;_PC_0: Bank 511    Addr: 65450    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\WDT\wdt\debug\wdt.obj 
;}
:0X68  c183                     RET
                                ORG             0X1800
:0X1800  e703                   CLR             ?_TMP+3                            ;?_TMP+3: Bank 0    Addr: 3     
:0X1801  e702                   CLR             ?_TMP+2                            ;?_TMP+2: Bank 0    Addr: 2     
:0X1802  5001                   MOV             ?_TMP+1,        A                  ;?_TMP+1: Bank 0    Addr: 1     
:0X1803  9284                   JBS             HRAM_0X84,      2
:0X1804  6807                   GOTO            HADR_0X7
:0X1805  e700                   CLR             ?_TMP                              ;?_TMP: Bank 0    Addr: 0     
:0X1806  6821                   GOTO            HADR_0X21
:0X1807  e5c0                   MOVI            0XC0
:0X1808  5b03                   AND             ?_TMP+3,        R                  ;?_TMP+3: Bank 0    Addr: 3     
:0X1809  a884                   BCC             HRAM_0X84,      0
:0X180a  5503                   INC             ?_TMP+3,        R                  ;?_TMP+3: Bank 0    Addr: 3     
:0X180b  b101                   RLB             ?_TMP+1,        R,              0X1        ;?_TMP+1: Bank 0    Addr: 1     
:0X180c  9084                   JBS             HRAM_0X84,      0
:0X180d  680a                   GOTO            HADR_0XA
:0X180e  d101                   RRB             ?_TMP+1,        R,              0X1        ;?_TMP+1: Bank 0    Addr: 1     
:0X180f  5001                   MOV             ?_TMP+1,        A                  ;?_TMP+1: Bank 0    Addr: 1     
:0X1810  ee00                   SUB             ?_TMP,          A                  ;?_TMP: Bank 0    Addr: 0     
:0X1811  9084                   JBS             HRAM_0X84,      0
:0X1812  6816                   GOTO            HADR_0X16
:0X1813  5001                   MOV             ?_TMP+1,        A                  ;?_TMP+1: Bank 0    Addr: 1     
:0X1814  ef00                   SUB             ?_TMP,          R                  ;?_TMP: Bank 0    Addr: 0     
:0X1815  a084                   BSS             HRAM_0X84,      0
:0X1816  b102                   RLB             ?_TMP+2,        R,              0X1        ;?_TMP+2: Bank 0    Addr: 2     
:0X1817  1103                   DEC             ?_TMP+3,        R                  ;?_TMP+3: Bank 0    Addr: 3     
:0X1818  5003                   MOV             ?_TMP+3,        A                  ;?_TMP+3: Bank 0    Addr: 3     
:0X1819  e23f                   ANDI            0X3F
:0X181a  a884                   BCC             HRAM_0X84,      0
:0X181b  9284                   JBS             HRAM_0X84,      2
:0X181c  680e                   GOTO            HADR_0XE
:0X181d  9f03                   JBC             HRAM_0X3,       7
:0X181e  e902                   NEG             ?_TMP+2                            ;?_TMP+2: Bank 0    Addr: 2     
:0X181f  9e03                   JBC             HRAM_0X3,       6
:0X1820  e900                   NEG             ?_TMP                              ;?_TMP: Bank 0    Addr: 0     
:0X1821  5002                   MOV             ?_TMP+2,        A                  ;?_TMP+2: Bank 0    Addr: 2     
:0X1822  c183                   RET

                                END
